]> git.eshelyaron.com Git - emacs.git/commitdiff
(with-local-quit): When handling `quit' signal,
authorRichard M. Stallman <rms@gnu.org>
Thu, 25 May 2006 00:19:02 +0000 (00:19 +0000)
committerRichard M. Stallman <rms@gnu.org>
Thu, 25 May 2006 00:19:02 +0000 (00:19 +0000)
make a chance for quit-flag to cause a quit.

lisp/ChangeLog
lisp/subr.el

index bf94fcb539c9a72dd4c551b6e04a4e0271f1cf1f..4e4871d0efd2c68b47dbb952353f7de205f374b8 100644 (file)
@@ -1,5 +1,8 @@
 2006-05-24  Richard Stallman  <rms@gnu.org>
 
+       * subr.el (with-local-quit): When handling `quit' signal,
+       make a chance for quit-flag to cause a quit.
+
        * emacs-lisp/advice.el (ad-enable-advice, ad-activate)
        (ad-disable-advice): Add autoloads.
 
index 67731f4d4c643968195177448103ae388d9bbfca..711f18221895143b666ee125e8cbacff7b363186 100644 (file)
@@ -1617,7 +1617,7 @@ Optional DEFAULT is a default password to use instead of empty input.
 This function echoes `.' for each character that the user types.
 The user ends with RET, LFD, or ESC.  DEL or C-h rubs out.  C-u kills line.
 C-g quits; if `inhibit-quit' was non-nil around this function,
-then it returns nil if the user types C-g.
+then it returns nil if the user types C-g, but quit-flag remains set.
 
 Once the caller uses the password, it can erase the password
 by doing (clear-string STRING)."
@@ -2321,7 +2321,13 @@ is allowed once again."
   `(condition-case nil
        (let ((inhibit-quit nil))
         ,@body)
-     (quit (setq quit-flag t) nil)))
+     (quit (setq quit-flag t)
+          ;; This call is to give a chance to handle quit-flag
+          ;; in case inhibit-quit is nil.
+          ;; Without this, it will not be handled until the next function
+          ;; call, and that might allow it to exit thru a condition-case
+          ;; that intends to handle the quit signal next time.
+          (eval '(ignore nil)))))
 
 (defmacro while-no-input (&rest body)
   "Execute BODY only as long as there's no pending input.