diff --git a/etc/NEWS b/etc/NEWS index d0e41baaeb1..04b690806d9 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -30,6 +30,13 @@ applies, and please also update docstrings as needed. * 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. + * Editing Changes in Emacs 29.1 diff --git a/lisp/help-mode.el b/lisp/help-mode.el index 0b404fe89f1..d61b1bdc624 100644 --- a/lisp/help-mode.el +++ b/lisp/help-mode.el @@ -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")))))