]> git.eshelyaron.com Git - emacs.git/commitdiff
Make the previous-matching-history-element prompt clearer
authorLars Ingebrigtsen <larsi@gnus.org>
Sun, 13 Oct 2019 05:14:03 +0000 (07:14 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Sun, 13 Oct 2019 05:14:03 +0000 (07:14 +0200)
* lisp/simple.el (previous-matching-history-element): Put the
default into the prompt (bug#380).

lisp/simple.el

index 44ab8e125d6ec74e65996bb40ccef01cbe72a0c9..4d80c4c1b4de97621d25b06af8f314c6ecd012e6 100644 (file)
@@ -2002,12 +2002,15 @@ makes the search case-sensitive.
 See also `minibuffer-history-case-insensitive-variables'."
   (interactive
    (let* ((enable-recursive-minibuffers t)
-         (regexp (read-from-minibuffer "Previous element matching (regexp): "
-                                       nil
-                                       minibuffer-local-map
-                                       nil
-                                       'minibuffer-history-search-history
-                                       (car minibuffer-history-search-history))))
+         (regexp (read-from-minibuffer
+                   (format "Previous element matching regexp%s: "
+                           (if minibuffer-history-search-history
+                               (format " (default %s)"
+                                       (car minibuffer-history-search-history))
+                             ""))
+                  nil minibuffer-local-map nil
+                  'minibuffer-history-search-history
+                  (car minibuffer-history-search-history))))
      ;; Use the last regexp specified, by default, if input is empty.
      (list (if (string= regexp "")
               (if minibuffer-history-search-history