* Text Props and Strings
@ 2010-10-12 2:59 Óscar Fuentes
2010-10-12 3:59 ` Eli Zaretskii
0 siblings, 1 reply; 4+ messages in thread
From: Óscar Fuentes @ 2010-10-12 2:59 UTC (permalink / raw)
To: help-gnu-emacs
Following the example of the info node with that title on the Elisp
manual, I evaluate
(insert #("foo bar" 0 3 (face bold) 3 4 nil 4 7 (face italic)))
on the *scratch* buffer, but the string "foo bar" is inserted as normal
text, without properties (The font supports bold and italic)
Same result with
(insert #("x" 0 1 (face (:foreground "red"))))
So the properties on the string are ignored. What I'm missing?
Using GNU Emacs 24.0.50.1 (x86_64-unknown-linux-gnu, X toolkit) of
2010-09-16
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Text Props and Strings
2010-10-12 2:59 Text Props and Strings Óscar Fuentes
@ 2010-10-12 3:59 ` Eli Zaretskii
2010-10-12 12:46 ` Óscar Fuentes
0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2010-10-12 3:59 UTC (permalink / raw)
To: help-gnu-emacs
> From: Óscar Fuentes <ofv@wanadoo.es>
> Date: Tue, 12 Oct 2010 04:59:05 +0200
>
> So the properties on the string are ignored. What I'm missing?
propertize?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Text Props and Strings
2010-10-12 3:59 ` Eli Zaretskii
@ 2010-10-12 12:46 ` Óscar Fuentes
2010-10-12 13:25 ` Eli Zaretskii
0 siblings, 1 reply; 4+ messages in thread
From: Óscar Fuentes @ 2010-10-12 12:46 UTC (permalink / raw)
To: help-gnu-emacs
Eli Zaretskii <eliz@gnu.org> writes:
>> So the properties on the string are ignored. What I'm missing?
>
> propertize?
(insert (propertize "foo bar" 'face 'bold))
doesn't work either, but it seems that this happen because when the
buffer has font-lock activated, text properties for strings inserted
with `insert' are ignored (or removed just afterwads the insertion, I
don't know for sure.) If the buffer has no font-lock mode activated,
both `propertize' and the #( syntax works.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Text Props and Strings
2010-10-12 12:46 ` Óscar Fuentes
@ 2010-10-12 13:25 ` Eli Zaretskii
0 siblings, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2010-10-12 13:25 UTC (permalink / raw)
To: help-gnu-emacs
> From: Óscar Fuentes <ofv@wanadoo.es>
> Date: Tue, 12 Oct 2010 14:46:05 +0200
>
> when the buffer has font-lock activated
This important piece of information was absent from your original
question.
Yes, when font-lock is active, it overrides all the faces.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-10-12 13:25 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-12 2:59 Text Props and Strings Óscar Fuentes
2010-10-12 3:59 ` Eli Zaretskii
2010-10-12 12:46 ` Óscar Fuentes
2010-10-12 13:25 ` Eli Zaretskii
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.