From f4424ca11f256f4dc7b44b1eddc3f9b0a82e14ce Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Sun, 13 Oct 2019 07:14:03 +0200 Subject: [PATCH] Make the previous-matching-history-element prompt clearer * lisp/simple.el (previous-matching-history-element): Put the default into the prompt (bug#380). --- lisp/simple.el | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) 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 -- 2.39.5