(defun scheme-load-file (file-name)
"Load a Scheme file FILE-NAME into the inferior Scheme process."
- (interactive (comint-get-source "Load Scheme file: " scheme-prev-l/c-dir/file
+ (interactive (comint-get-source "Load Scheme file" scheme-prev-l/c-dir/file
scheme-source-modes t)) ; t because `load'
; needs an exact name
(comint-check-source file-name) ; Check to see if buffer needs saved.
(defun scheme-compile-file (file-name)
"Compile a Scheme file FILE-NAME in the inferior Scheme process."
- (interactive (comint-get-source "Compile Scheme file: "
+ (interactive (comint-get-source "Compile Scheme file"
scheme-prev-l/c-dir/file
scheme-source-modes
nil)) ; nil because COMPILE doesn't
then the filename reader will only accept a file that exists.
A typical use:
- (interactive (comint-get-source \"Compile file: \" prev-lisp-dir/file
+ (interactive (comint-get-source \"Compile file\" prev-lisp-dir/file
\\='(lisp-mode) t))"
(let* ((def (comint-source-default prev-dir/file source-modes))
(stringfile (comint-extract-string))
(car def)))
(deffile (if sfile-p (file-name-nondirectory stringfile)
(cdr def)))
- (ans (read-file-name (if deffile (format "%s(default %s) "
- prompt deffile)
- prompt)
+ (ans (read-file-name (format-prompt prompt deffile)
defdir
(concat defdir deffile)
mustmatch-p)))
(do-not-change-default t))
(setq quote-str
(viper-read-string-with-history
- "Quote string: "
+ "Quote string"
nil
'viper-quote-region-history
;; FIXME: Use comment-region.
#'viper-minibuffer-standard-hook
(if (or (not (listp old)) (eq (car old) 'lambda))
(list old) old))))
- (val "")
- (padding "")
- temp-msg)
+ (val ""))
(setq keymap (or keymap minibuffer-local-map)
initial (or initial "")
- viper-initial initial
- temp-msg (if default
- (format "(default %s) " default)
- ""))
+ viper-initial initial)
(setq viper-incomplete-ex-cmd nil)
- (setq val (read-from-minibuffer prompt
- (concat temp-msg initial val padding)
- keymap nil history-var))
- (setq minibuffer-setup-hook nil
- padding (viper-array-to-string (this-command-keys))
- temp-msg "")
+ (setq val (read-from-minibuffer (format-prompt prompt default)
+ nil
+ keymap nil history-var default))
+ (setq minibuffer-setup-hook nil)
;; the following tries to be smart about what to put in history
(if (not (string= val (car (symbol-value history-var))))
(push val (symbol-value history-var)))
(let (buffer buffer-name)
(setq buffer-name
(funcall viper-read-buffer-function
- (format "Kill buffer (%s): "
+ (format-prompt "Kill buffer"
(buffer-name (current-buffer)))))
(setq buffer
(if (null buffer-name)
(interactive)
(let (str)
(setq str (viper-read-string-with-history
- (if viper-re-query-replace "Query replace regexp: "
- "Query replace: ")
+ (if viper-re-query-replace "Query replace regexp"
+ "Query replace")
nil ; no initial
'viper-replace1-history
(car viper-replace1-history) ; default
(query-replace-regexp
str
(viper-read-string-with-history
- (format-message "Query replace regexp `%s' with: " str)
+ (format-message "Query replace regexp `%s' with" str)
nil ; no initial
'viper-replace1-history
(car viper-replace1-history) ; default
(query-replace
str
(viper-read-string-with-history
- (format-message "Query replace `%s' with: " str)
+ (format-message "Query replace `%s' with" str)
nil ; no initial
'viper-replace1-history
(car viper-replace1-history) ; default
(let ((inhibit-read-only t)
(no-default (eobp))
(find-tag-default-function 'ignore))
- (setq tagname (car (find-tag-interactive "Find tag: " no-default)))
+ (setq tagname (car (find-tag-interactive "Find tag" no-default)))
(with-suppressed-warnings ((obsolete find-tag))
(find-tag tagname next-p regexp-p))))
(input
(read-string
(if only-read-p
- (format
- "How many articles from %s (available %d, default %d): "
- (gnus-group-real-name gnus-newsgroup-name)
- number default)
- (format
- "How many articles from %s (%d default): "
- (gnus-group-real-name gnus-newsgroup-name)
- default))
+ (format-prompt
+ "How many articles from %s (available %d)"
+ default
+ (gnus-group-real-name gnus-newsgroup-name)
+ number)
+ (format-prompt
+ "How many articles from %s"
+ default
+ (gnus-group-real-name gnus-newsgroup-name)))
nil
nil
(number-to-string default))))
(interactive
(list
(read-string
- (format "Search article %s (regexp%s): "
- (if current-prefix-arg "backward" "forward")
- (if gnus-last-search-regexp
- (concat ", default " gnus-last-search-regexp)
- "")))
+ (format-prompt "Search article %s (regexp)"
+ gnus-last-search-regexp
+ (if current-prefix-arg "backward" "forward")))
current-prefix-arg)
gnus-summary-mode)
(if (string-equal regexp "")
(interactive
(list
(read-string
- (format "Search article backward (regexp%s): "
- (if gnus-last-search-regexp
- (concat ", default " gnus-last-search-regexp)
- ""))))
+ (format-prompt "Search article backward (regexp)"
+ gnus-last-search-regexp)))
gnus-summary-mode)
(gnus-summary-search-article-forward regexp 'backward))
(interactive
(let* ((default (or (car input-method-history) default-input-method)))
(list (read-input-method-name
- (if default "Select input method (default %s): " "Select input method: ")
+ (format-prompt "Select input method" default)
default t)
t)))
(activate-input-method input-method)
(if (or arg (not default))
(progn
(read-input-method-name
- (if default "Input method (default %s): " "Input method: " )
+ (format-prompt "Input method" default)
default t))
default))
(unless default-input-method
"Describe input method INPUT-METHOD."
(interactive
(list (read-input-method-name
- "Describe input method (default current choice): ")))
+ (format-prompt "Describe input method" current-input-method))))
(if (and input-method (symbolp input-method))
(setq input-method (symbol-name input-method)))
(help-setup-xref (list #'describe-input-method
the new language environment, it runs `set-language-environment-hook'."
(interactive (list (read-language-name
nil
- "Set language environment (default English): ")))
+ (format-prompt "Set language environment" "English"))))
(if language-name
(if (symbolp language-name)
(setq language-name (symbol-name language-name)))
(interactive
(list (read-language-name
'documentation
- "Describe language environment (default current choice): ")))
+ (format-prompt "Describe language environment" current-language-environment))))
(if (null language-name)
(setq language-name current-language-environment))
(if (or (null language-name)
(unless default
(setq default (mml-content-disposition type filename)))
(let ((disposition (completing-read
- (format "Disposition (default %s): " default)
+ (format-prompt "Disposition" default)
'(("attachment") ("inline") (""))
nil t nil nil default)))
(if (not (equal disposition ""))
(or mh-sent-from-msg (nth 0 (mh-translate-range folder "cur")))
(nth 0 (mh-translate-range folder "cur"))))
(message
- (read-string (concat "Message number"
- (or (and default
- (format " (default %d): " default))
- ": "))
+ (read-string (format-prompt "Message number" default)
nil nil
(if (numberp default)
(int-to-string default)
(methods (mapcar (lambda (x) (list (cdr (assoc 'viewer x))))
(mailcap-mime-info type 'all)))
(def (caar methods))
- (prompt (format "Viewer%s: " (if def
- (format " (default %s)" def)
- "")))
+ (prompt (format-prompt "Viewer" def))
(method (completing-read prompt methods nil nil nil nil def))
(folder mh-show-folder-buffer)
(buffer-read-only nil))
((and (or prompt
(equal t mh-mime-save-parts-default-directory))
mh-mime-save-parts-directory)
- (read-directory-name (format
- "Store in directory (default %s): "
- mh-mime-save-parts-directory)
+ (read-directory-name (format-prompt
+ "Store in directory"
+ mh-mime-save-parts-directory)
"" mh-mime-save-parts-directory t ""))
((stringp mh-mime-save-parts-default-directory)
mh-mime-save-parts-default-directory)
(interactive (list
(mml-minibuffer-read-description)
(mh-prompt-for-folder "Message from" mh-sent-from-folder nil)
- (read-string (concat "Messages"
- (if (numberp mh-sent-from-msg)
- (format " (default %d): "
- mh-sent-from-msg)
- ": ")))))
+ (read-string (format-prompt "Messages" mh-sent-from-msg))))
(beginning-of-line)
(insert "#forw [")
(and description
(if current-prefix-arg
(let ((def (or (car mh-mml-cryptographic-method-history)
mh-mml-method-default)))
- (completing-read (format "Method (default %s): " def)
+ (completing-read (format-prompt "Method" def)
'(("pgp") ("pgpmime") ("smime"))
nil t nil 'mh-mml-cryptographic-method-history def))
mh-mml-method-default))
(type (or (and (not (equal probed-type "application/octet-stream"))
probed-type)
(completing-read
- (format "Content type (default %s): " default)
+ (format-prompt "Content type" default)
(mapcar #'list (mailcap-mime-types))))))
(if (not (equal type ""))
type
the NOT-EMPTY flag is non-nil, and supply an optional DEFAULT
sequence. A reply of `%' defaults to the first sequence
containing the current message."
- (let* ((input (completing-read (format "%s sequence%s: " prompt
- (if default
- (format " (default %s)" default)
- ""))
+ (let* ((input (completing-read (format-prompt "%s sequence" default prompt)
(mh-seq-names mh-seq-list)
nil nil nil 'mh-sequence-history))
(seq (cond ((equal input "%")
((stringp default) default)
((symbolp default) (symbol-name default))))
(prompt (cond ((and guess large default)
- (format "%s (folder has %s messages, default %s)"
- prompt (car counts) default))
- ((and guess large)
- (format "%s (folder has %s messages)"
- prompt (car counts)))
+ (format-prompt "%s (folder has %s messages)"
+ default prompt (car counts)))
(default
- (format "%s (default %s)" prompt default))))
+ (format-prompt prompt default))))
(minibuffer-local-completion-map mh-range-completion-map)
(seq-list (if (eq folder mh-current-folder)
mh-seq-list
(mh-seq-names seq-list)))
(input (cond ((and (not ask-flag) unseen) (symbol-name mh-unseen-seq))
((and (not ask-flag) (not large)) "all")
- (t (completing-read (format "%s: " prompt)
+ (t (completing-read prompt
'mh-range-completion-function nil nil
nil 'mh-range-history default))))
msg-list)
used in searching."
(if (null default)
(setq default ""))
- (let* ((default-string (cond (default-string (format " (default %s)" default-string))
- ((equal "" default) "")
- (t (format " (default %s)" default))))
- (prompt (format "%s folder%s: " prompt default-string))
+ (let* ((default-string (or default-string
+ (if (equal default "") nil default)))
+ (prompt (format-prompt "%s folder" default-string prompt))
(mh-current-folder-name mh-current-folder)
read-name folder-name)
(while (and (setq read-name (mh-folder-completing-read
If DEFAULT is a list, the first element is used as the default.
If not, the element is used as is.
-If DEFAULT is nil, no \"default value\" string is included in the
-return value."
+If DEFAULT is nil or an empty string, no \"default value\" string
+is included in the return value."
(concat
(if (null format-args)
prompt
(apply #'format prompt format-args))
(and default
+ (length> default 0)
(format minibuffer-default-prompt-format
(if (consp default)
(car default)
"Read a tag name, with defaulting and completion."
(let* ((completion-ignore-case (find-tag--completion-ignore-case))
(default (find-tag--default))
- (spec (completing-read (if default
- (format "%s (default %s): "
- (substring string 0 (string-match "[ :]+\\'" string))
- default)
- string)
+ (spec (completing-read (format-prompt string default)
(tags-lazy-completion-table)
nil nil nil nil default)))
(if (equal spec "")
Contrast this with the ring of marks gone to by the command.
See documentation of variable `tags-file-name'."
- (interactive (find-tag-interactive "Find tag: "))
+ (interactive (find-tag-interactive "Find tag"))
(setq find-tag-history (cons tagname find-tag-history))
;; Save the current buffer's value of `find-tag-hook' before
See documentation of variable `tags-file-name'."
(declare (obsolete xref-find-definitions "25.1"))
- (interactive (find-tag-interactive "Find tag: "))
+ (interactive (find-tag-interactive "Find tag"))
(let* ((buf (find-tag-noselect tagname next-p regexp-p))
(pos (with-current-buffer buf (point))))
(condition-case nil
See documentation of variable `tags-file-name'."
(declare (obsolete xref-find-definitions-other-window "25.1"))
- (interactive (find-tag-interactive "Find tag other window: "))
+ (interactive (find-tag-interactive "Find tag other window"))
;; This hair is to deal with the case where the tag is found in the
;; selected window's buffer; without the hair, point is moved in both
See documentation of variable `tags-file-name'."
(declare (obsolete xref-find-definitions-other-frame "25.1"))
- (interactive (find-tag-interactive "Find tag other frame: "))
+ (interactive (find-tag-interactive "Find tag other frame"))
(let ((pop-up-frames t))
(with-suppressed-warnings ((obsolete find-tag-other-window))
(find-tag-other-window tagname next-p))))
See documentation of variable `tags-file-name'."
(declare (obsolete xref-find-apropos "25.1"))
- (interactive (find-tag-interactive "Find tag regexp: " t))
+ (interactive (find-tag-interactive "Find tag regexp" t))
;; We go through find-tag-other-window to do all the display hair there.
(funcall (if other-window 'find-tag-other-window 'find-tag)
regexp next-p t))
(name (idlwave-completing-read
(if (or (not this-buffer)
(assoc default list))
- (format "Module (Default %s): " default)
+ (format-prompt "Module" default)
(format "Module in this file: "))
list))
type class)
(defun lisp-load-file (file-name)
"Load a Lisp file into the inferior Lisp process."
- (interactive (comint-get-source "Load Lisp file: " lisp-prev-l/c-dir/file
+ (interactive (comint-get-source "Load Lisp file" lisp-prev-l/c-dir/file
lisp-source-modes nil)) ; nil because LOAD
; doesn't need an exact name
(comint-check-source file-name) ; Check to see if buffer needs saved.
(defun lisp-compile-file (file-name)
"Compile a Lisp file in the inferior Lisp process."
- (interactive (comint-get-source "Compile Lisp file: " lisp-prev-l/c-dir/file
+ (interactive (comint-get-source "Compile Lisp file" lisp-prev-l/c-dir/file
lisp-source-modes nil)) ; nil = don't need
; suffix .lisp
(comint-check-source file-name) ; Check to see if buffer needs saved.
(list
;; car because comint-get-source returns a list holding the
;; filename.
- (car (comint-get-source "Load Tcl file: "
+ (car (comint-get-source "Load Tcl file"
(or (and
(derived-mode-p 'tcl-mode)
(buffer-file-name))
Prefix argument means switch to the Tcl buffer afterwards."
(interactive
(list
- (car (comint-get-source "Restart with Tcl file: "
+ (car (comint-get-source "Restart with Tcl file"
(or (and
(derived-mode-p 'tcl-mode)
(buffer-file-name))
(xref--prompt-p this-command))
(let ((id
(completing-read
- (if def
- (format "%s (default %s): "
- (substring prompt 0 (string-match
- "[ :]+\\'" prompt))
- def)
- prompt)
+ (format-prompt prompt def)
(xref-backend-identifier-completion-table backend)
nil nil nil
'xref--read-identifier-history def)))
definition for IDENTIFIER, display it in the selected window.
Otherwise, display the list of the possible definitions in a
buffer where the user can select from the list."
- (interactive (list (xref--read-identifier "Find definitions of: ")))
+ (interactive (list (xref--read-identifier "Find definitions of")))
(xref--find-definitions identifier nil))
;;;###autoload
(defun xref-find-definitions-other-window (identifier)
"Like `xref-find-definitions' but switch to the other window."
- (interactive (list (xref--read-identifier "Find definitions of: ")))
+ (interactive (list (xref--read-identifier "Find definitions of")))
(xref--find-definitions identifier 'window))
;;;###autoload
(defun xref-find-definitions-other-frame (identifier)
"Like `xref-find-definitions' but switch to the other frame."
- (interactive (list (xref--read-identifier "Find definitions of: ")))
+ (interactive (list (xref--read-identifier "Find definitions of")))
(xref--find-definitions identifier 'frame))
;;;###autoload
With prefix argument, or if `xref-prompt-for-identifier' is t,
always prompt for the identifier. If `xref-prompt-for-identifier'
is nil, prompt only if there's no usable symbol at point."
- (interactive (list (xref--read-identifier "Find references of: ")))
+ (interactive (list (xref--read-identifier "Find references of")))
(xref--find-xrefs identifier 'references identifier nil))
;;;###autoload
(barf-if-buffer-read-only)
(if (eq default t)
(setq default "")
- (setq prompt (format "%s (default %S): "
- (substring prompt 0 -2)
- default)))
+ (setq prompt (format-prompt prompt default)))
(dolist (key ses-completion-keys)
(define-key ses-mode-edit-map key 'ses-read-printer-complete-symbol))
;; make it globally visible, so that it can be visible from the minibuffer.
;;Range contains differing printer functions
(setq default t)
(throw 'ses-read-cell-printer t))))))
- (list (ses-read-printer (format "Cell %S printer: " ses--curcell)
+ (list (ses-read-printer (format "Cell %S printer" ses--curcell)
default))))
(unless (eq newval t)
(ses-begin-change)
(interactive
(let ((col (cdr (ses-sym-rowcol ses--curcell))))
(ses-check-curcell)
- (list col (ses-read-printer (format "Column %s printer: "
+ (list col (ses-read-printer (format "Column %s printer"
(ses-column-letter col))
(ses-col-printer col)))))
"Set the default printer function for cells that have no other.
See `ses-read-cell-printer' for input forms."
(interactive
- (list (ses-read-printer "Default printer: " ses--default-printer)))
+ (list (ses-read-printer "Default printer" ses--default-printer)))
(unless (eq newval t)
(ses-begin-change)
(ses-set-parameter 'ses--default-printer newval)
(setq name (intern name))
(let* ((cur-printer (gethash name ses--local-printer-hashmap))
(default (and cur-printer (ses--locprn-def cur-printer))))
- (setq def (ses-read-printer (format "Enter definition of printer %S: " name)
+ (setq def (ses-read-printer (format "Enter definition of printer %S" name)
default)))
(list name def)))
(when default1
(setq prompt
(if (string-match "\\(\\):[ \t]*\\'" prompt)
- (replace-match (format " (default %s)" default1) t t prompt 1)
+ (replace-match (format minibuffer-default-prompt-format default1) t t prompt 1)
(replace-regexp-in-string "[ \t]*\\'"
- (format " (default %s) " default1)
+ (format minibuffer-default-prompt-format default1)
prompt t t))))
(while
(progn
;; then the filename reader will only accept a file that exists.
;;
;; A typical use:
-;; (interactive (term-get-source "Compile file: " prev-lisp-dir/file
+;; (interactive (term-get-source "Compile file" prev-lisp-dir/file
;; '(lisp-mode) t))
;; This is pretty stupid about strings. It decides we're in a string
(car def)))
(deffile (if sfile-p (file-name-nondirectory stringfile)
(cdr def)))
- (ans (read-file-name (if deffile (format "%s(default %s) "
- prompt deffile)
- prompt)
+ (ans (read-file-name (format-prompt prompt deffile)
defdir
(concat defdir deffile)
mustmatch-p)))
STRING_MULTIBYTE (prompt));
}
- AUTO_STRING (format, "%s (default %s): ");
- prompt = CALLN (Fformat, format, prompt,
+ prompt = CALLN (Ffuncall, intern("format-prompt"),
+ prompt,
CONSP (def) ? XCAR (def) : def);
}