GNU bug report logs - #78737
sit-for behavior changes when byte-compiled

Previous Next

Package: emacs;

Reported by: Daniel Colascione <dancol <at> dancol.org>

Date: Mon, 9 Jun 2025 20:50:02 UTC

Severity: normal

Full log


View this message in rfc822 format

From: Daniel Colascione <dancol <at> dancol.org>
To: 78737 <at> debbugs.gnu.org
Subject: bug#78737: sit-for behavior changes when byte-compiled
Date: Mon, 09 Jun 2025 13:48:59 -0700
Consider (while-no-input (sit-for 100)).

Run it and press any key, say, f to terminate the wait. You'll see "f"
inserted wherever point was.

Now eval-defun on sit-for from subr.el and try (while-no-input (sit-for
100)) again. The "f" disappears.

Why? Because Fread_event returns with Vquit_flag set; the byte-compiled
sit-for is able to push the event onto Vunread_command_events before
Lisp does something quit-able, but the interpreted sit-for doesn't get
so far and loses Fread_event's return value.

Fread_event should probably look for Vquit_flag and !Vinhibit_quit and
in this case stick the event on Vunread_command_events itself and
return nil.

WDYT?




This bug report was last modified 4 days ago.

Previous Next


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