From: Miles Bader Date: Wed, 2 Jun 2004 22:44:45 +0000 (+0000) Subject: Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-363 X-Git-Tag: ttn-vms-21-2-B4~5955 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2d14d61e162b7e7d8d8515ccc40bb97a4edf433e;p=emacs.git Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-363 (read-number): Use canonical format for default in prompt. 2004-06-03 Miles Bader * lisp/subr.el (read-number): Use canonical format for default in prompt. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 72441a20147..83f8a0e1cf0 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,7 @@ 2004-06-03 Miles Bader + * subr.el (read-number): Use canonical format for default in prompt. + * minibuf-eldef.el (minibuffer-default-in-prompt-regexps): Add regexp for " [...]" style defaults. diff --git a/lisp/subr.el b/lisp/subr.el index b90efd46ff0..e4e38d906c6 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -1335,9 +1335,11 @@ Optional DEFAULT is a default password to use instead of empty input." (let ((n nil)) (when default (setq prompt - (if (string-match "\\(\\):[^:]*" prompt) - (replace-match (format " [%s]" default) t t prompt 1) - (concat prompt (format " [%s] " default))))) + (if (string-match "\\(\\):[ \t]*\\'" prompt) + (replace-match (format " (default %s)" default) t t prompt 1) + (replace-regexp-in-string "[ \t]*\\'" + (format " (default %s) " default) + prompt t t)))) (while (progn (let ((str (read-from-minibuffer prompt nil nil nil nil