[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 1cda7cfb39: Respect help-window-keep-selected in shortdoc buttons
From: |
Lars Ingebrigtsen |
Subject: |
master 1cda7cfb39: Respect help-window-keep-selected in shortdoc buttons |
Date: |
Fri, 6 May 2022 10:21:23 -0400 (EDT) |
branch: master
commit 1cda7cfb390c9612caf73e977d64d9e0eff5735c
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>
Respect help-window-keep-selected in shortdoc buttons
* lisp/help-fns.el (help-fns--mention-shortdoc-groups): Respect
help-window-keep-selected.
* lisp/emacs-lisp/shortdoc.el (shortdoc-display-group): Allow
reusing the window.
---
lisp/emacs-lisp/shortdoc.el | 10 +++++++---
lisp/help-fns.el | 3 ++-
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/lisp/emacs-lisp/shortdoc.el b/lisp/emacs-lisp/shortdoc.el
index ebf3c6b1fe..340fe766c1 100644
--- a/lisp/emacs-lisp/shortdoc.el
+++ b/lisp/emacs-lisp/shortdoc.el
@@ -1298,16 +1298,20 @@ A FUNC form can have any number of `:no-eval' (or
`:no-value'),
:eval (keymap-lookup (current-global-map) "C-x x g")))
;;;###autoload
-(defun shortdoc-display-group (group &optional function)
+(defun shortdoc-display-group (group &optional function same-window)
"Pop to a buffer with short documentation summary for functions in GROUP.
-If FUNCTION is non-nil, place point on the entry for FUNCTION (if any)."
+If FUNCTION is non-nil, place point on the entry for FUNCTION (if any).
+If SAME-WINDOW, don't pop to a new window."
(interactive (list (completing-read "Show summary for functions in: "
(mapcar #'car shortdoc--groups))))
(when (stringp group)
(setq group (intern group)))
(unless (assq group shortdoc--groups)
(error "No such documentation group %s" group))
- (pop-to-buffer (format "*Shortdoc %s*" group))
+ (funcall (if same-window
+ #'pop-to-buffer-same-window
+ #'pop-to-buffer)
+ (format "*Shortdoc %s*" group))
(let ((inhibit-read-only t)
(prev nil))
(erase-buffer)
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index 0cb2c6d5d7..927a4f0d2c 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -837,7 +837,8 @@ the C sources, too."
(insert-text-button
(symbol-name group)
'action (lambda (_)
- (shortdoc-display-group group object))
+ (shortdoc-display-group group object
+ help-window-keep-selected))
'follow-link t
'help-echo (purecopy "mouse-1, RET: show documentation group")))
groups)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master 1cda7cfb39: Respect help-window-keep-selected in shortdoc buttons,
Lars Ingebrigtsen <=