GNU bug report logs - #68272
[PATCH] Fix -1 leaking from C to lisp in 'read-event' etc.

Previous Next

Package: emacs;

Reported by: Tim Ruffing <crypto <at> timruffing.de>

Date: Fri, 5 Jan 2024 21:20:01 UTC

Severity: normal

Tags: patch

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: crypto <at> timruffing.de, 68272 <at> 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
> From: Stefan Monnier <monnier <at> iro.umontreal.ca>
> Cc: crypto <at> timruffing.de,  68272 <at> 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.




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

Previous Next


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