From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: jorge.alfaro-murillo@yale.edu (Jorge A. Alfaro-Murillo) Newsgroups: gmane.emacs.help Subject: Re: Minibuffer tray to display current time and date Date: Fri, 24 Apr 2015 10:57:42 -0400 Message-ID: <87ioclo9p5.fsf@yale.edu> References: <87h9s7hd7a.fsf@debian.uxu> <87383qvoi4.fsf@debian.uxu> <874mo6bgzx.fsf@debian.uxu> <20150424141319.GA19093@tuxteam.de> <831tj9zizy.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; format=flowed X-Trace: ger.gmane.org 1429888231 12667 80.91.229.3 (24 Apr 2015 15:10:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 24 Apr 2015 15:10:31 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Apr 24 17:10:22 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YlfFF-0004dx-To for geh-help-gnu-emacs@m.gmane.org; Fri, 24 Apr 2015 17:10:22 +0200 Original-Received: from localhost ([::1]:45278 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YlfFA-0000jX-AM for geh-help-gnu-emacs@m.gmane.org; Fri, 24 Apr 2015 11:10:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33731) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YlfEd-0000MD-N2 for help-gnu-emacs@gnu.org; Fri, 24 Apr 2015 11:09:47 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YlfEZ-00011x-Du for help-gnu-emacs@gnu.org; Fri, 24 Apr 2015 11:09:43 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:41229) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ylf3A-0004i9-HC for help-gnu-emacs@gnu.org; Fri, 24 Apr 2015 10:57:52 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Ylf36-0006yF-Au for help-gnu-emacs@gnu.org; Fri, 24 Apr 2015 16:57:48 +0200 Original-Received: from nat-130-132-173-151.central.yale.edu ([130.132.173.151]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 24 Apr 2015 16:57:48 +0200 Original-Received: from jorge.alfaro-murillo by nat-130-132-173-151.central.yale.edu with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 24 Apr 2015 16:57:48 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 31 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: nat-130-132-173-151.central.yale.edu User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) Cancel-Lock: sha1:L0/2C7rmPhgzQuTA3YpABpy322s= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:103981 Archived-At: Eli Zaretskii writes: >> Date: Fri, 24 Apr 2015 16:13:19 +0200 From: >> Cc: help-gnu-emacs@gnu.org >> > > Optimal would be to run now, and then (run-at-time >> > > NEXT-TIME-MINUTE-CHANGES nil (lambda () (run-at-time t 60 >> > > ... >> > Are you thinking like this: "The granularity of the clock is >> > 1 minute. So it should be updated once every minute, i.e. >> > every 60 seconds." That sounds a bit risky to me, so I'd >> > recommend setting it so that it will be set somewhere around >> > three times per minute - and not set evenly so, but for >> > example every 22 seconds: >> > 0, 22, 44, 6 (66), 28, 50, ... >> This sounds a bit roundabout: why not run-at-time? Do you fear >> that it gets out of sync? > > Instead of arguing, just look at how display-time-mode does it, > this problem is already solved there. It does it exactly as I had proposed at the beginning (run-at-time t 60 ...) But the clock might be off by at most 59 seconds, which is why it would be better to run once and then wait for the next time the minute changes to set the (run-at-time t 60 ...). Running every 22 seconds is very inefficient, two out three calls will not change anything. -- Jorge.