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: Fri, 1 May 2015 06:54:33 +0200

The only stanza that works properly so far is this simple one:

  (setq-default minibuffer-line-format
                '((:eval (propertize (format-time-string "%Y.%m.%d")
                                     'face
                                     'minibuffer-line-date))
                  " "
                  (:eval (propertize (format-time-string "%A")
                                     'face
                                     'minibuffer-line-weekday))
                  " "
                  (:eval (propertize (format-time-string "%R")
                                     'face
                                     'minibuffer-line-time))))

So how do I actually right justify that now?

On Fri, May 1, 2015 at 6:49 AM, Alexander Shukaev <haroogan@gmail.com>
wrote:

> I came up with the following code to right-justify:
>
> ​  (setq-default minibuffer-line-format
>                 `((:eval
>                    (let ((string (concat
>                                   (propertize (format-time-string
> "%Y.%m.%d")
>                                               'face
>                                               'minibuffer-line-date)
>                                   " "
>                                   (propertize (format-time-string "%A")
>                                               'face
>                                               'minibuffer-line-weekday)
>                                   " "
>                                   (propertize (format-time-string "%R")
>                                               'face
>                                               'minibuffer-line-time))))
>                      (concat (propertize " "
>                                          'display
>                                          `((space :align-to
>                                                   (- right
>                                                      (length ,string)))))
>                              string)))))
>
> But it does not do what it should do.  Faces are not propagated and
> alignment too.  What's wrong with this code?
>


reply via email to

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