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: Jorge A. Alfaro-Murillo
Subject: Re: Minibuffer tray to display current time and date
Date: Thu, 23 Apr 2015 11:15:23 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

Emanuel Berg writes:

Stefan Monnier <address@hidden> writes:
M-: (with-current-buffer " *Minibuf-0*" (insert "I'm Idle!")) RET

So then it should be as simple as: (with-current-buffer " *Minibuf-0*" (insert (format-time-string "%H:%M")))

You should also delete the content of the mini-buffer before inserting.
Do you then use the idle-timer or how do you update it so it won't freeze time and make everything stop around you?

This works:

#+BEGIN_SRC emacs-lisp
 (run-at-time nil 60
              (lambda ()
                 (with-current-buffer " *Minibuf-0*"
                  (erase-buffer)
                  (insert (format-time-string "%H:%M")))))
#+END_SRC

Or you could have it on the right bottom:

#+BEGIN_SRC emacs-lisp
 (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")))))
#+END_SRC

Best,
--
Jorge.




reply via email to

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