emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Buglet in read-number


From: Lawrence Mitchell
Subject: Buglet in read-number
Date: Mon, 19 Apr 2004 22:45:43 +0100
User-agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50

In GNU Emacs 21.3.50.12 (i686-pc-linux-gnu, GTK+ Version 2.2.4)
 of 2004-04-17 on yam

`read-number' does not correctly treat a nil argument in its
call to `read-from-minibuffer'.  `number-to-string' is called
unconditionally on DEFAULT, which, naturally, signals an error
when DEFAULT is nil.

This patch fixed things for me:

Index: subr.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/subr.el,v
retrieving revision 1.383
diff -u -r1.383 subr.el
--- subr.el     14 Apr 2004 20:31:37 -0000      1.383
+++ subr.el     19 Apr 2004 21:45:35 -0000
@@ -1329,7 +1329,8 @@
     (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)))))

-- 
Lawrence Mitchell <address@hidden>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]