all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Arthur Miller <arthur.miller@live.com>
Cc: 52235@debbugs.gnu.org
Subject: bug#52235: 29.0.50; Suggestion: refactor time.el into a more general 'clock' framework
Date: Thu, 02 Dec 2021 11:55:25 +0200	[thread overview]
Message-ID: <83mtljpbzm.fsf@gnu.org> (raw)
In-Reply-To: <AM9PR09MB4977684A7C263BC648CA150096699@AM9PR09MB4977.eurprd09.prod.outlook.com> (message from Arthur Miller on Thu, 02 Dec 2021 10:19:37 +0100)

> From: Arthur Miller <arthur.miller@live.com>
> Cc: 52235@debbugs.gnu.org
> Date: Thu, 02 Dec 2021 10:19:37 +0100
> 
> Eli Zaretskii <eliz@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.





  reply	other threads:[~2021-12-02  9:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <DB9PR09MB49867F87628009D4F53B756E96689@DB9PR09MB4986.eurprd09.prod.outlook.com>
2021-12-02  7:26 ` bug#52235: 29.0.50; Suggestion: refactor time.el into a more general 'clock' framework Eli Zaretskii
2021-12-02  9:19   ` Arthur Miller
2021-12-02  9:55     ` Eli Zaretskii [this message]
2021-12-02 23:48       ` Arthur Miller
2021-12-02  8:29 ` Lars Ingebrigtsen
2021-12-02  9:28   ` Arthur Miller
2021-12-02  9:55     ` Lars Ingebrigtsen
2021-12-02 23:36       ` Arthur Miller
2021-12-03 16:23         ` Lars Ingebrigtsen
2021-12-03  0:52       ` Stefan Kangas
2021-12-03  7:26         ` Eli Zaretskii

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83mtljpbzm.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=52235@debbugs.gnu.org \
    --cc=arthur.miller@live.com \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.