Make the previous-matching-history-element prompt clearer

* lisp/simple.el (previous-matching-history-element): Put the
default into the prompt (bug#380).
This commit is contained in:
Lars Ingebrigtsen 2019-10-13 07:14:03 +02:00
parent f0002b2d84
commit f4424ca11f

View 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