unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Florian Beck <abstraktion@t-online.de>
To: help-gnu-emacs@gnu.org
Subject: Combining Faces
Date: Mon, 12 Nov 2007 18:04:07 +0100	[thread overview]
Message-ID: <874pfrbdko.fsf@sophokles.streitblatt.de> (raw)

How do I fontify a string that already contains fontification?

This very *sentence*, for example, will yield the following result when
_read_ with =buffer-substring= in muse-mode:

#("\"This very *sentence*, for example, will yield the following result when
_read_ with =buffer-substring= in muse-mode" 0 11 (fontified t
auto-composed t) 11 12 (fontified t invisible muse auto-composed t) 12
20 (fontified t face muse-emphasis-1 auto-composed t) 20 21 (fontified t
invisible muse auto-composed t) 21 73 (fontified t auto-composed t) 73
74 (fontified t invisible muse) 74 78 (fontified t face underline
auto-composed t) 78 79 (fontified t invisible muse auto-composed t) 79
85 (fontified t auto-composed t) 85 86 (fontified t invisible muse
auto-composed t) 86 102 (fontified t face muse-verbatim auto-composed t)
102 103 (fontified t invisible muse auto-composed t) 103 116 (fontified
t auto-composed t))

Now, lets say, I want the whole sentence with yellow foreground. If I
try this:

(add-text-properties 1 117 '(face (:foreground "Yellow"))),

I loose the original faces.

What is the easiest way to apply face properties to a string without
removing face properties already present? How do I handle the case when
not individual properties but a face is set?

-- 
Florian Beck

                 reply	other threads:[~2007-11-12 17:04 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=874pfrbdko.fsf@sophokles.streitblatt.de \
    --to=abstraktion@t-online.de \
    --cc=help-gnu-emacs@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.
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).