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#67836: 29.1.90; map-y-or-n-p doesn't terminate when run in a kmacro in batch mode Date: Sat, 16 Dec 2023 10:11:28 +0200 Message-ID: <835y0yo9cf.fsf@gnu.org> References: <83msubo2vw.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8035"; mail-complaints-to="usenet@ciao.gmane.io" Cc: sbaugh@janestreet.com, 67836@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 16 09:13:20 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 1rEPnT-0001to-JU for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 16 Dec 2023 09:13:19 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rEPnF-0002XF-B2; Sat, 16 Dec 2023 03:13:05 -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 1rEPnC-0002X7-KI for bug-gnu-emacs@gnu.org; Sat, 16 Dec 2023 03:13: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 1rEPnC-00058L-Bv for bug-gnu-emacs@gnu.org; Sat, 16 Dec 2023 03:13:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rEPnC-0000c7-FE for bug-gnu-emacs@gnu.org; Sat, 16 Dec 2023 03:13:02 -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 08:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67836 X-GNU-PR-Package: emacs Original-Received: via spool by 67836-submit@debbugs.gnu.org id=B67836.17027143242291 (code B ref 67836); Sat, 16 Dec 2023 08:13:02 +0000 Original-Received: (at 67836) by debbugs.gnu.org; 16 Dec 2023 08:12:04 +0000 Original-Received: from localhost ([127.0.0.1]:53924 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rEPmF-0000as-56 for submit@debbugs.gnu.org; Sat, 16 Dec 2023 03:12:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58900) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rEPm8-0000aH-86 for 67836@debbugs.gnu.org; Sat, 16 Dec 2023 03:12:02 -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 1rEPm1-0002iB-6z; Sat, 16 Dec 2023 03:11:49 -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=HZv1VnQ19P4PsmXWcGljqWvxuZDwB+AuUgPpc7A5JSE=; b=bbDyDDdoQ4j4 FGe3mK5P0AEbOgegkk9AxnT40L+y+K0QDtj/wu04HxrCh7l4ML3lUl0ZtLA4ufU4i4toFlJwAOfu+ QCAUzj1DQ4xUB1FMonUxPCg+9GAB2nooyXPhHCz279xxoUpjkyje80yDJBmYFDOkdHzfeiBw49HYw r9rSBsBJ57tVlGf7Qg/3rQuH0KttTvQ7zftlxt/NNdq2+ft9JGV0l2E2joVSSnGtYBOhqWUa/f4Bd dsNJQtIb0P4d4bGTPTc0hbvJK18jGLhkiyIY7Jt0luuNZgiPx5yP6+p63fH4OBfloXUtlYrFaHx1b UU4mGi8FxRPqDvqasFduqw==; In-Reply-To: (message from Stefan Monnier on Fri, 15 Dec 2023 17:55:43 -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:276300 Archived-At: > From: Stefan Monnier > Cc: Spencer Baugh , 67836@debbugs.gnu.org > 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. I actually question the wisdom of doing so. It isn't what keyboard macros are for. > >> 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 > 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 Maybe so (we could ask Jim if we wanted, he is still around), but in any case I'm not interested in changing how bitch_at_user works 30-something years after it was coded, and has worked well since then. I'm okay with fixing this particular problem, but not via changes to bitch_at_user or any similar low-level functionality used everywhere. Such changes are IMO acceptable only if they fix a clear bug, which is not the case here. Spencer, I already noted once that many of your patches have this problem: you take some problem which happens to you in a very specialized use case, and propose to fix that by changes that affect all of Emacs. This isn't going to fly in Emacs in general, since Emacs is a very old and stable program, where almost all of the old low-level code was tested by decades of usage, and any significant changes there run high risk of breaking something. And yet you keep coming up with changes which do precisely that. Please try to see things from the POV of the Emacs maintainers, and look for ways of fixing those problems either by much more localized changes, or maybe even just in your own code. TIA.