changeset 5588:b9cd3a5eda55

(command_loop_1): If there's an error in the post(pre)-command-hook, leave that hook nil.
author Richard M. Stallman <rms@gnu.org>
date Fri, 14 Jan 1994 20:09:37 +0000
parents fd409e42991a
children 608926d1bd70
files src/keyboard.c
diffstat 1 files changed, 22 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/keyboard.c	Fri Jan 14 18:47:00 1994 +0000
+++ b/src/keyboard.c	Fri Jan 14 20:09:37 1994 +0000
@@ -904,7 +904,17 @@
   /* Make sure this hook runs after commands that get errors and
      throw to top level.  */
   if (!NILP (Vpost_command_hook))
-    call1 (Vrun_hooks, Qpost_command_hook);
+    {
+      Lisp_Object tem;
+      /* If we get an error during the post-command-hook,
+	 cause post-command-hook to be nil.  */
+      tem = Vpost_command_hook;
+      Vpost_command_hook = Qnil;
+
+      call1 (Vrun_hooks, Qpost_command_hook);
+      
+      Vpost_command_hook = tem;
+    }
 
   while (1)
     {
@@ -1047,7 +1057,17 @@
 
       this_command = cmd;
       if (!NILP (Vpre_command_hook))
-	call1 (Vrun_hooks, Qpre_command_hook);
+	{
+	  Lisp_Object tem;
+	  /* If we get an error during the pre-command-hook,
+	     cause pre-command-hook to be nil.  */
+	  tem = Vpre_command_hook;
+	  Vpre_command_hook = Qnil;
+
+	  call1 (Vrun_hooks, Qpre_command_hook);
+
+	  Vpre_command_hook = tem;
+	}
 
       if (NILP (this_command))
 	{