* doc/lispref/minibuf.texi (Text from Minibuffer): Document it.
* lisp/minibuffer.el (format-prompt): Allow DEFAULT to be a list
(and use the first element). This is how many of the prompting
functions interpret their default parameters.
If @var{default} is @code{nil}, there is no default value, and
therefore no ``default value'' string is included in the result value.
+If @var{default} is a non-@code{nil} list, the first element of the
+list is used in the prompt.
@end defun
@node Object from Minibuffer
string, and FORMAT-ARGS are the arguments to be substituted into
it. See `format' for details.
+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."
(concat
prompt
(apply #'format prompt format-args))
(and default
- (format minibuffer-default-prompt-format default))
+ (format minibuffer-default-prompt-format
+ (if (consp default)
+ (car default)
+ default)))
": "))
(provide 'minibuffer)