unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#20592: the `display' property messes the `face' properties after `concat'
@ 2015-05-16 23:58 Alexander Shukaev
  2015-05-17 14:39 ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Alexander Shukaev @ 2015-05-16 23:58 UTC (permalink / raw)
  To: 20592

[-- Attachment #1: Type: text/plain, Size: 2203 bytes --]

Following the "Minibuffer tray to display current time and date"
discussion, it seems that a bug with the `display' property.  Consider the
following code:

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

It works as expected.

Consider another piece of code:

  (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
                                                     right-fringe
                                                     ,(length string)))))
                             string)))))

Alignment works as expected, but faces are messed up.  In fact, the default
face is used everywhere (which comes from the `display' property), like if
subsequent propertizings of date, weekday, and time have never been there.

[-- Attachment #2: Type: text/html, Size: 4480 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-12-02 10:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-16 23:58 bug#20592: the `display' property messes the `face' properties after `concat' Alexander Shukaev
2015-05-17 14:39 ` Eli Zaretskii
2015-05-19  1:20   ` Stefan Monnier
2015-05-19 15:31     ` Eli Zaretskii
2015-06-25 19:16       ` Alexander Shukaev
2015-06-25 19:42         ` Eli Zaretskii
2021-12-02 10:00           ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).