GNU bug report logs - #67837
29.1.90; inhibit-interaction breaks keyboard macros

Previous Next

Package: emacs;

Reported by: Spencer Baugh <sbaugh <at> janestreet.com>

Date: Fri, 15 Dec 2023 16:49:02 UTC

Severity: normal

Merged with 65291

Found in versions 29.1.90, 30.0.50

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: sbaugh <at> catern.com
Cc: sbaugh <at> janestreet.com, larsi <at> gnus.org, 67837 <at> debbugs.gnu.org, monnier <at> iro.umontreal.ca
Subject: bug#67837: 29.1.90; inhibit-interaction breaks keyboard macros
Date: Sat, 16 Dec 2023 15:57:42 +0200
> From: sbaugh <at> catern.com
> Date: Sat, 16 Dec 2023 13:22:23 +0000 (UTC)
> Cc: Spencer Baugh <sbaugh <at> janestreet.com>, larsi <at> gnus.org,
> 	67837 <at> debbugs.gnu.org, monnier <at> iro.umontreal.ca
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> > 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.

The usual way of dealing with this in test frameworks is to mock
read-char (or whatever function that causes trouble when running
tests).  As long as read-char is not the API you are testing, you
don't really need read-char as it works in Emacs, you need something
that will provide the same output.

> 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?

Define a replacement read-char in the test harness that accepts the
same arguments and signals an error.




This bug report was last modified 1 year and 117 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.