[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Q] text property on mode-line string
From: |
Daiki Ueno |
Subject: |
[Q] text property on mode-line string |
Date: |
Wed, 10 Mar 2004 08:18:24 +0900 |
User-agent: |
T-gnus/6.17.2 (based on No Gnus v0.2) SEMI/1.14.6 (Maruoka) FLIM/1.14.5 (Demachiyanagi) APEL/10.6 MULE XEmacs/21.4 (patch 14) (Reasonable Discussion) (i686-pc-linux) |
(Sorry for this report not being sent using M-x report-emacs-bug. I
haven't finished configuring email environment for GNU Emacs.)
I have a question about text property on mode-line string. Since I
wanted to decorate a part of mode-line I simply set 'face property for
a string and placed the string at the beginning of mode-line-format:
(setq test-face (make-face 'test-face))
(set-face-foreground 'test-face "red")
(push (propertize "ABC" 'face 'test-face)
mode-line-format)
Of course it works. i.e. red "ABC" shows up on the left side of mode-line.
Next, I tried to use a symbol reference to the propertized string:
(setq mode-line-format (nconc (list "" 'abc) mode-line-format))
And:
(setq abc (propertize "ABC" 'face 'test-face))
It also works as expected. Finally, I tried to use a list as the
value of abc:
(setq abc (list (propertize "ABC" 'face 'test-face)))
It doesn't bring the same effect as above 2 cases. i.e. "ABC" is not
displayed in red (on my environment, it displayed in black). Oddly
enough, when I removed the 'face property from the first character
("A"), only "BC" is displayed in red:
(remove-text-properties 0 1 '(face) (car abc))
Is this a bug?
I'm using Emacs 21.3.
Regards,
--
Daiki Ueno