@code{other}, the help window is selected only if there are more than
two windows on the selected frame.
-@vindex help-window-keep-selected
- Conversely, many commands in the @samp{*Help*} buffer will pop up a
-new window to display the results. For instance, clicking on the link
-to show the source code, or using the @key{i} command to display the
-manual entry, will (by default) pop up a new window. If
-@code{help-window-keep-selected} is changed to non-@code{nil}, the
-window displaying the @samp{*Help*} buffer will be reused instead.
-
@cindex searching documentation efficiently
@cindex looking for a subject in documentation
If you are looking for a certain feature, but don't know what it is
:eval (keymap-lookup (current-global-map) "C-x x g")))
;;;###autoload
-(defun shortdoc-display-group (group &optional function same-window)
+(defun shortdoc-display-group (group &optional function)
"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 SAME-WINDOW, don't pop to a new window."
(interactive (list (completing-read "Show summary for functions in: "
shortdoc--groups)))
- (funcall (if same-window
- #'pop-to-buffer-same-window
- #'pop-to-buffer)
- (shortdoc-display-group-1 group))
+ (pop-to-buffer (shortdoc-display-group-1 group))
(goto-char (point-min))
(when function
(text-property-search-forward 'shortdoc-function function t)
(setq times (1+ times))
(insert-text-button
(symbol-name group)
- 'action (lambda (_)
- (shortdoc-display-group group object
- help-window-keep-selected))
+ 'action (lambda (_) (shortdoc-display-group group object))
'follow-link t
'help-echo "mouse-1, RET: show documentation group"))
groups)
(let* ((location
(find-function-search-for-symbol fun type file))
(position (cdr location)))
- (if help-window-keep-selected
- (pop-to-buffer-same-window (car location))
- (pop-to-buffer (car location)))
+ (pop-to-buffer (car location))
(run-hooks 'find-function-after-hook)
(if position
(progn
(setq file (locate-library file t))
(if (and file (file-readable-p file))
(progn
- (if help-window-keep-selected
- (pop-to-buffer-same-window
- (find-file-noselect file))
- (pop-to-buffer (find-file-noselect file)))
+ (pop-to-buffer (find-file-noselect file))
(widen)
(goto-char (point-min))
(if (re-search-forward
(setq file (help-C-file-name var 'var)))
(let* ((location (find-variable-noselect var file))
(position (cdr location)))
- (if help-window-keep-selected
- (pop-to-buffer-same-window (car location))
- (pop-to-buffer (car location)))
+ (pop-to-buffer (car location))
(run-hooks 'find-function-after-hook)
(if position
(progn
(let* ((location
(find-function-search-for-symbol fun 'defface file))
(position (cdr location)))
- (if help-window-keep-selected
- (pop-to-buffer-same-window (car location))
- (pop-to-buffer (car location)))
+ (pop-to-buffer (car location))
(if position
(progn
;; Widen the buffer if necessary to go to this position.
:supertype 'help-xref
'help-function
(lambda (file pos)
- (if help-window-keep-selected
- (view-file file)
- (view-file-other-window file))
+ (view-file file)
(goto-char pos))
'help-echo "mouse-2, RET: show corresponding NEWS announcement")
(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
- help-window-keep-selected))
+ 'emacs-lisp-mode))
(defun help-goto-lispref-info ()
"View the Emacs Lisp manual *info* node of the current help item."
its frame get input focus even if this option is nil.
This option has effect if and only if the help window was created
-by `with-help-window'.
-
-Also see `help-window-keep-selected'."
+by `with-help-window'."
:type '(choice (const :tag "never (nil)" nil)
(const :tag "other" other)
(const :tag "always (t)" t))
:group 'help
:version "23.1")
-(defcustom help-window-keep-selected nil
- "If non-nil, navigation commands in the *Help* buffer will reuse the window.
-If nil, many commands in the *Help* buffer, like \\<help-mode-map>\\[help-view-source] and \\[help-goto-info], will
-pop to a different window to display the results.
-
-Also see `help-window-select'."
- :type 'boolean
- :group 'help
- :version "29.1")
-
(define-obsolete-variable-alias 'help-enable-auto-load
'help-enable-autoload "27.1")
;;;###autoload (put 'info-lookup-symbol 'info-file "emacs")
;;;###autoload
-(defun info-lookup-symbol (symbol &optional mode same-window)
+(defun info-lookup-symbol (symbol &optional mode)
"Look up and display documentation of SYMBOL in the relevant Info manual.
SYMBOL should be an identifier: a function or method, a macro, a variable,
a data type, a class, etc.
of SYMBOL. It defaults to the current buffer's `major-mode'; if that
mode doesn't have any Info manuals known to Emacs, the command will
prompt for MODE to use, with completion. With prefix arg, the command
-always prompts for MODE.
-
-Is SAME-WINDOW, try to reuse the current window instead of
-popping up a new one."
+always prompts for MODE."
(interactive
(info-lookup-interactive-arguments 'symbol current-prefix-arg))
- (info-lookup 'symbol symbol mode same-window))
+ (info-lookup 'symbol symbol mode))
(put 'info-lookup-symbol 'minibuffer-action
(cons (lambda (sym)
spec
mode)))
-(defun info-lookup (topic item mode &optional same-window)
+(defun info-lookup (topic item mode)
"Display the documentation of TOPIC whose name is ITEM, using MODE's manuals.
TOPIC should be any known symbol of a help topic type, such as `file'
or `symbol'. See the documentation of HELP-TOPIC in the doc
TOPIC is `file', a symbol if TOPIC is `symbol', etc.
MODE is the `major-mode' whose Info manuals to search for documentation
of ITEM; if it's nil, the function uses `info-lookup-file-name-alist'
-and the current buffer's file name to guess the mode.
-
-If SAME-WINDOW, reuse the current window. If nil, pop to a
-different window."
+and the current buffer's file name to guess the mode."
(or mode (setq mode (info-lookup-select-mode)))
(setq mode (info-lookup--item-to-mode item mode))
(let* ((completions (info-lookup->completions topic mode))
(if (not info-lookup-other-window-flag)
(info)
(save-window-excursion (info))
- (if same-window
- (pop-to-buffer-same-window "*info*")
- (let* ((info-window (get-buffer-window "*info*" t))
- (info-frame (and info-window (window-frame info-window))))
- (if (and info-frame
- (not (eq info-frame (selected-frame)))
- (display-multi-frame-p)
- (memq info-frame (frames-on-display-list)))
- ;; *info* is visible in another frame on same display.
- ;; Raise that frame and select the window.
- (progn
- (select-window info-window)
- (raise-frame info-frame))
- ;; In any other case, switch to *info* another window.
- (switch-to-buffer-other-window "*info*"))))))
+ (let* ((info-window (get-buffer-window "*info*" t))
+ (info-frame (and info-window (window-frame info-window))))
+ (if (and info-frame
+ (not (eq info-frame (selected-frame)))
+ (display-multi-frame-p)
+ (memq info-frame (frames-on-display-list)))
+ ;; *info* is visible in another frame on same display.
+ ;; Raise that frame and select the window.
+ (progn
+ (select-window info-window)
+ (raise-frame info-frame))
+ ;; In any other case, switch to *info* another window.
+ (switch-to-buffer-other-window "*info*")))))
(while (and (not found) modes)
(setq doc-spec (info-lookup->doc-spec topic (car modes)))
(while (and (not found) doc-spec)