GNU bug report logs -
#52235
29.0.50; Suggestion: refactor time.el into a more general 'clock' framework
Previous Next
Reported by: Arthur Miller <arthur.miller <at> live.com>
Date: Thu, 2 Dec 2021 01:35:02 UTC
Severity: normal
Found in version 29.0.50
Fixed in version 29.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
Message #23 received at 52235 <at> debbugs.gnu.org (full text, mbox):
> From: Arthur Miller <arthur.miller <at> live.com>
> Cc: 52235 <at> debbugs.gnu.org
> Date: Thu, 02 Dec 2021 10:19:37 +0100
>
> Eli Zaretskii <eliz <at> gnu.org> writes:
>
> > Isn't that what timers are for? Why can't you use run-with-timer for
> > what you want to do?
>
> Becaue it does not syncrhonize with clock that Emacs displays, if it
> displays.
Because it doesn't synchronize with clock... what happens?
And what do you mean by "doesn't synchronize with clock that Emacs
displays"? The time comes from the same source, so how can it be not
synchronized? in what sense?
> As mentioned, not pretty, if different application will like to be notifed
> at "11:30" clock time, and then one happends like half minut before the other.
Emacs cannot guarantee that the notification will happen exactly at
the requested time anyway. This limitation is in effect both for
display-time-mode and for timers, and for exactly the same reasons.
> Also there is no reason to create one timer per each application if all
> application is want to be notified when certain clock time occur.
So create a single timer that applications could register to.
> Further, if user is displaying time
> on the modeline, and those variables are all calculated, why should other
> application re-define and re-calculate them.
Because the way users customize time display on the mode line doesn't
necessarily fits the needs of an arbitrary other application which
wants to be notified at some time. For example, users can control the
frequency and the resolution of the time display, and their
preferences for that can be correct for some other application only by
sheer luck.
My point is that I don't see why this feature has to touch
display-time-mode. That is not clean, IMO. It should be a separate
feature that uses timers. The feature could create a timer the first
time it is requested, and then any additional clients could reuse the
same timer. Of course, if you want to use a single timer, you'd still
need to solve the potentially different needs of each application: for
example, one of them may wish to be notified each second, the other
each hour.
This bug report was last modified 3 years and 263 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.