]> git.eshelyaron.com Git - emacs.git/commitdiff
Save position in mark ring before jumping to definition
authorIhor Radchenko <yantar92@gmail.com>
Fri, 1 Oct 2021 07:11:37 +0000 (09:11 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Fri, 1 Oct 2021 07:11:37 +0000 (09:11 +0200)
* lisp/help-mode.el (help-function-def--button-function): Current
point is saved in the mark ring before jumping to definition.

etc/NEWS
lisp/help-mode.el

index d0e41baaeb14a0b6b2d29179fc90214eff788f06..04b690806d9f5873ff4043e841935f35c48dd2a6 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -30,6 +30,13 @@ applies, and please also update docstrings as needed.
 \f
 * Changes in Emacs 29.1
 
+** Help
+
+---
+*** Jumping to function/variable source now saves mark before moving point.
+Jumping to source from "*Help*" buffer moves the point when the source
+buffer is already open.  Now, the old point is pushed to mark ring.
+
 \f
 * Editing Changes in Emacs 29.1
 
index 0b404fe89f16bda962ab625233599ac60070eed7..d61b1bdc624dc76715f181b3911d42c6a1e62bdb 100644 (file)
@@ -273,6 +273,10 @@ The format is (FUNCTION ARGS...).")
             (when (or (< position (point-min))
                       (> position (point-max)))
               (widen))
+            ;; Save mark for the old location, unless the point is not
+            ;; actually going to move.
+            (unless (= (point) position)
+              (push-mark nil t))
             (goto-char position))
         (message "Unable to find location in file")))))