diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el index 574261456fc..20887af4849 100644 --- a/lisp/calendar/calendar.el +++ b/lisp/calendar/calendar.el @@ -994,7 +994,7 @@ pre-existing calendar windows." "Set the style of calendar and diary dates to STYLE (a symbol). The valid styles are described in the documentation of `calendar-date-style'." (interactive (list (intern - (completing-read "Date style: " + (completing-read (format-prompt "Date style" "american") '("american" "european" "iso") nil t nil nil "american")))) (or (memq style '(american european iso)) diff --git a/lisp/calendar/todo-mode.el b/lisp/calendar/todo-mode.el index 0e4446f77de..02a7316f263 100644 --- a/lisp/calendar/todo-mode.el +++ b/lisp/calendar/todo-mode.el @@ -4076,7 +4076,9 @@ regexp items." ((equal (file-name-extension f) "todt") "top") ((equal (file-name-extension f) "tody") "diary")))) (push (cons (concat sf-name " (" type ")") f) falist))) - (setq file (completing-read "Choose a filtered items file: " falist nil t nil + (setq file (completing-read (format-prompt "Choose a filtered items file" + (caar falist)) + falist nil t nil 'todo--fifiles-history (caar falist))) (setq file (cdr (assoc-string file falist))) (find-file file) diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el index 1029b52220d..23121c245ef 100644 --- a/lisp/emacs-lisp/checkdoc.el +++ b/lisp/emacs-lisp/checkdoc.el @@ -1573,7 +1573,8 @@ mouse-[0-3]\\)\\)\\>")) ;; a prefix. (let ((disambiguate (completing-read - "Disambiguating Keyword (default variable): " + (format-prompt "Disambiguating Keyword" + "variable") '(("function") ("command") ("variable") ("option") ("symbol")) nil t nil nil "variable"))) diff --git a/lisp/emacs-lisp/elp.el b/lisp/emacs-lisp/elp.el index f68c0faf09d..a94978ac47b 100644 --- a/lisp/emacs-lisp/elp.el +++ b/lisp/emacs-lisp/elp.el @@ -342,9 +342,9 @@ Use optional LIST if provided instead." (interactive (list (intern - (completing-read "Master function: " obarray - #'elp--instrumented-p - t nil nil (if elp-master (symbol-name elp-master)))))) + (let ((default (if elp-master (symbol-name elp-master)))) + (completing-read (format-prompt "Master function" default) + obarray #'elp--instrumented-p t nil nil default))))) ;; When there's a master function, recording is turned off by default. (setq elp-master funsym elp-record-p nil) diff --git a/lisp/emacs-lock.el b/lisp/emacs-lock.el index 5f393a01e8c..ba75a93035e 100644 --- a/lisp/emacs-lock.el +++ b/lisp/emacs-lock.el @@ -176,11 +176,12 @@ Return a value appropriate for `kill-buffer-query-functions' (which see)." arg) ((and (eq arg current-prefix-arg) (consp current-prefix-arg)) ;; called with C-u M-x emacs-lock-mode, so ask the user - (intern (completing-read "Locking mode: " - '("all" "exit" "kill") - nil t nil nil - (symbol-name - emacs-lock-default-locking-mode)))) + (intern (completing-read + (format-prompt "Locking mode" + emacs-lock-default-locking-mode) + '("all" "exit" "kill") + nil t nil nil + (symbol-name emacs-lock-default-locking-mode)))) ((eq mode t) ;; turn on, so use previous setting, or customized default (or emacs-lock--old-mode emacs-lock-default-locking-mode)) diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 8712113790b..e7e43f87347 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -4072,7 +4072,8 @@ If `point' is at the beginning of a channel name, use that as default." (table (when (erc-server-buffer-live-p) (set-buffer (process-buffer erc-server-process)) erc-channel-list))) - (completing-read "Join channel: " table nil nil nil nil chnl)) + (completing-read (format-prompt "Join channel" chnl) + table nil nil nil nil chnl)) (when (or current-prefix-arg erc-prompt-for-channel-key) (read-from-minibuffer "Channel key (RET for none): " nil)))) (erc-cmd-JOIN channel (when (>= (length key) 1) key))) diff --git a/lisp/frame.el b/lisp/frame.el index 70088545a68..05da1ea7b8b 100644 --- a/lisp/frame.el +++ b/lisp/frame.el @@ -1412,12 +1412,12 @@ as though the font-related attributes of the `default' face had been \"set in this session\", so that the font is applied to future frames." (interactive (let* ((completion-ignore-case t) - (font (completing-read "Font name: " + (default (frame-parameter nil 'font)) + (font (completing-read (format-prompt "Font name" default) ;; x-list-fonts will fail with an error ;; if this frame doesn't support fonts. (x-list-fonts "*" nil (selected-frame)) - nil nil nil nil - (frame-parameter nil 'font)))) + nil nil nil nil default))) (list font current-prefix-arg nil))) (when (or (stringp font) (fontp font)) (let* ((this-frame (selected-frame)) diff --git a/lisp/profiler.el b/lisp/profiler.el index 3243e6432f2..0a5ddc1df46 100644 --- a/lisp/profiler.el +++ b/lisp/profiler.el @@ -816,7 +816,7 @@ If MODE is `cpu' or `cpu+mem', time-based profiler will be started. Also, if MODE is `mem' or `cpu+mem', then memory profiler will be started." (interactive (list (if (not (fboundp 'profiler-cpu-start)) 'mem - (intern (completing-read "Mode (default cpu): " + (intern (completing-read (format-prompt "Mode" "cpu") '("cpu" "mem" "cpu+mem") nil t nil nil "cpu"))))) (cl-ecase mode diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el index cee88cb4275..d8f932e7a40 100644 --- a/lisp/tab-bar.el +++ b/lisp/tab-bar.el @@ -665,7 +665,8 @@ to get the name of the last visited tab, the second last, and so on." (let* ((recent-tabs (mapcar (lambda (tab) (alist-get 'name tab)) (tab-bar--tabs-recent)))) - (list (completing-read "Switch to tab by name (default recent): " + (list (completing-read (format-prompt "Switch to tab by name" + (car recent-tabs)) recent-tabs nil nil nil nil recent-tabs)))) (tab-bar-select-tab (1+ (or (tab-bar--tab-index-by-name name) 0)))) diff --git a/lisp/textmodes/rst.el b/lisp/textmodes/rst.el index 5fadec491a5..db17a90a716 100644 --- a/lisp/textmodes/rst.el +++ b/lisp/textmodes/rst.el @@ -2363,7 +2363,7 @@ If user selects enumerations, a further prompt is given. User need to input a starting item, for example 'e' for 'A)' style. The position is also arranged by `rst-insert-list-new-tag'." (let* ((itemstyle (completing-read - "Select preferred item style [#.]: " + (format-prompt "Select preferred item style" "#.") rst-initial-items nil t nil nil "#.")) (cnt (if (string-match (rst-re 'cntexp-tag) itemstyle) (match-string 0 itemstyle)))