unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Alexander Shukaev <haroogan@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 20592@debbugs.gnu.org
Subject: bug#20592: the `display' property messes the `face' properties after `concat'
Date: Thu, 25 Jun 2015 21:16:41 +0200	[thread overview]
Message-ID: <CAKu-7WxsVG7dv1cKY6x9vJ3_x6w38=vedh9Sq3tz1nse=f-X7A@mail.gmail.com> (raw)
In-Reply-To: <83fv6seg8k.fsf@gnu.org>

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

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

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

  reply	other threads:[~2015-06-25 19:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2015-06-25 19:42         ` Eli Zaretskii
2021-12-02 10:00           ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAKu-7WxsVG7dv1cKY6x9vJ3_x6w38=vedh9Sq3tz1nse=f-X7A@mail.gmail.com' \
    --to=haroogan@gmail.com \
    --cc=20592@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).