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: crypto@timruffing.de, 68272@debbugs.gnu.org
Subject: bug#68272: [PATCH] Fix -1 leaking from C to lisp in 'read-event' etc.
Date: Tue, 05 Mar 2024 21:55:49 +0200	[thread overview]
Message-ID: <86cys8lagq.fsf@gnu.org> (raw)
In-Reply-To: <jwvzfvc32cp.fsf-monnier+emacs@gnu.org> (message from Stefan Monnier on Tue, 05 Mar 2024 14:29:43 -0500)

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Cc: crypto@timruffing.de,  68272@debbugs.gnu.org
> Date: Tue, 05 Mar 2024 14:29:43 -0500
> 
> >> >> > IOW, what about callers that actually _want_ to know when the macro
> >> >> > ends prematurely?
> >> >> I couldn't find any, really.
> >> > ??? calc is one, obviously.
> >> 
> >> I don't think so: AFAICT the tests there were added simply
> >> because they had to do something with this -1 return value.
> >
> > Any evidence?  Andreas thought differently, what if he is right?
> 
> I think the mail you responded to already provided my answer to the case
> the original author did it on purpose.  I have nothing to add.
> Do you have a better alternative?

I'd prefer that we allowed Lisp programs to diagnose the situation
where the macro ends prematurely, and that at least the two places in
Calc keep showing the error messages they show now in those cases.
The other places, which use the special -1 value to simply keep
reading, or do something else silently -- those should use the new
facility which does the same in low-level code.

One way of doing that is to allow some hook to be called when we
currently return -1, and if that hook returns some special value,
avoid continuing to read -- this will allow Lisp programs that want it
to keep the current behavior by setting up the hook.





  reply	other threads:[~2024-03-05 19:55 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-05 21:19 bug#68272: [PATCH] Fix -1 leaking from C to lisp in 'read-event' etc Tim Ruffing
2024-01-06  7:42 ` Eli Zaretskii
2024-01-06 14:32   ` Tim Ruffing
2024-01-13  9:39     ` Eli Zaretskii
2024-01-13 17:40     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-02 18:04       ` Tim Ruffing
2024-02-06 21:04         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-01 12:14         ` Tim Ruffing
2024-03-04 18:42           ` Tim Ruffing
2024-03-05 13:10             ` Eli Zaretskii
2024-03-05 16:45             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-05 16:55               ` Eli Zaretskii
2024-03-05 17:57                 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-05 18:53                   ` Eli Zaretskii
2024-03-05 19:29                     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-05 19:55                       ` Eli Zaretskii [this message]
2024-03-05 20:18                         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-06 11:46                           ` Eli Zaretskii
2024-03-09 12:33                             ` Tim Ruffing
2024-03-09 18:08                               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-09 18:37                                 ` Eli Zaretskii
2024-03-10  8:24                                   ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-10 14:48                                   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-06  9:15 ` Andreas Schwab

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=86cys8lagq.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=68272@debbugs.gnu.org \
    --cc=crypto@timruffing.de \
    --cc=monnier@iro.umontreal.ca \
    /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).