Wilfred / helpful

A better Emacs *help* buffer
1.11k stars 62 forks source link

Always showing global value. #311

Open haji-ali opened 1 year ago

haji-ali commented 1 year ago

This pull request adds a section that always shows the Global value if the local value is being shown.

minad commented 1 year ago

Maybe use the term "Default Value" instead of "Global Value"?

haji-ali commented 1 year ago

Maybe use the term "Default Value" instead of "Global Value"?

I thought that using Emacs' original nomenclature would be prudent. The code

(progn
  (defvar foo '(1))
  (put 'foo 'standard-value (list (list 'quote '(2))))
  (setq-local foo '(3))
  (describe-variable 'foo))

Shows a *Help* buffer with

foo’s value is (3)
Original value was (2)
Local in buffer *scratch*; global value is (1)

With helpful and this patch, it shows

Value in #<buffer *scratch*>
(3)

Original Value
(2)

Global Value
(1)
magthe commented 1 year ago

I've been trying to hunt down an issue with some hooks in my config and helpful not showing the global value made things a lot harder, until I realised this was the case and disabled helpful :disappointed:

What is keeping this PR from being merged?

rileyrg commented 1 year ago

Maybe use the term "Default Value" instead of "Global Value"?

Default and global have two very different meanings. A global value has a default that can be customised. But it's still global.