Skip to content

Treatment of local/global values #312

Description

@haji-ali

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions