GNU bug report logs -
#54371
29.0.50; read-char does not reset idle timer in some cases
Previous Next
Reported by: Ignacio Casso <ignaciocasso <at> hotmail.com>
Date: Sun, 13 Mar 2022 08:47:01 UTC
Severity: normal
Tags: moreinfo
Found in version 29.0.50
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> IOW, code which does that is splitting hair.
I agree. And I have already proposed a patch for the org-clock bug that
changes the logic of org-resolve-clocks-if-idle to avoid this issue to
begin with instead of trying to work around it.
>> However, I still think that if not a bug, this is at least inconsistent
>> and probably deserving a footnote in the relevant section of the Emacs
>> Lisp manual
>> (https://www.gnu.org/software/emacs/manual/html_node/elisp/Idle-Timers.html).
>
> I think accessing current-idle-time from an idle time is inherently
> problematic: when the idle timer runs and receives input, whether or
> not Emacs is idle is ambiguous in principle.
However, I still think this should be documented somewhere. The only
thing I found was a comment in keyboard.c, and that was only after you
pointed me to the right email thread.
And this is not only about the use of read-event inside timer
functions. Currently the Idle Timers section of the manual would make
any reader think that these two forms would produce the output "A\nB" if
the user takes a few seconds to input a character, but only the first
one would.
(progn
(run-with-idle-timer 1 nil (lambda () (message "A")))
(read-char "Please wait for 2 seconds" nil nil)
(message "B"))
(progn
(run-with-idle-timer 1 nil (lambda () (message "A")))
(read-char "Please wait for 2 seconds" nil 20)
(message "B"))
So as I see it, the manual is incorrect right now, or at best incomplete
or ambiguous, and a footnote could not hurt. What do you think?
This bug report was last modified 3 years and 42 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.