]> git.eshelyaron.com Git - emacs.git/commitdiff
help-setup-xref: Simplify further
authorDmitry Gutov <dmitry@gutov.dev>
Sun, 6 Oct 2024 13:30:40 +0000 (16:30 +0300)
committerEshel Yaron <me@eshelyaron.com>
Mon, 7 Oct 2024 11:32:56 +0000 (13:32 +0200)
* lisp/help-mode.el (help-setup-xref): Simplify, given that the
vars are marked 'permanent-local' already (bug#73637).

(cherry picked from commit 61c91389a4da90645562a8b80858e62b7526cdd6)

lisp/help-mode.el

index ec69a392a96031b4bd528a5ce6987ddd8d23e862..ff32af9f3446a37f1c6e2e5be1abeeb82eda982c 100644 (file)
@@ -510,19 +510,15 @@ 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)
-    (let ((stack-item help-xref-stack-item)
-          (stack help-xref-stack))
-      (kill-all-local-variables)
-      (setq help-xref-stack-item stack-item
-            help-xref-stack stack)
-      (when help-xref-stack-item
-        (push (cons (point) help-xref-stack-item) help-xref-stack)
-        (setq help-xref-forward-stack nil))
-      (when interactive-p
-        (let ((tail (nthcdr 10 help-xref-stack)))
-      ;; Truncate the stack.
-      (if tail (setcdr tail nil))))
-      (setq help-xref-stack-item item))))
+    (kill-all-local-variables)
+    (when help-xref-stack-item
+      (push (cons (point) help-xref-stack-item) help-xref-stack)
+      (setq help-xref-forward-stack nil))
+    (when interactive-p
+      (let ((tail (nthcdr 10 help-xref-stack)))
+        ;; Truncate the stack.
+        (if tail (setcdr tail nil))))
+    (setq help-xref-stack-item item)))
 
 (defvar help-xref-following nil
   "Non-nil when following a help cross-reference.")