Comments (10)
I've run into the same issue - neither helpful-variable
, nor helpful-at-point
are aware of the buffer-local value.
from helpful.
@Alexander-Miller helpful-variable
and helpful-at-point
should show the buffer-local value. If not, would you mind opening a separate issue?
I think this issue is about showing the default, initial value, not the global value of a buffer-local variable.
from helpful.
Pretty sure I just expressed myself the wrong way round. Trying again the issue is that helpful won't mention the original value. For example do this:
(defvar-local foobar 25)
(setq foobar 10)
When you ask helpful in the same buffer about the variable it will only show 10 as its value.
from helpful.
@Wilfred This doesn't appear to fix the issue. Evaluating the code of @Alexander-Miller and then running M-x helpful-variable RET foobar RET
gives me (with the latest version of Helpful from master):
foobar is a buffer-local variable without a source file.
Value in #<buffer *scratch*>
10
Buffer values Default value Set
References
Could not find source file.
Find all references
Debugging
Forget
Source Code
which pretty clearly doesn't include the text 25
anywhere. Whereas M-x describe-variable RET foobar RET
gives me:
foobar’s value is 10
Local in buffer *scratch*; global value is 25
Automatically becomes buffer-local when set.
Documentation:
Not documented as a variable.
which does.
from helpful.
@raxod502 press the 'Default value' button. Helpful lets you view the value in every buffer, so it can't show everything at once.
Perhaps 'Global value' would be better text on the button?
from helpful.
Oh, I see—my bad, sorry.
I do think it would make sense (by default) to show both the global value and one buffer-local value, as that only takes a constant amount of extra space and the default help buffer does it.
And I agree; 'Global value' would probably be more intuitive as it's the language used in Emacs' help facility.
from helpful.
I've updated the button text.
I'm afraid I'm unwilling to show both variables by default: the helpful buffer is already showing a lot of data. For some variables it's fine (e.g. major-mode
) but for variables with list values, it's already a lot to show.
What do you think? Can you see a nice heuristic to use here? I agree that for many variables it's fine to show both (most of the variables I've tried are fine, but hooks or buffer-undo-list
can get big).
from helpful.
I think I'd be totally satisfied if there were an easy way to toggle between the global and buffer-local values; as is, it's one click to go from buffer-local to global, but to go the other way, I have to select the current buffer's name from a list.
from helpful.
What would you expect to happen when you go from global to buffer-local? Would you be happy with a prompt for a buffer that defaulted to the original buffer you started from?
from helpful.
I would be satisfied with that, yes. It looks currently like the order is just defined by buffer-list
, and there is no default defined. Instead, I think the default should be whatever the last buffer was.
from helpful.
Related Issues (20)
- Wrong-type-argument error on pseudo-function symbols HOT 1
- Request new release HOT 2
- Support for other languages?
- Question: using ido with helpful-* HOT 1
- Can `helpful-key` show which key, key combo, or key sequence was pressed? HOT 3
- helpful--docstring-advice failure against GNU Emacs 28.1 HOT 2
- Find all references not working on latest emacs29 build from git HOT 3
- [Help] using helpful with ivy
- Treatment of local/global values
- Can't install using Straight.el: `Wrong type argument: listp, 1` HOT 2
- Suggestion: `helpful--navigate` should respect `display-buffer-alist` HOT 1
- RFE: Duplicate help-mode's `c`, `i` and `s` bindings HOT 1
- Docstrings should not double-escape strings
- helpful-variable not working
- invalid-read-syntax "] in a list" 2 22
- How do you go back? HOT 3
- Handling of left/right single quotation marks
- Case in disambiguation of variable or function definition of a symbol
- New stable release for Emacs 29? HOT 1
- forward-sexp: Scan error: "Unbalanced parentheses", 121867, 1 with Emacs 29 HOT 18
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from helpful.