GNU bug report logs -
#30529
26.0.91; minibuffer errors change standard-output
Previous Next
Reported by: f.j.wright <at> live.co.uk
Date: Mon, 19 Feb 2018 16:05:01 UTC
Severity: normal
Found in version 26.0.91
Fixed in version 28.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
"Basil L. Contovounesios" <contovob <at> tcd.ie> writes:
>> This problem is still present in Emacs 28. I tried following the code
>> logic for a couple of minutes to see just what it is that's (re)setting
>> `standard-output' here, but was unable to locate the location.
>>
>> Anybody know?
>
> Just from a quick grep, could it be recursive_edit_1?
Found the culprit! cmd_error sets standard_output to t!
The following patch fixes the reported issue (and doesn't lead to any
regressions in the test suite), but this code has been like this
forever, so I'm a bit leery about applying it.
And perhaps the
old_level = Vprint_level;
old_length = Vprint_length;
stuff should also be changed to specbinding? Or do we want to avoid
specbind here totally for some reason? The commit for those lines just
says:
(cmd_error): Bind Vprint_level and Vprint_length.
I mean, we had specbind before 1995, I think?
So... any comments/insights here?
diff --git a/src/keyboard.c b/src/keyboard.c
index 820229cf8f..f44a2b9164 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -923,6 +923,7 @@ restore_kboard_configuration (int was_locked)
static Lisp_Object
cmd_error (Lisp_Object data)
{
+ ptrdiff_t count = SPECPDL_INDEX ();
Lisp_Object old_level, old_length;
Lisp_Object conditions;
char macroerror[sizeof "After..kbd macro iterations: "
@@ -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);
}
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
This bug report was last modified 3 years and 344 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.