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: Alexander Shukaev
Subject: Re: Minibuffer tray to display current time and date
Date: Tue, 28 Apr 2015 19:27:05 +0200

​Sweet, Stefan.  Thanks a lot.  I've just installed it, and even though
it's that simple, yet does the job.

One feature I thought about is justifying it to the right.  This function
should do the job:

(defun minibuffer-line-right-justified
    (string)
  (format (format "%d %%s" (- (window-width (minibuffer-window)) (length
string))) string))


and then:

(setq-default minibuffer-line-format
              '((:eval (minibuffer-line-right-justified
                        (format-time-string "%R %F")))))


The problem occurs when Emacs frame is resized, for example.  So probably
`minibuffer-line--update' would have to be installed as a hook or
post--advice to resizing routines.  Unfortunately, I'm not sure how to do
that correctly.  What do you think?

Also, it would be nice to have an ability to highlight only certain parts
of this minibuffer line.  For instance, I've tried:

(setq-default minibuffer-line-format
             '((:eval (propertize (format-time-string "%R")
                                   'font-lock-face
                                   'minibuffer-line-time))
               " "
                (:eval (format-time-string "%F"))))


Where `minibuffer-line-time' was my custom face, but it did not work.  I
assume that this is due to the `(format-mode-line minibuffer-line-format
'minibuffer-line)' call.

Lastly,

(defgroup minibuffer-line ()
  "Use the idle minibuffer window to display status information."
  :group 'mode-line)


what about a new separate group `minibuffer-line'?

Kind regards,
Alexander


On Mon, Apr 27, 2015 at 2:36 AM, Stefan Monnier <monnier@iro.umontreal.ca>
wrote:

> BTW, I've just pushed a new `minibuffer-line' package to elpa.git which
> provides a new `minibuffer-line-mode' controlled by
> `minibuffer-line-format'.  It defaults to displaying the hostname, date,
> and time.
>
>
>         Stefan
>
>
>


reply via email to

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