From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#30529: 26.0.91; minibuffer errors change standard-output Date: Thu, 12 Aug 2021 16:34:20 +0200 Message-ID: <878s16k9zn.fsf@gnus.org> References: <85po510xv9.fsf@gmail.com> <874klcql7u.fsf@gnus.org> <87360sdvwg.fsf@tcd.ie> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32234"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: f.j.wright@live.co.uk, Francis Wright , 30529@debbugs.gnu.org To: "Basil L. Contovounesios" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Aug 12 16:35:13 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mEBnb-00082G-6X for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 12 Aug 2021 16:35:11 +0200 Original-Received: from localhost ([::1]:35838 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mEBnZ-0001mz-Iq for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 12 Aug 2021 10:35:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53772) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mEBnS-0001mr-8w for bug-gnu-emacs@gnu.org; Thu, 12 Aug 2021 10:35:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56274) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mEBnS-0001xB-29 for bug-gnu-emacs@gnu.org; Thu, 12 Aug 2021 10:35:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mEBnR-0007tY-Te for bug-gnu-emacs@gnu.org; Thu, 12 Aug 2021 10:35:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 12 Aug 2021 14:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30529 X-GNU-PR-Package: emacs Original-Received: via spool by 30529-submit@debbugs.gnu.org id=B30529.162877887530306 (code B ref 30529); Thu, 12 Aug 2021 14:35:01 +0000 Original-Received: (at 30529) by debbugs.gnu.org; 12 Aug 2021 14:34:35 +0000 Original-Received: from localhost ([127.0.0.1]:39587 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mEBn0-0007sk-UD for submit@debbugs.gnu.org; Thu, 12 Aug 2021 10:34:35 -0400 Original-Received: from quimby.gnus.org ([95.216.78.240]:41460) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mEBmz-0007sT-ED for 30529@debbugs.gnu.org; Thu, 12 Aug 2021 10:34:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=7KBm4RQZKSRl0m1n2YDlfPqob+IKcpqQsm7habZa6II=; b=fsfIxySJjD/A4V4c/lNShnTdEG 4/BV+UWJekoX1ogf0me2GYLNknLUeIq9kFingpqTRgR5qB1dE+q/QEi572exGzOT5sc5/ELYYuSxr kcWKfnFPVm1KN+h7LVz3isiH3M+N7YArS+YPq1lZLK5V4cWlYFsvhVfgmhbrXCZ3defw=; Original-Received: from [84.212.220.105] (helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mEBmo-0006rM-8h; Thu, 12 Aug 2021 16:34:26 +0200 In-Reply-To: <87360sdvwg.fsf@tcd.ie> (Basil L. Contovounesios's message of "Sun, 29 Nov 2020 15:29:03 +0000") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:211683 Archived-At: "Basil L. Contovounesios" 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