From bb62bd918cb213d70e87f10538b2922690d848a1 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Fri, 14 Jan 1994 20:09:37 +0000 Subject: [PATCH] (command_loop_1): If there's an error in the post(pre)-command-hook, leave that hook nil. --- src/keyboard.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/src/keyboard.c b/src/keyboard.c index 743bcdfccd2..d75f48e21aa 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -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)) { -- 2.39.5