]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix the end-of-query prompt in multi-occur and multi-isearch when fido
authorLars Ingebrigtsen <larsi@gnus.org>
Thu, 1 Oct 2020 01:01:33 +0000 (03:01 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Thu, 1 Oct 2020 01:01:33 +0000 (03:01 +0200)
* lisp/misearch.el (multi-isearch-read-buffers): Ditto.

* lisp/replace.el (multi-occur--prompt): New function (bug#41633).
(multi-occur): Use it.

lisp/misearch.el
lisp/replace.el

index 958c10a1bf651ce89b7539383509f856d0822e5e..6ec10fe2c2ebacd5dda8decc52a9002d1ec1e943 100644 (file)
@@ -236,11 +236,7 @@ set in `multi-isearch-buffers' or `multi-isearch-buffers-regexp'."
         (buf nil)
         (ido-ignore-item-temp-list bufs))
     (while (not (string-equal
-                (setq buf (read-buffer
-                           (if (eq read-buffer-function #'ido-read-buffer)
-                               "Next buffer to search (C-j to end): "
-                             "Next buffer to search (RET to end): ")
-                           nil t))
+                (setq buf (read-buffer (multi-occur--prompt) nil t))
                 ""))
       (add-to-list 'bufs buf)
       (setq ido-ignore-item-temp-list bufs))
index 035031ac93d6d1953a5562d34038d1bc0e1ffdce..2d17ec9097ca3668098540130b5299ab1c2344fc 100644 (file)
@@ -1572,6 +1572,18 @@ is not modified."
 
 (defvar ido-ignore-item-temp-list)
 
+(defun multi-occur--prompt ()
+  (concat
+   "Next buffer to search "
+   (cond
+    ((eq read-buffer-function #'ido-read-buffer)
+     (substitute-command-keys
+      "(\\<ido-completion-map>\\[ido-select-text] to end): "))
+    ((bound-and-true-p fido-mode)
+     (substitute-command-keys
+      "(\\<icomplete-fido-mode-map>\\[icomplete-fido-exit] to end): "))
+    (t "(RET to end): "))))
+
 (defun multi-occur (bufs regexp &optional nlines)
   "Show all lines in buffers BUFS containing a match for REGEXP.
 Optional argument NLINES specifies the number of context lines to show
@@ -1587,11 +1599,7 @@ See also `multi-occur-in-matching-buffers'."
           (buf nil)
           (ido-ignore-item-temp-list bufs))
       (while (not (string-equal
-                  (setq buf (read-buffer
-                             (if (eq read-buffer-function #'ido-read-buffer)
-                                 "Next buffer to search (C-j to end): "
-                               "Next buffer to search (RET to end): ")
-                             nil t))
+                  (setq buf (read-buffer (multi-occur--prompt) nil t))
                   ""))
        (cl-pushnew buf bufs)
        (setq ido-ignore-item-temp-list bufs))