From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#20592: the `display' property messes the `face' properties after `concat' Date: Sun, 17 May 2015 17:39:12 +0300 Message-ID: <83iobrfeun.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1431873626 1339 80.91.229.3 (17 May 2015 14:40:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 17 May 2015 14:40:26 +0000 (UTC) Cc: 20592@debbugs.gnu.org To: Alexander Shukaev Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun May 17 16:40:13 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Ytzjg-0002nX-3O for geb-bug-gnu-emacs@m.gmane.org; Sun, 17 May 2015 16:40:12 +0200 Original-Received: from localhost ([::1]:37669 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ytzjf-0002NM-9M for geb-bug-gnu-emacs@m.gmane.org; Sun, 17 May 2015 10:40:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50334) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ytzjc-0002NH-OB for bug-gnu-emacs@gnu.org; Sun, 17 May 2015 10:40:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YtzjZ-0003EZ-IK for bug-gnu-emacs@gnu.org; Sun, 17 May 2015 10:40:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:38300) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YtzjZ-0003Di-Ff for bug-gnu-emacs@gnu.org; Sun, 17 May 2015 10:40:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YtzjY-000186-MM for bug-gnu-emacs@gnu.org; Sun, 17 May 2015 10:40:04 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 17 May 2015 14:40:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20592 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 20592-submit@debbugs.gnu.org id=B20592.14318735714294 (code B ref 20592); Sun, 17 May 2015 14:40:04 +0000 Original-Received: (at 20592) by debbugs.gnu.org; 17 May 2015 14:39:31 +0000 Original-Received: from localhost ([127.0.0.1]:48275 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Ytzj0-00017A-Gr for submit@debbugs.gnu.org; Sun, 17 May 2015 10:39:31 -0400 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:49942) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Ytziy-00016x-2P for 20592@debbugs.gnu.org; Sun, 17 May 2015 10:39:29 -0400 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0NOI003000LPL300@a-mtaout20.012.net.il> for 20592@debbugs.gnu.org; Sun, 17 May 2015 17:39:21 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NOI003MZ0PJIS20@a-mtaout20.012.net.il>; Sun, 17 May 2015 17:39:21 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:102903 Archived-At: > Date: Sun, 17 May 2015 01:58:29 +0200 > From: Alexander Shukaev > > 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. (To complete the bug report, the 3 minibuffer-line-* faces need to be defined, and the minibuffer-line package from ELPA loaded and then minibuffer-line-mode turned on.) 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. 'minibuffer-line-mode' is implemented via the function 'format-mode-line'. While I can understand this design decision, the downside is that you get to face some of the idiosyncrasies of formatting the mode line. (E.g., did you ask yourself why you get an extra column of white space after the string?) The upshot of this is that you need to generate each substring that has a unique face with its own ':eval'. For example, the following abomination works as you expect: (setq-default minibuffer-line-format '((:eval (propertize " " 'display `((space :align-to (- right right-fringe ,(length (concat (format-time-string "%Y.%m.%d") " " (format-time-string "%A") " " (format-time-string "%R")))))))) (: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))))