From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs 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 Message-ID: <83mtljpbzm.fsf@gnu.org> References: <8335nbqxgi.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34703"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 52235@debbugs.gnu.org To: Arthur Miller Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 02 10:56:33 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1msipN-0008sU-9B for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 02 Dec 2021 10:56:33 +0100 Original-Received: from localhost ([::1]:49438 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1msipM-0008RQ-BN for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 02 Dec 2021 04:56:32 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:53240) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1msiot-0008Ls-1O for bug-gnu-emacs@gnu.org; Thu, 02 Dec 2021 04:56:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:35118) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1msios-0004B0-Pl for bug-gnu-emacs@gnu.org; Thu, 02 Dec 2021 04:56:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1msios-000672-Px for bug-gnu-emacs@gnu.org; Thu, 02 Dec 2021 04:56:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 02 Dec 2021 09:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52235 X-GNU-PR-Package: emacs Original-Received: via spool by 52235-submit@debbugs.gnu.org id=B52235.163843894623467 (code B ref 52235); Thu, 02 Dec 2021 09:56:02 +0000 Original-Received: (at 52235) by debbugs.gnu.org; 2 Dec 2021 09:55:46 +0000 Original-Received: from localhost ([127.0.0.1]:46663 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1msioc-00066R-9T for submit@debbugs.gnu.org; Thu, 02 Dec 2021 04:55:46 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:52346) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1msioa-00066E-Mo for 52235@debbugs.gnu.org; Thu, 02 Dec 2021 04:55:45 -0500 Original-Received: from [2001:470:142:3::e] (port=36862 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1msioV-00041k-9s; Thu, 02 Dec 2021 04:55:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=IMaR2EA1nghinm3kNXgLhJAuIPw4u4Dvu2mfAkeybtg=; b=rln0gXntABt4 w4/nVbmSssgvXRi/O72UQavHkc4mE1qKkCyQsD5uEKQ8Vhe6lsFvULmTe7sA+UGajzS/F9aZn6kZO C0dVqHW968mrJHTV8s0hCKnL1sifNMF9wGaWeR/n9BeNcTyU3990zZ2iaQL1bzUVDLpv3cD2sBf1T SJ8+X+g/7SDBop0Akmqe83Ax0mfg9sc9NPjPVWIUnusR3vSZqizXJmSWpu3e2s2/99QLg4Uleq+JP JaNmserw0e1ka7RKBwiungu8TWDbv4WhwxShbBahJGJY1DIKy5m4f0ouAtj9OzFmq5XFJv4a+Jn5j e6QMW9b+zouzmD8A90GJ8Q==; Original-Received: from [87.69.77.57] (port=3735 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1msioU-00035q-WF; Thu, 02 Dec 2021 04:55:39 -0500 In-Reply-To: (message from Arthur Miller on Thu, 02 Dec 2021 10:19:37 +0100) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:221277 Archived-At: > From: Arthur Miller > Cc: 52235@debbugs.gnu.org > Date: Thu, 02 Dec 2021 10:19:37 +0100 > > Eli Zaretskii 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.