From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: bojohan+news@dd.chalmers.se (Johan =?utf-8?Q?Bockg=C3=A5rd?=) Newsgroups: gmane.emacs.help Subject: Re: Q on multiple faces as text property `face' Date: Sat, 18 Feb 2006 20:00:10 +0100 Organization: Chalmers University of Technology, Sweden Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1140299486 1131 80.91.229.2 (18 Feb 2006 21:51:26 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 18 Feb 2006 21:51:26 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Feb 18 22:51:25 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FAZzA-00060T-6r for geh-help-gnu-emacs@m.gmane.org; Sat, 18 Feb 2006 22:51:24 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FAZyi-00035S-K7 for geh-help-gnu-emacs@m.gmane.org; Sat, 18 Feb 2006 16:50:56 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!logbridge.uoregon.edu!newsfeed.sunet.se!news01.sunet.se!129.16.116.9.MISMATCH!dd.chalmers.se!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 38 Original-NNTP-Posting-Host: linus003.dd.chalmers.se Mail-Copies-To: never User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:L+VfU8CTl5bnEriqaGf3Uk5hpyo= Original-Xref: shelby.stanford.edu gnu.emacs.help:137669 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:33294 Archived-At: "Drew Adams" writes: > I have two faces: > (defface face1 '((t (:background "White"))) "Face 1") > (defface face2 '((t (:foreground "Blue"))) "Face 2") > > Using `put-text-property' with the `face' property: > I put face2 on some text. > I put face1 on some text. > > I would like the result to show, wherever both faces are applied to > the same text, both a Blue foreground and White background. However, > what happens is that the last face applied takes precedence - the > other face contributes nothing. It doesn't "take precedence". put-text-property is a built-in function in `C source code'. (put-text-property START END PROPERTY VALUE &optional OBJECT) Set one property of the text from START to END. ^^^ The value of the `face' property is replaced altogether. > I also tried with definitions like this, also to no avail: > (defface face1 '((t (:background "White" :foreground unspecified))) "1") > (defface face2 '((t (:foreground "Blue" :backround unspecified))) "2") Obviously changing the face definitions will make no difference. > What's the correct way to do what I want: accumulate (merge) properties from > different faces? (No, I don't want to use overlays here.) The value of the face property may be a list. Use/see `font-lock-prepend-text-property' or `font-lock-append-text-property'. -- Johan Bockgård