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

[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: Tue, 09 Mar 2004 16:33:34 +0900
User-agent: T-gnus/6.17.2 (based on No Gnus v0.2) SEMI/1.14.6 (Maruoka) FLIM/1.14.6 (Marutamachi) APEL/10.6 MULE XEmacs/21.4 (patch 15) (Security Through Obscurity) (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.  I wanted
to decorate a part of mode-line, so 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




reply via email to

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