emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master c150b9a: Fix the end-of-query prompt in multi-occur and multi-ise


From: Lars Ingebrigtsen
Subject: master c150b9a: Fix the end-of-query prompt in multi-occur and multi-isearch when fido
Date: Wed, 30 Sep 2020 21:03:45 -0400 (EDT)

branch: master
commit c150b9a24421adca146ada6c5166e3bf974c7c94
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Fix the end-of-query prompt in multi-occur and multi-isearch when fido
    
    * 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 |  6 +-----
 lisp/replace.el  | 18 +++++++++++++-----
 2 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/lisp/misearch.el b/lisp/misearch.el
index 958c10a..6ec10fe 100644
--- a/lisp/misearch.el
+++ b/lisp/misearch.el
@@ -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))
diff --git a/lisp/replace.el b/lisp/replace.el
index 035031a..2d17ec9 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -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))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]