]> git.eshelyaron.com Git - emacs.git/commitdiff
Inhibit displaying help buffer in main window in perform-replace
authorJuri Linkov <juri@linkov.net>
Wed, 10 Apr 2019 20:48:13 +0000 (23:48 +0300)
committerJuri Linkov <juri@linkov.net>
Wed, 10 Apr 2019 20:48:13 +0000 (23:48 +0300)
* lisp/replace.el (perform-replace): Use
display-buffer-overriding-action with inhibit-same-window to prevent
the help buffer from being displayed in the main window.  (Bug#34972)

Author: MichaƂ Krzywkowski <k.michal@zoho.com>
Copyright-paperwork-exempt: yes

lisp/replace.el

index 318a9fb02537774e1a8054caa93f378dd5d4f1c1..9d1b7bf747dd5f1f059fce26efa6422964864d2b 100644 (file)
@@ -2643,22 +2643,24 @@ characters."
                  (setq def (lookup-key map key))
                  ;; Restore the match data while we process the command.
                  (cond ((eq def 'help)
-                        (with-output-to-temp-buffer "*Help*"
-                          (princ
-                           (concat "Query replacing "
-                                   (if backward "backward " "")
-                                   (if delimited-flag
-                                       (or (and (symbolp delimited-flag)
-                                                (get delimited-flag
-                                                      'isearch-message-prefix))
-                                           "word ") "")
-                                   (if regexp-flag "regexp " "")
-                                   from-string " with "
-                                   next-replacement ".\n\n"
-                                   (substitute-command-keys
-                                    query-replace-help)))
-                          (with-current-buffer standard-output
-                            (help-mode))))
+                        (let ((display-buffer-overriding-action
+                               '(nil (inhibit-same-window . t))))
+                          (with-output-to-temp-buffer "*Help*"
+                            (princ
+                             (concat "Query replacing "
+                                     (if backward "backward " "")
+                                     (if delimited-flag
+                                         (or (and (symbolp delimited-flag)
+                                                  (get delimited-flag
+                                                       'isearch-message-prefix))
+                                             "word ") "")
+                                     (if regexp-flag "regexp " "")
+                                     from-string " with "
+                                     next-replacement ".\n\n"
+                                     (substitute-command-keys
+                                      query-replace-help)))
+                            (with-current-buffer standard-output
+                              (help-mode)))))
                        ((eq def 'exit)
                         (setq keep-going nil)
                         (setq done t))