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

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

bug#20592: the `display' property messes the `face' properties after `co


From: Alexander Shukaev
Subject: bug#20592: the `display' property messes the `face' properties after `concat'
Date: Thu, 25 Jun 2015 21:16:41 +0200

Not sure how this complies with what Eli said:

The behavior you observe is because the ':eval' construct expects to
produce a single string with either the same common face spec on all
of its characters, or no faces at all.  You cannot use ':eval' to
produce a string that has more than one face spec on its different
characters; if you do, only the face spec of the first character of
the string will be honored.

but I've still managed to work it out in the following way:

  (setq-default minibuffer-line-format
                '((:eval
                   (let* ((date-string
                           (propertize (format-time-string "%Y.%m.%d")
                                       'face
                                       'minibuffer-line-date))
                          (weekday-string
                           (propertize (format-time-string "%A")
                                       'face
                                       'minibuffer-line-weekday))
                          (time-string
                           (propertize (format-time-string "%R")
                                       'face
                                       'minibuffer-line-time))
                          (right-string-list
                           (list date-string
                                 " "
                                 weekday-string
                                 " "
                                 time-string))
                          (right-string
                           (apply #'concat right-string-list))
                          (pad-string
                           (propertize " "
                                       'display
                                       `((space :align-to
                                                (- right
                                                   right-fringe
                                                   ,(length right-string)))))))
                     (list pad-string
                           right-string-list)))))

reply via email to

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