]> git.eshelyaron.com Git - emacs.git/commitdiff
(hack-local-variables-confirm): Don't keep trying to read an event
authorChong Yidong <cyd@stupidchicken.com>
Sat, 27 Jan 2007 19:27:53 +0000 (19:27 +0000)
committerChong Yidong <cyd@stupidchicken.com>
Sat, 27 Jan 2007 19:27:53 +0000 (19:27 +0000)
from an empty kbd macro.

lisp/files.el

index 1436899ef20569fd19f6be263336b0b9d4497856..f671f1ae0c4c7450225c4cabb6908ea1efa4e28f 100644 (file)
@@ -2505,6 +2505,7 @@ n  -- to ignore the local variables list.")
                          ", or C-v to scroll")))
          (goto-char (point-min))
          (let ((cursor-in-echo-area t)
+               (executing-kbd-macro executing-kbd-macro)
                (exit-chars
                 (if offer-save '(?! ?y ?n ?\s ?\C-g) '(?y ?n ?\s ?\C-g)))
                done)
@@ -2512,11 +2513,17 @@ n  -- to ignore the local variables list.")
              (message prompt)
              (setq char (read-event))
              (if (numberp char)
-                 (if (eq char ?\C-v)
-                     (condition-case nil
-                         (scroll-up)
-                       (error (goto-char (point-min))))
-                   (setq done (memq (downcase char) exit-chars))))))
+                 (cond ((eq char ?\C-v)
+                        (condition-case nil
+                            (scroll-up)
+                          (error (goto-char (point-min)))))
+                       ;; read-event returns -1 if we are in a kbd
+                       ;; macro and there are no more events in the
+                       ;; macro.  In that case, attempt to get an
+                       ;; event interactively.
+                       ((and executing-kbd-macro (= char -1))
+                        (setq executing-kbd-macro nil))
+                       (t (setq done (memq (downcase char) exit-chars)))))))
          (setq char (downcase char))
          (when (and offer-save (= char ?!) unsafe-vars)
            (dolist (elt unsafe-vars)