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 16:18:38 -0400 Message-ID: <871tj9p9ep.fsf@yale.edu> References: <87h9s7hd7a.fsf@debian.uxu> <87383qvoi4.fsf@debian.uxu> <874mo6bgzx.fsf@debian.uxu> <20150424141319.GA19093@tuxteam.de> <831tj9zizy.fsf@gnu.org> <87ioclo9p5.fsf@yale.edu> <83wq11xyiu.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; format=flowed X-Trace: ger.gmane.org 1429906761 32093 80.91.229.3 (24 Apr 2015 20:19:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 24 Apr 2015 20:19:21 +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 22:19:12 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 1Ylk44-0002EO-Ik for geh-help-gnu-emacs@m.gmane.org; Fri, 24 Apr 2015 22:19:08 +0200 Original-Received: from localhost ([::1]:46334 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ylk43-0000gY-Ou for geh-help-gnu-emacs@m.gmane.org; Fri, 24 Apr 2015 16:19:07 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47836) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ylk3r-0000gQ-Cf for help-gnu-emacs@gnu.org; Fri, 24 Apr 2015 16:18:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ylk3l-0007Od-FI for help-gnu-emacs@gnu.org; Fri, 24 Apr 2015 16:18:55 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:33793) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ylk3l-0007L5-85 for help-gnu-emacs@gnu.org; Fri, 24 Apr 2015 16:18:49 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Ylk3i-0001oN-QC for help-gnu-emacs@gnu.org; Fri, 24 Apr 2015 22:18:46 +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 22:18:46 +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 22:18:46 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 34 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:fZLZNZQsciWAanplZJwNN+stBFY= 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:103983 Archived-At: Eli Zaretskii writes: >> From: jorge.alfaro-murillo@yale.edu (Jorge A. Alfaro-Murillo) >> Date: Fri, 24 Apr 2015 10:57:42 -0400 Eli Zaretskii writes: >> > 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 ...) > > You are missing the call to timer-set-time, I think. Thanks... I see, it seems like every time that the display-timer runs it updates its interval. That doesn't seem very efficient, but there could be a good reason why they did it that way. For the time in the minibuffer, this seems to work: #+BEGIN_SRC emacs-lisp (with-current-buffer " *Minibuf-0*" (insert (format-time-string "%H:%M"))) (run-at-time (timer-next-integral-multiple-of-time (current-time) 60) 60 (lambda () (with-current-buffer " *Minibuf-0*" (erase-buffer) (insert (format-time-string "%H:%M"))))) #+END_SRC Best, -- Jorge.