From: Lars Ingebrigtsen Date: Sun, 13 Oct 2019 05:14:03 +0000 (+0200) Subject: Make the previous-matching-history-element prompt clearer X-Git-Tag: emacs-27.0.90~1109 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f4424ca11f256f4dc7b44b1eddc3f9b0a82e14ce;p=emacs.git Make the previous-matching-history-element prompt clearer * lisp/simple.el (previous-matching-history-element): Put the default into the prompt (bug#380). --- diff --git a/lisp/simple.el b/lisp/simple.el index 44ab8e125d6..4d80c4c1b4d 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -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