1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-02 08:22:22 +00:00

Use format-prompt in read-regexp.

* lisp/replace.el (read-regexp): Use format-prompt (bug#12443).
This commit is contained in:
Basil L. Contovounesios 2021-01-17 18:56:50 +00:00
parent 9214402791
commit bdb9889f78
No known key found for this signature in database
GPG Key ID: 205AB54A5D5D8CFF

View File

@ -866,13 +866,10 @@ If nil, uses `regexp-history'."
;; Do not automatically add default to the history for empty input.
(history-add-new-input nil)
(input (read-from-minibuffer
(cond ((string-match-p ":[ \t]*\\'" prompt)
prompt)
((and default (> (length default) 0))
(format "%s (default %s): " prompt
(query-replace-descr default)))
(t
(format "%s: " prompt)))
(if (string-match-p ":[ \t]*\\'" prompt)
prompt
(format-prompt prompt (and (length> default 0)
(query-replace-descr default))))
nil nil nil (or history 'regexp-history) suggestions t)))
(if (equal input "")
;; Return the default value when the user enters empty input.