1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

Use format-prompt in read-string calls (that have default values)

* lisp/vc/vc-annotate.el (vc-annotate):
* lisp/vc/log-edit.el (log-edit-comment-search-backward)
(log-edit-comment-search-forward):
* lisp/textmodes/rst.el (rst-insert-list-new-item):
* lisp/server.el (server-force-delete):
* lisp/mpc.el (mpc):
* lisp/frame.el (set-frame-name):
* lisp/emulation/cua-rect.el (cua-sequence-rectangle):
* lisp/cedet/semantic/symref/list.el (semantic-symref-regexp):
* lisp/calendar/todo-mode.el (todo-read-time): Use `format-prompt'
in `read-string' calls that have defaults.
This commit is contained in:
Lars Ingebrigtsen 2020-09-06 22:59:48 +02:00
parent 52a92c6e7b
commit 95268cdb7e
9 changed files with 37 additions and 24 deletions

View file

@ -6110,11 +6110,12 @@ Valid time strings are those matching `diary-time-regexp'.
Typing `<return>' at the prompt returns the current time, if the
user option `todo-always-add-time-string' is non-nil, otherwise
the empty string (i.e., no time string)."
(let (valid answer)
(let ((default (when todo-always-add-time-string
(format-time-string "%H:%M")))
valid answer)
(while (not valid)
(setq answer (read-string "Enter a clock time: " nil nil
(when todo-always-add-time-string
(format-time-string "%H:%M"))))
(setq answer (read-string (format-prompt "Enter a clock time" default)
nil nil default))
(when (or (string= "" answer)
(string-match diary-time-regexp answer))
(setq valid t)))