|
From: | Jorge A. Alfaro-Murillo |
Subject: | Re: Minibuffer tray to display current time and date |
Date: | Fri, 24 Apr 2015 16:18:38 -0400 |
User-agent: | Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
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.
[Prev in Thread] | Current Thread | [Next in Thread] |