summaryrefslogtreecommitdiff
path: root/lisp/help-mode.el
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2022-05-02 11:30:43 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2022-05-02 11:30:52 +0200
commit97badaab7969ed5a306d6bcd320eb3d592a7f4ae (patch)
tree4017e53cfb5415ff53eb056e98d381a3c212cb5b /lisp/help-mode.el
parent38945225596708a60d332d1f95dc9618e3d974b1 (diff)
downloademacs-97badaab7969ed5a306d6bcd320eb3d592a7f4ae.tar.gz
emacs-97badaab7969ed5a306d6bcd320eb3d592a7f4ae.tar.bz2
emacs-97badaab7969ed5a306d6bcd320eb3d592a7f4ae.zip
Allow reusing the *Help* window with `i'/`s/ commands
* doc/emacs/help.texi (Help): Document it. * lisp/help-mode.el (help-function-def--button-function): Use it. * lisp/help-mode.el (help-goto-info): Use it. * lisp/help.el (help-window-select): Mention it. (help-window-keep-selected): New user option (bug#9054). * lisp/info-look.el (info-lookup-symbol): (info-lookup): Allow keeping the same window.
Diffstat (limited to 'lisp/help-mode.el')
-rw-r--r--lisp/help-mode.el7
1 files changed, 5 insertions, 2 deletions
diff --git a/lisp/help-mode.el b/lisp/help-mode.el
index cb87035281a..c725c0f1a15 100644
--- a/lisp/help-mode.el
+++ b/lisp/help-mode.el
@@ -268,7 +268,9 @@ The format is (FUNCTION ARGS...).")
(let* ((location
(find-function-search-for-symbol fun type file))
(position (cdr location)))
- (pop-to-buffer (car location))
+ (if help-window-keep-selected
+ (pop-to-buffer-same-window (car location))
+ (pop-to-buffer (car location)))
(run-hooks 'find-function-after-hook)
(if position
(progn
@@ -819,7 +821,8 @@ The help buffers are divided into \"pages\" by the ^L character."
(unless help-mode--current-data
(error "No symbol to look up in the current buffer"))
(info-lookup-symbol (plist-get help-mode--current-data :symbol)
- 'emacs-lisp-mode))
+ 'emacs-lisp-mode
+ help-window-keep-selected))
(defun help-goto-lispref-info ()
"View the Emacs Lisp manual *info* node of the current help item."