[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Minibuffer tray to display current time and date
From: |
Jorge A. Alfaro-Murillo |
Subject: |
Re: Minibuffer tray to display current time and date |
Date: |
Thu, 23 Apr 2015 14:11:14 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
Emanuel Berg writes:
Jorge A. Alfaro-Murillo writes:
(run-at-time nil 60
(lambda () (with-current-buffer " *Minibuf-0*"
(erase-buffer) (insert (format-time-string
"%H:%M")))))
I think one can afford to be a bit more generous with updates
than once every minute, so it will be (more) in synch with the
system time.
Optimal would be to run now, and then
(run-at-time NEXT-TIME-MINUTE-CHANGES nil (lambda () (run-at-time
t 60 ...
but I don't know how to get NEXT-TIME-MINUTE-CHANGES
(run-at-time
nil 60 (lambda ()
(with-current-buffer " *Minibuf-0*"
(erase-buffer) (dotimes (spaces (- (frame-width) 5))
(insert " "))
(insert (format-time-string "%H:%M")))))
I need to subtract 6 for it to fit. (The time string itself is
five chars.)
It works with 5 for me, the last character is at the last column.
Possibly, Instead of the `dotimes' loop, examine if
`make-string' is more efficient, e.g.:
(make-string 10 ? ) ; 10 spaces
True.
--
Jorge.
- Minibuffer tray to display current time and date, Alexander Shukaev, 2015/04/22
- Re: Minibuffer tray to display current time and date, Eli Zaretskii, 2015/04/22
- Re: Minibuffer tray to display current time and date, Stefan Monnier, 2015/04/22
- Message not available
- Re: Minibuffer tray to display current time and date, Emanuel Berg, 2015/04/22
- Re: Minibuffer tray to display current time and date, Jorge A. Alfaro-Murillo, 2015/04/23
- Message not available
- Re: Minibuffer tray to display current time and date, Emanuel Berg, 2015/04/23
- Re: Minibuffer tray to display current time and date,
Jorge A. Alfaro-Murillo <=
- Message not available
- Re: Minibuffer tray to display current time and date, Emanuel Berg, 2015/04/23
- Re: Minibuffer tray to display current time and date, tomas, 2015/04/24
- Re: Minibuffer tray to display current time and date, Eli Zaretskii, 2015/04/24
- Re: Minibuffer tray to display current time and date, Jorge A. Alfaro-Murillo, 2015/04/24
- Re: Minibuffer tray to display current time and date, Eli Zaretskii, 2015/04/24
- Re: Minibuffer tray to display current time and date, Jorge A. Alfaro-Murillo, 2015/04/24
- Message not available
- Re: Minibuffer tray to display current time and date, Dan Espen, 2015/04/24
- Re: Minibuffer tray to display current time and date, Jorge A. Alfaro-Murillo, 2015/04/25
- Re: Minibuffer tray to display current time and date, Eli Zaretskii, 2015/04/26
- Re: Minibuffer tray to display current time and date, tomas, 2015/04/26