Mercurial > emacs
changeset 55891:3c32f5d8430f
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 <miles@gnu.org>
* lisp/subr.el (read-number): Use canonical format for default in prompt.
author | Miles Bader <miles@gnu.org> |
---|---|
date | Wed, 02 Jun 2004 22:44:45 +0000 |
parents | e046a551c6da |
children | c12c7852c322 |
files | lisp/ChangeLog lisp/subr.el |
diffstat | 2 files changed, 7 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/ChangeLog Wed Jun 02 22:43:42 2004 +0000 +++ b/lisp/ChangeLog Wed Jun 02 22:44:45 2004 +0000 @@ -1,5 +1,7 @@ 2004-06-03 Miles Bader <miles@gnu.org> + * subr.el (read-number): Use canonical format for default in prompt. + * minibuf-eldef.el (minibuffer-default-in-prompt-regexps): Add regexp for " [...]" style defaults.
--- a/lisp/subr.el Wed Jun 02 22:43:42 2004 +0000 +++ b/lisp/subr.el Wed Jun 02 22:44:45 2004 +0000 @@ -1335,9 +1335,11 @@ (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