emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r112411: * src/callint.c (Fcall_inter


From: Juri Linkov
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r112411: * src/callint.c (Fcall_interactively): Call `Qread_number' for
Date: Sun, 28 Apr 2013 00:12:17 +0300
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 112411
fixes bug: http://debbugs.gnu.org/14254
committer: Juri Linkov <address@hidden>
branch nick: trunk
timestamp: Sun 2013-04-28 00:12:17 +0300
message:
  * src/callint.c (Fcall_interactively): Call `Qread_number' for
  interactive code letter `n' instead of using duplicate code.
  
  * lisp/subr.el (read-number): Doc fix about using it by interactive
  code letter `n'.
modified:
  lisp/ChangeLog
  lisp/subr.el
  src/ChangeLog
  src/callint.c
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-04-27 20:55:00 +0000
+++ b/lisp/ChangeLog    2013-04-27 21:12:17 +0000
@@ -1,5 +1,10 @@
 2013-04-27  Juri Linkov  <address@hidden>
 
+       * subr.el (read-number): Doc fix about using it by interactive
+       code letter `n'.  (Bug#14254)
+
+2013-04-27  Juri Linkov  <address@hidden>
+
        * desktop.el (desktop-auto-save-timeout): New option.
        (desktop-file-checksum): New variable.
        (desktop-save): Add optional arg `auto-save' and don't auto-save

=== modified file 'lisp/subr.el'
--- a/lisp/subr.el      2013-04-26 07:34:54 +0000
+++ b/lisp/subr.el      2013-04-27 21:12:17 +0000
@@ -2200,11 +2200,11 @@
               ;; And of course, don't keep the sensitive data around.
               (erase-buffer))))))))
 
-;; This should be used by `call-interactively' for `n' specs.
 (defun read-number (prompt &optional default)
   "Read a numeric value in the minibuffer, prompting with PROMPT.
 DEFAULT specifies a default value to return if the user just types RET.
-The value of DEFAULT is inserted into PROMPT."
+The value of DEFAULT is inserted into PROMPT.
+This function is used by the `interactive' code letter `n'."
   (let ((n nil)
        (default1 (if (consp default) (car default) default)))
     (when default1

=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2013-04-27 15:34:28 +0000
+++ b/src/ChangeLog     2013-04-27 21:12:17 +0000
@@ -1,3 +1,9 @@
+2013-04-27  Juri Linkov  <address@hidden>
+
+       * callint.c (Fcall_interactively): Call `Qread_number' for
+       interactive code letter `n' instead of using duplicate code.
+       (Bug#14254)
+
 2013-04-27  Paul Eggert  <address@hidden>
 
        * systime.h (make_timeval): Declare as 'const'.

=== modified file 'src/callint.c'
--- a/src/callint.c     2013-02-27 07:42:43 +0000
+++ b/src/callint.c     2013-04-27 21:12:17 +0000
@@ -34,6 +34,7 @@
 static Lisp_Object Qenable_recursive_minibuffers;
 
 static Lisp_Object Qhandle_shift_selection;
+static Lisp_Object Qread_number;
 
 Lisp_Object Qmouse_leave_buffer_hook;
 
@@ -683,29 +684,7 @@
          if (!NILP (prefix_arg))
            goto have_prefix_arg;
        case 'n':               /* Read number from minibuffer.  */
-         {
-           bool first = 1;
-           do
-             {
-               Lisp_Object str;
-               if (! first)
-                 {
-                   message1 ("Please enter a number.");
-                   sit_for (make_number (1), 0, 0);
-                 }
-               first = 0;
-
-               str = Fread_from_minibuffer (callint_message,
-                                            Qnil, Qnil, Qnil, Qnil, Qnil,
-                                            Qnil);
-               if (! STRINGP (str) || SCHARS (str) == 0)
-                 args[i] = Qnil;
-               else
-                 args[i] = Fread (str);
-             }
-           while (! NUMBERP (args[i]));
-         }
-         visargs[i] = args[i];
+         args[i] = call1 (Qread_number, callint_message);
          break;
 
        case 'P':               /* Prefix arg in raw form.  Does no I/O.  */
@@ -903,6 +882,7 @@
   DEFSYM (Qminus, "-");
   DEFSYM (Qplus, "+");
   DEFSYM (Qhandle_shift_selection, "handle-shift-selection");
+  DEFSYM (Qread_number, "read-number");
   DEFSYM (Qcall_interactively, "call-interactively");
   DEFSYM (Qcommand_debug_status, "command-debug-status");
   DEFSYM (Qenable_recursive_minibuffers, "enable-recursive-minibuffers");


reply via email to

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