From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: sbaugh@catern.com Newsgroups: gmane.emacs.bugs Subject: bug#67837: 29.1.90; inhibit-interaction breaks keyboard macros Date: Sat, 16 Dec 2023 13:22:23 +0000 (UTC) Message-ID: <87le9uthaw.fsf@catern.com> References: <83le9vnvnn.fsf@gnu.org> <83jzpfnsle.fsf@gnu.org> <83fs02ocj8.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13066"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Spencer Baugh , larsi@gnus.org, 67837@debbugs.gnu.org, monnier@iro.umontreal.ca To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 16 14:23:22 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 1rEUdV-0003Cv-Bx for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 16 Dec 2023 14:23:22 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rEUdE-0003R0-E7; Sat, 16 Dec 2023 08:23:04 -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 1rEUdC-0003P9-DB for bug-gnu-emacs@gnu.org; Sat, 16 Dec 2023 08:23: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 1rEUdB-0004wo-KJ for bug-gnu-emacs@gnu.org; Sat, 16 Dec 2023 08:23:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rEUdB-0004ph-Tx for bug-gnu-emacs@gnu.org; Sat, 16 Dec 2023 08:23:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: sbaugh@catern.com Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 16 Dec 2023 13:23: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.170273295418531 (code B ref 67837); Sat, 16 Dec 2023 13:23:01 +0000 Original-Received: (at 67837) by debbugs.gnu.org; 16 Dec 2023 13:22:34 +0000 Original-Received: from localhost ([127.0.0.1]:54227 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rEUcj-0004op-UD for submit@debbugs.gnu.org; Sat, 16 Dec 2023 08:22:34 -0500 Original-Received: from s.wfbtzhsw.outbound-mail.sendgrid.net ([159.183.224.105]:42786) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rEUcg-0004oR-TJ for 67837@debbugs.gnu.org; Sat, 16 Dec 2023 08:22:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=catern.com; h=from:subject:in-reply-to:references:mime-version:to:cc:content-type: content-transfer-encoding:cc:content-type:from:subject:to; s=s1; bh=vyAbtETj3adOmb8oOk4vD3arLq34+sPoMFioaQSaans=; b=1OM1Noozrs713CLx7VQq/0JNF/pJaXJlFmZzOpKJCl/GbQpWRsEV6Zc0J0zJ18IstuuO LnxCECb8XXVoaq26uAIHf8/G4wEKiDDIN6uz8nVSpHnaBYDh5t4SgLjkMf1fNCBZn/WtI1 NEROYEjyL3IIBOJ6z2XrUGtnIYkP7Wi0h2svNJ1i1m6ocMj9KU1CqDOfT8vEo85G+S4tg8 +LLp20ZGFHBZtfILkOxarpwcScW4Cr9zRcm0drIexAM8kNGM5WBC0822Z8thlwihMyDYXD OTXZH36ZsnJ/iE27QCU+zu734S3XIOTMgAvcjmKCq7MgrCUdPwcUga9nJBSdMXGg== Original-Received: by filterdrecv-655bd866f5-l7lp4 with SMTP id filterdrecv-655bd866f5-l7lp4-1-657DA48F-28 2023-12-16 13:22:23.719159449 +0000 UTC m=+418812.536721024 Original-Received: from earth.catern.com (unknown) by geopod-ismtpd-35 (SG) with ESMTP id 6lduQ73kSFeMhGnBSE29vg Sat, 16 Dec 2023 13:22:23.656 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=74.101.51.129; helo=localhost; envelope-from=sbaugh@catern.com; receiver=gnu.org Original-Received: from localhost (unknown [74.101.51.129]) by earth.catern.com (Postfix) with ESMTPSA id 2EE9763D12; Sat, 16 Dec 2023 08:20:40 -0500 (EST) In-Reply-To: <83fs02ocj8.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 16 Dec 2023 09:02:35 +0200") X-SG-EID: ZgbRq7gjGrt0q/Pjvxk7wM0yQFRdOkTJAtEbkjCkHbKmRvMqrX2f6A+TogkmeObt6VIyNsJRh6zPAwAx5JLsgERE3VJTxoyTVc7LU/fzDqzVtUOUeMuwWc2vqFHx1O1Cy4oS+sncnQqdGwJqrGpBw2AxKECvN5dfLvgp7ImdmlFzVIf/0p0P477eJO5BvKnXH7qnlfzK4hnMjdIA4wyiZQ== X-Entity-ID: d/0VcHixlS0t7iB1YKCv4Q== 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:276337 Archived-At: Eli Zaretskii writes: >> >> - 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. Many users of Emacs are not programmers. They are able to use keyboard macros as a simple, non-programming way to make reusable functions and commands. Are you saying they should learn to program so that they can rewrite their keyboard macros by hand into Lisp? >> - 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. As I said before: because otherwise read-char outside a keyboard macro will hang, and I want my test to fail instead of hang in that case. Let me phrase the use case differently: I have some tests which I'd like to run in batch Emacs. By default, if any of the code under test runs read-char, Emacs will simply hang forever (that's what read-char does in batch mode). I would prefer instead that my tests to fail immediately if any code runs read-char. How would you suggest I do that? AFAIK the only way to achieve this currently is inhibit-interaction, although I'd be happy to add an alternative way to do that. So, to achieve this I'll use inhibit-interaction=t over my entire test suite. But then tests which make any use of a keyboard macro, for testing interactive specs for example, will fail!