1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-02-06 07:31:13 -08:00

(read-number): Check whether `default' is nil.

This commit is contained in:
Stefan Monnier 2004-04-20 20:40:41 +00:00
parent efb0e677c7
commit c78633461e

View file

@ -1329,7 +1329,8 @@ Optional DEFAULT is a default password to use instead of empty input."
(while
(progn
(let ((str (read-from-minibuffer prompt nil nil nil nil
(number-to-string default))))
(and default
(number-to-string default)))))
(setq n (cond
((zerop (length str)) default)
((stringp str) (read str)))))