Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Treatment of local/global values #312

Open
haji-ali opened this issue Jan 11, 2023 · 0 comments
Open

Treatment of local/global values #312

haji-ali opened this issue Jan 11, 2023 · 0 comments

Comments

@haji-ali
Copy link

While writing #311, I noticed that helpful calls the function local-variable-if-set-p without a second argument which means that it defaults to the current buffer (being the helpful buffer in most cases) even when helpful--associated-buffer is non-nil. Is this intentional?

Also, there are several places where symbol-value is called without with-current-buffer even when helpful--associated-buffer is non-nil. For example, in

helpful/helpful.el

Lines 2199 to 2205 in 94c2533

(defun helpful--original-value-differs-p (sym)
"Return t if SYM has an original value, and its current
value is different."
(let ((orig-val-list (helpful--original-value sym)))
(and (consp orig-val-list)
(not (eq (car orig-val-list)
(symbol-value sym))))))

The test if the local value is different will be against the value in the current buffer (the helpful buffer) rather than the associated buffer. So the original value will not be shown even if it is changed in the local buffer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant