unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: sbaugh@janestreet.com, 67046@debbugs.gnu.org
Subject: bug#67046: 29.1.50; map-y-or-n-p infinite loops if it's at the end of a kmacro
Date: Wed, 15 Nov 2023 14:02:52 +0200	[thread overview]
Message-ID: <83h6lnrzpv.fsf@gnu.org> (raw)
In-Reply-To: <jwvmsvg6ltm.fsf-monnier+emacs@gnu.org> (message from Stefan Monnier on Tue, 14 Nov 2023 17:09:45 -0500)

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Cc: Eli Zaretskii <eliz@gnu.org>,  67046@debbugs.gnu.org
> Date: Tue, 14 Nov 2023 17:09:45 -0500
> 
> >> How can we be sure this doesn't introduce some regression?
> > I'm not certain, but the behavior as written is a completely inert
> > infinite loop, just sitting and spamming read-event over and over
> > forever and maxing out the CPU.  It seems hard for this to be correct
> > behavior.
> 
> Agreed.
> 
> >> Do you understand why this loop was added, in commit 3f72fac865?
> > I do not.
> 
> Neither do I.  The handling of keyboard macro wasn't very different from
> what we have now, so by my reading of the code it suffered from the same
> inf-loop as the one we're discussing.
> 
> I see that Gerd fixed that commit a week later by removing a `not` which
> strongly suggests the code wasn't tested very much, if at all.
> 
> > Maybe this was some kind of XEmacs confusion?  I don't know the full
> > history of keyboard macros, but perhaps in XEmacs read-event would start
> > returning keyboard input again after starting to return -1.  (In GNU
> > Emacs, AFAICT, it's always been the case that read-event returns -1
> > forever after we run out of input in the keyboard macro, but haven't yet
> > actually returned from the command loop)
> 
> Reading the code I'm wondering how come we don't get into inf-loops
> more often when executing macros that stop in the middle of a recursive
> edit, or minibuffer input, or ...

So what is the path forward?  Should we install the change on master
and cross our fingers?





  reply	other threads:[~2023-11-15 12:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-10 16:43 bug#67046: 29.1.50; map-y-or-n-p infinite loops if it's at the end of a kmacro Spencer Baugh
2023-11-10 16:47 ` Spencer Baugh
2023-11-10 18:55   ` Eli Zaretskii
2023-11-10 22:35     ` Spencer Baugh
2023-11-14 22:09       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-15 12:02         ` Eli Zaretskii [this message]
2023-11-15 12:19           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-15 17:17             ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83h6lnrzpv.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=67046@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=sbaugh@janestreet.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).