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.
This commit is contained in:
parent
afc14e4f66
commit
1cda7cfb39
2 changed files with 9 additions and 4 deletions
|
@ -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")))
|
:eval (keymap-lookup (current-global-map) "C-x x g")))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###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.
|
"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: "
|
(interactive (list (completing-read "Show summary for functions in: "
|
||||||
(mapcar #'car shortdoc--groups))))
|
(mapcar #'car shortdoc--groups))))
|
||||||
(when (stringp group)
|
(when (stringp group)
|
||||||
(setq group (intern group)))
|
(setq group (intern group)))
|
||||||
(unless (assq group shortdoc--groups)
|
(unless (assq group shortdoc--groups)
|
||||||
(error "No such documentation group %s" group))
|
(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)
|
(let ((inhibit-read-only t)
|
||||||
(prev nil))
|
(prev nil))
|
||||||
(erase-buffer)
|
(erase-buffer)
|
||||||
|
|
|
@ -837,7 +837,8 @@ the C sources, too."
|
||||||
(insert-text-button
|
(insert-text-button
|
||||||
(symbol-name group)
|
(symbol-name group)
|
||||||
'action (lambda (_)
|
'action (lambda (_)
|
||||||
(shortdoc-display-group group object))
|
(shortdoc-display-group group object
|
||||||
|
help-window-keep-selected))
|
||||||
'follow-link t
|
'follow-link t
|
||||||
'help-echo (purecopy "mouse-1, RET: show documentation group")))
|
'help-echo (purecopy "mouse-1, RET: show documentation group")))
|
||||||
groups)
|
groups)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue