summaryrefslogtreecommitdiff
path: root/lisp/calendar
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2020-09-06 22:59:48 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2020-09-06 23:19:43 +0200
commit95268cdb7e63c2ef881d74039284bbb88e132d84 (patch)
tree78c59edd20ffd7090bcdf3f928cb34ea7feaca33 /lisp/calendar
parent52a92c6e7bab2861be47a4637a924b2a74b24b66 (diff)
downloademacs-95268cdb7e63c2ef881d74039284bbb88e132d84.tar.gz
emacs-95268cdb7e63c2ef881d74039284bbb88e132d84.tar.bz2
emacs-95268cdb7e63c2ef881d74039284bbb88e132d84.zip
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.
Diffstat (limited to 'lisp/calendar')
-rw-r--r--lisp/calendar/todo-mode.el9
1 files changed, 5 insertions, 4 deletions
diff --git a/lisp/calendar/todo-mode.el b/lisp/calendar/todo-mode.el
index 02a7316f263..0da87a7e88e 100644
--- a/lisp/calendar/todo-mode.el
+++ b/lisp/calendar/todo-mode.el
@@ -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)))