From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#67837: 29.1.90; inhibit-interaction breaks keyboard macros Date: Sat, 16 Dec 2023 09:02:35 +0200 Message-ID: <83fs02ocj8.fsf@gnu.org> References: <83le9vnvnn.fsf@gnu.org> <83jzpfnsle.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9870"; mail-complaints-to="usenet@ciao.gmane.io" Cc: larsi@gnus.org, 67837@debbugs.gnu.org, monnier@iro.umontreal.ca To: Spencer Baugh Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 16 08:04:21 2023 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 1rEOij-0002L6-Dd for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 16 Dec 2023 08:04:21 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rEOiQ-0004Vi-Ti; Sat, 16 Dec 2023 02:04:02 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rEOiQ-0004VV-1j for bug-gnu-emacs@gnu.org; Sat, 16 Dec 2023 02:04:02 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rEOiP-0002yT-Q6 for bug-gnu-emacs@gnu.org; Sat, 16 Dec 2023 02:04:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rEOiP-0005Rh-RB for bug-gnu-emacs@gnu.org; Sat, 16 Dec 2023 02:04:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 16 Dec 2023 07:04:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67837 X-GNU-PR-Package: emacs Original-Received: via spool by 67837-submit@debbugs.gnu.org id=B67837.170271018420866 (code B ref 67837); Sat, 16 Dec 2023 07:04:01 +0000 Original-Received: (at 67837) by debbugs.gnu.org; 16 Dec 2023 07:03:04 +0000 Original-Received: from localhost ([127.0.0.1]:53851 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rEOhU-0005QT-0M for submit@debbugs.gnu.org; Sat, 16 Dec 2023 02:03:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60932) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rEOhR-0005Pz-Hz for 67837@debbugs.gnu.org; Sat, 16 Dec 2023 02:03:03 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rEOhL-0002u2-8B; Sat, 16 Dec 2023 02:02:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=Zra1BIN/W54sJDsiwGKboJ+p7Lq9uySA9p0w5yoI7LM=; b=jLqxgXAO88Fv ADhn2fO1FFd73IhDLRnCDZTyOG5mvaXydb67caiPUQRFTPFht3V4VmuwsiEN6AZASBKHnLYsgT2+r 3Tt7f9oQuLY9DApvI7RrXE6/O58+e78fzlEy/UvMPdf31vOZsunEHNtsmsDY9XCf5C+Ta1yHbccHX z0Bi0rurCf0GTG2yYMGypy269X88nsN3TJ2DaUjk10MHL2ZWoyf+kT/e25sXWIv+EzvryX5CDyBtl o8071DUTUUtmDrYyQMz++pWSo3x/0iqrKfD+aXcStdvV0wQnCKDpoYQx4EBLVb5u4PRVoAKFf4H/f hlw8+YJwJVVl+EBDhzgINw==; In-Reply-To: (message from Spencer Baugh on Fri, 15 Dec 2023 15:09:59 -0500) 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:276296 Archived-At: > From: Spencer Baugh > Cc: larsi@gnus.org, 67837@debbugs.gnu.org, monnier@iro.umontreal.ca > Date: Fri, 15 Dec 2023 15:09:59 -0500 > > > I'm saying that your proposal of fixing this will cause these > > functions to do some parts of their jobs before they realize that they > > can barf, and this will now happen even when they run not from a > > keyboard macro, and even if the keyboard macro doesn't actually > > provide any input. This is definitely not TRT. It affects use cases > > completely unrelated to the ones you wanted to fix, and affects them > > in adverse ways. > > I think the effects on other use cases are only positive. If, for > example, read-char would fail due to reasons other than > inhibit-interaction, it will now fail for those reasons. Which is good, > because it reduces the need for all code everywhere to think about the > possibility that inhibit-interaction is non-nil. Most calls don't signal errors, so the part that is important is when they don't. > > Please find a way of fixing the case of a keyboard macro that provides > > input without adversely affecting the other cases where these > > functions are called with inhibit-interaction=t. > > How about if those original barf_if_interaction_inhibited calls only > signal if executing-kbd-macro is nil? We could perhaps do that, but see my other message: I think it is fundamentally wrong to allow keyboard macros be exempt from this feature. > >> - Users write functions using keyboard macros and put them in hooks, > >> which happen to get invoked by packages which use inhibit-interaction. > >> Those functions don't actually require interaction, but because they > >> break, ultimately no code can use inhibit-interaction. > >> > >> - I run tests in a batch Emacs, frequently using keyboard macros to > >> provide input. Sometimes a bug causes code to run which calls > >> read-char outside of a keyboard macro. I would like such read-char > >> calls to error (instead of hanging, which is what they do by default > >> in batch mode). If I bind inhibit-interaction=t, then read-char will > >> exit with an error, but my keyboard macros will also immediately > >> error. > > > > In both cases, using a function would solve the problem. So I'm not > > convinced we need to support those marginal cases, unless you can come > > up with a solution that will be both simple and will not affect > > unrelated use cases. > > - Are you suggesting that novice users should have to rewrite all their > keyboard macros in Lisp? That sounds impractical. I don't see anything impractical here. > - How can I provide keyboard input to the interactive spec of a command > I am testing, other than by using keyboard macros? I'd be pleased to > have an alternative solution. Why do you need to do that when inhibit-interaction is non-nil in the first place? Code that needs interaction shouldn't be run or tested in those conditions.