From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Pascal Bourguignon Newsgroups: gmane.emacs.help Subject: Re: Can a face have different attributes in different buffers? Date: 23 Jan 2005 01:02:13 +0100 Organization: [posted via Easynet Spain] Message-ID: <87u0p9nhbu.fsf@thalassa.informatimago.com> References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1106438589 23701 80.91.229.6 (23 Jan 2005 00:03:09 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 23 Jan 2005 00:03:09 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jan 23 01:03:02 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CsVDa-0007Kr-00 for ; Sun, 23 Jan 2005 01:03:02 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1CsVPi-0001tm-12 for geh-help-gnu-emacs@m.gmane.org; Sat, 22 Jan 2005 19:15:34 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!news2.google.com!newsread.com!news-xfer.newsread.com!newspeer.monmouth.com!newsfeed.icl.net!newsfeed.fjserv.net!easynet-quince!easynet.net!easynet-post2!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 Original-Lines: 28 Original-NNTP-Posting-Host: 62.93.174.79 Original-X-Trace: DXC=?2h8ob;JK@E6:eBX 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: main.gmane.org gmane.emacs.help:23547 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:23547 Yevgeniy Makarov writes: > Hello, > > I have the following question. Judging by the fact that the function which > sets an attribute of some face (set-face-attribute) takes a frame as an > argument, it is not possible to have different buffers in one frame with > different values of the same attribute. Is it so? For example, can I have > comments of different colors (attribute :foreground of face > font-lock-comment-face) in different buffers of the same frame? I don't think that's possible. Faces are referenced thru symbols. Ie. the way it is implemented, faces are not first class objects, they're attributes of symbols. Symbols aren't specific to a buffer. The best you could do is to create new faces for each buffer, copying the faces you want onto new gensym'ed symbols and refering them thru buffer-local variables. Of course, since normal font-locking code refers the faces "literally" thru the symbols they use, you'd have to patch them or program your own font-locking. -- __Pascal Bourguignon__ http://www.informatimago.com/ The mighty hunter Returns with gifts of plump birds, Your foot just squashed one.