emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 65dd006 2/2: Fix problem where an error would change standard-out


From: Lars Ingebrigtsen
Subject: master 65dd006 2/2: Fix problem where an error would change standard-output
Date: Fri, 13 Aug 2021 07:22:41 -0400 (EDT)

branch: master
commit 65dd00667ff060cf79fea4b49bfa4d8f7a16ee1f
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Fix problem where an error would change standard-output
    
    * src/keyboard.c (cmd_error): Don't set
    standard-output/standard-input (bug#30529).  Instead bind them
    temporarily while handling the error.
---
 src/keyboard.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/keyboard.c b/src/keyboard.c
index 820229c..2e4c4e6 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -924,6 +924,7 @@ static Lisp_Object
 cmd_error (Lisp_Object data)
 {
   Lisp_Object old_level, old_length;
+  ptrdiff_t count = SPECPDL_INDEX ();
   Lisp_Object conditions;
   char macroerror[sizeof "After..kbd macro iterations: "
                  + INT_STRLEN_BOUND (EMACS_INT)];
@@ -951,8 +952,8 @@ cmd_error (Lisp_Object data)
       executing_kbd_macro = Qnil;
     }
 
-  Vstandard_output = Qt;
-  Vstandard_input = Qt;
+  specbind (Qstandard_output, Qt);
+  specbind (Qstandard_input, Qt);
   kset_prefix_arg (current_kboard, Qnil);
   kset_last_prefix_arg (current_kboard, Qnil);
   cancel_echoing ();
@@ -969,6 +970,7 @@ cmd_error (Lisp_Object data)
   Vquit_flag = Qnil;
   Vinhibit_quit = Qnil;
 
+  unbind_to (count, Qnil);
   return make_fixnum (0);
 }
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]