GNU bug report logs - #67836
29.1.90; map-y-or-n-p doesn't terminate when run in a kmacro in batch mode

Previous Next

Package: emacs;

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

Date: Fri, 15 Dec 2023 15:40:02 UTC

Severity: normal

Found in version 29.1.90

Full log


View this message in rfc822 format

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Spencer Baugh <sbaugh <at> janestreet.com>, 67836 <at> debbugs.gnu.org
Subject: bug#67836: 29.1.90; map-y-or-n-p doesn't terminate when run in a kmacro in batch mode
Date: Fri, 15 Dec 2023 17:55:43 -0500
> Thanks, but let's please find a fix that doesn't make the tail wag the
> dog.  I don't want to make a change in bitch_at_user, which will
> affect every possible use of it in batch mode, something that we have
> been doing for eons.

I suspect keyboard macros have not been used very much in batch mode
over the last 32 years.

>> ding's docstring states that it terminates keyboard macros.  But, due
>> to what seems to be an oversight, it does not do that while executing
>> in batch mode.
> As the code clearly shows, it isn't an oversight.

AFAICT the current logic of code can be traced back to:

    commit 4588ec205730239596486e8ad4d18d541917199a
    Author: Jim Blandy <jimb <at> red-bean.com>
    Date:   Wed Jul 3 12:10:07 1991 +0000
    
        Initial revision
    
    diff --git a/src/dispnew.c b/src/dispnew.c
    --- /dev/null
    +++ b/src/dispnew.c
    @@ -0,0 +1813,9 @@
    +{
    +  if (noninteractive)
    +    putchar (07);
    +  else if (!INTERACTIVE)  /* Stop executing a keyboard macro. */
    +    error ("Keyboard macro terminated by a command ringing the bell");
    +  else
    +    ring_bell ();
    +  fflush (stdout);
    +}

I'm not sure this code can be said to show clearly that it's not
an oversight.
I read it to say that the author did not consider the intersection of

    noninteractive
and
    !INTERACTIVE


-- Stefan





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

Previous Next


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