help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Minibuffer tray to display current time and date


From: Emanuel Berg
Subject: Re: Minibuffer tray to display current time and date
Date: Fri, 24 Apr 2015 00:46:10 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

jorge.alfaro-murillo@yale.edu (Jorge A.
Alfaro-Murillo) writes:

> 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, ...

>>>   (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.

In X it works with 5. In the Linux VTs and in xterm
with '-nw' it needs 6.

-- 
underground experts united
http://user.it.uu.se/~embe8573


reply via email to

[Prev in Thread] Current Thread [Next in Thread]