From e94ae3711796679e330637921b980f970b9d7025 Mon Sep 17 00:00:00 2001 Message-Id: From: Ihor Radchenko Date: Tue, 21 Sep 2021 17:00:50 +0800 Subject: [PATCH 1/2] Save position in mark ring before jumping to definition * lisp/help-mode.el (help-function-def--button-function): Current point is saved in the mark ring before jumping to definition. Following up: https://lists.gnu.org/archive/html/emacs-devel/2021-09/msg01561.html --- etc/NEWS | 3 +++ lisp/help-mode.el | 1 + 2 files changed, 4 insertions(+) diff --git a/etc/NEWS b/etc/NEWS index 2bdcb6434b..2132e8babc 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -648,7 +648,10 @@ clicking the "X" icon in the tool bar. --- *** 'g' ('revert-buffer') in 'help-mode' no longer requires confirmation. +*** 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. +--- ** File Locks +++ diff --git a/lisp/help-mode.el b/lisp/help-mode.el index 551cf7e1a3..57655db337 100644 --- a/lisp/help-mode.el +++ b/lisp/help-mode.el @@ -268,6 +268,7 @@ help-function-def--button-function (when (or (< position (point-min)) (> position (point-max))) (widen)) + (push-mark nil t) (goto-char position)) (message "Unable to find location in file"))))) -- 2.32.0