changeset 75445:d11aab871a28

(hack-local-variables-confirm): Don't keep trying to read an event from an empty kbd macro.
author Chong Yidong <cyd@stupidchicken.com>
date Sat, 27 Jan 2007 19:27:53 +0000
parents b6c76ab97fce
children affed975ee67
files lisp/files.el
diffstat 1 files changed, 12 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/files.el	Sat Jan 27 19:27:31 2007 +0000
+++ b/lisp/files.el	Sat Jan 27 19:27:53 2007 +0000
@@ -2505,6 +2505,7 @@
 			  ", 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 @@
 	      (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)