]> git.eshelyaron.com Git - emacs.git/commitdiff
Drop 'help-window-keep-selected'
authorEshel Yaron <me@eshelyaron.com>
Thu, 6 Mar 2025 09:54:42 +0000 (10:54 +0100)
committerEshel Yaron <me@eshelyaron.com>
Thu, 6 Mar 2025 09:54:42 +0000 (10:54 +0100)
doc/emacs/help.texi
lisp/emacs-lisp/shortdoc.el
lisp/help-fns.el
lisp/help-mode.el
lisp/help.el
lisp/info-look.el

index 13e2058cd887de115c5cbda77de07aa66177d057..856b2ccdddef883b12f110175e4d680d1ced4378 100644 (file)
@@ -24,14 +24,6 @@ is unconditionally selected by help commands, and if its value is
 @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
index 06e0d3f1b0e6a64f80f617527811de58f5cdfa0d..f3e7a02c1bb12abec4ce910c6bfb67501114e469 100644 (file)
@@ -1605,16 +1605,13 @@ 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 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)
index a97e67cf7c50e71f799132f08fd3629f47f49773..fc494b7b93e3964d491f093902b3c7c4f49dffa7 100644 (file)
@@ -1050,9 +1050,7 @@ TYPE indicates the namespace and is `fun' or `var'."
            (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)
index 7a9b85f3a70019db97c3aefab381f36bc6602c3b..7c18e577b4bb552daeddc96123cc7b6a932cbef1 100644 (file)
@@ -275,9 +275,7 @@ The format is (FUNCTION ARGS...).")
     (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
@@ -303,10 +301,7 @@ The format is (FUNCTION ARGS...).")
                   (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
@@ -325,9 +320,7 @@ The format is (FUNCTION ARGS...).")
                     (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
@@ -348,9 +341,7 @@ The format is (FUNCTION ARGS...).")
                   (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.
@@ -387,9 +378,7 @@ The format is (FUNCTION ARGS...).")
   :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")
 
@@ -865,8 +854,7 @@ 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
-                      help-window-keep-selected))
+                      'emacs-lisp-mode))
 
 (defun help-goto-lispref-info ()
   "View the Emacs Lisp manual *info* node of the current help item."
index 75803afdfd446b47fc456220e7796ad852f80644..6cdf71cea398fab0b41d1b8a70e25e3f3fb88800 100644 (file)
@@ -2160,25 +2160,13 @@ the help window appears on another frame, it may get selected and
 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")
 
index c625894054e6ec98437bb2549def027e8715300e..797e69f5bce9b39baa13bb5f45f717f742bdfa81 100644 (file)
@@ -278,7 +278,7 @@ system."
 
 ;;;###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.
@@ -291,13 +291,10 @@ MODE is the major mode whose Info manuals to search for the documentation
 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)
@@ -398,7 +395,7 @@ If optional argument QUERY is non-nil, query for the help mode."
         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
@@ -407,10 +404,7 @@ ITEM is the item whose documentation to search: file name if
 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))
@@ -433,21 +427,19 @@ different window."
       (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)