]> git.eshelyaron.com Git - emacs.git/commitdiff
(command_loop_1): If there's an error in the
authorRichard M. Stallman <rms@gnu.org>
Fri, 14 Jan 1994 20:09:37 +0000 (20:09 +0000)
committerRichard M. Stallman <rms@gnu.org>
Fri, 14 Jan 1994 20:09:37 +0000 (20:09 +0000)
post(pre)-command-hook, leave that hook nil.

src/keyboard.c

index 743bcdfccd27bf1936b2831da42773665f1b8ac8..d75f48e21aafbf686ec02139014d7d58f33781d7 100644 (file)
@@ -904,7 +904,17 @@ command_loop_1 ()
   /* 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 @@ command_loop_1 ()
 
       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))
        {