]> git.eshelyaron.com Git - emacs.git/commitdiff
help-setup-xref: Fix the previous changes
authorDmitry Gutov <dmitry@gutov.dev>
Wed, 9 Oct 2024 01:03:51 +0000 (04:03 +0300)
committerEshel Yaron <me@eshelyaron.com>
Mon, 14 Oct 2024 17:37:22 +0000 (19:37 +0200)
* lisp/help-mode.el (help-setup-xref): Instead of killing all
local variables directly, call the current major mode function, to
preserve its own locals while dropping the rest (bug#73637).

(cherry picked from commit ef87ce0ffae95de61e1c34ed27ff22c1051769e8)

lisp/help-mode.el

index ff32af9f3446a37f1c6e2e5be1abeeb82eda982c..8f69b0602a2d2be9e5073fc1e236a66bd5458b70 100644 (file)
@@ -510,7 +510,8 @@ This should be called very early, before the output buffer is cleared,
 because we want to record the \"previous\" position of point so we can
 restore it properly when going back."
   (with-current-buffer (help-buffer)
-    (kill-all-local-variables)
+    ;; Re-enable major mode, killing all unrelated local vars.
+    (funcall major-mode)
     (when help-xref-stack-item
       (push (cons (point) help-xref-stack-item) help-xref-stack)
       (setq help-xref-forward-stack nil))