From 31f841b1e3921f7b2039656ed8f409b3b715741f Mon Sep 17 00:00:00 2001 Message-Id: <31f841b1e3921f7b2039656ed8f409b3b715741f.1632207397.git.yantar92@gmail.com> From: Ihor Radchenko Date: Tue, 21 Sep 2021 14:50:52 +0800 Subject: [PATCH] Save position in mark ring before jumping to definition * lisp/emacs-lisp/find-func.el (find-function-after-hook): `push-mark' is added to default value of the hook. Following up: https://lists.gnu.org/archive/html/emacs-devel/2021-09/msg01561.html --- etc/NEWS | 3 +++ lisp/emacs-lisp/find-func.el | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) 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/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el index 303039d653..b984fb3870 100644 --- a/lisp/emacs-lisp/find-func.el +++ b/lisp/emacs-lisp/find-func.el @@ -165,7 +165,7 @@ find-function-recenter-line :group 'find-function :version "20.3") -(defcustom find-function-after-hook nil +(defcustom find-function-after-hook '(push-mark) "Hook run after finding symbol definition. See the functions `find-function' and `find-variable'." -- 2.32.0