From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: jester@panix.com (Jesse Sheidlower) Newsgroups: gmane.emacs.help Subject: Background colors in font-lock-keywords Date: 27 May 2003 07:53:04 -0400 Organization: Oxford University Press Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: NNTP-Posting-Host: main.gmane.org X-Trace: main.gmane.org 1054036479 23543 80.91.224.249 (27 May 2003 11:54:39 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 27 May 2003 11:54:39 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Tue May 27 13:54:37 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19Kd2L-00067Z-00 for ; Tue, 27 May 2003 13:54:37 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19Kd3B-0007wo-Kr for gnu-help-gnu-emacs@m.gmane.org; Tue, 27 May 2003 07:55:29 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!newsfeed.berkeley.edu!ucberkeley!newsfeed!panix!panix2.panix.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 49 Original-NNTP-Posting-Host: panix2.panix.com Original-X-Trace: reader1.panix.com 1054036384 18636 166.84.1.2 (27 May 2003 11:53:04 GMT) Original-X-Complaints-To: abuse@panix.com Original-NNTP-Posting-Date: Tue, 27 May 2003 11:53:04 +0000 (UTC) Original-Xref: shelby.stanford.edu gnu.emacs.help:113730 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:10225 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:10225 I'm developing a derived mode of psgml in order to set up my own highlighting of particular tags and tag groups using font-lock, and I'm having trouble with two things relating to the background of faces I'm using. First, I'd like certain faces to use as a background any other element they happen to be on. For example, in my font-lock-keywords section I define entity references for this application as: ("&[a-zA-z]+;" . (0 my-entity-face t)) I've defined my-entity-face with a red foreground color and a weight of bold. What I would like is for the background to match whatever it's on, so that if there's an entity reference in text that happens to be white, it will be red with a white background, but if, in another font-lock-keywords expression, I have defined ("\\(.*?\\)" 1 my-title-face t) , with my-title-face having a light-green background, then I would like an entity reference used in a to be red but also with a light-green background. Is there any way of accomplishing this? I've been experimenting to no avail. Second, is there a way to associate a background color with a particular buffer only? For this same mode, I would like to get a lighly shaded background with white as the main background color for actual sgml (i.e. at the end of a line, text will appear light gray after the last closing tag). I have accomplished this by, in my mode definition, (set-background-color "gray90") and then in my font-lock-keywords, ("^\\(<.*>\\)$" 1 my-background-face keep) , with my-background-face defined as just having a white background, and then (to solve the same problem as above) having other faces inherit from this background. Is there a better way to do this? One particular problem is that when I kill a buffer in this mode, I'm left with a light-gray buffer wherever else I am, which is annoying, so at the least I'd like a way to get the grayness to be associated only with something in this mode. Thanks. Jesse Sheidlower From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Rodgers <ihs_4664@yahoo.com> Newsgroups: gmane.emacs.help Subject: Re: Background colors in font-lock-keywords Date: Tue, 27 May 2003 10:30:39 -0600 Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <3ED392AF.2030607@yahoo.com> References: <bavjj0$ot1$1@panix2.panix.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1054053490 21156 80.91.224.249 (27 May 2003 16:38:10 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 27 May 2003 16:38:10 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Tue May 27 18:38:00 2003 Return-path: <help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org> Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19KhSZ-0005Ts-00 for <gnu-help-gnu-emacs@m.gmane.org>; Tue, 27 May 2003 18:37:59 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19KhQF-0006LE-8G for gnu-help-gnu-emacs@m.gmane.org; Tue, 27 May 2003 12:35:35 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.uchicago.edu!newsswitch.lcs.mit.edu!newsfeed.mathworks.com.MISMATCH!newsfeed!fu-berlin.de!uni-berlin.de!170.207.51.80!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 58 Original-NNTP-Posting-Host: 170.207.51.80 Original-X-Trace: fu-berlin.de 1054053037 4625569 170.207.51.80 (16 [82742]) User-Agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2 X-Accept-Language: en-us Original-Xref: shelby.stanford.edu gnu.emacs.help:113745 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor <help-gnu-emacs.gnu.org> List-Help: <mailto:help-gnu-emacs-request@gnu.org?subject=help> List-Post: <mailto:help-gnu-emacs@gnu.org> List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-gnu-emacs>, <mailto:help-gnu-emacs-request@gnu.org?subject=subscribe> List-Archive: <http://mail.gnu.org/pipermail/help-gnu-emacs> List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-gnu-emacs>, <mailto:help-gnu-emacs-request@gnu.org?subject=unsubscribe> Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:10240 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:10240 Jesse Sheidlower wrote: > I'm developing a derived mode of psgml in order to set up my own > highlighting of particular tags and tag groups using font-lock, > and I'm having trouble with two things relating to the background > of faces I'm using. I'd like to hear how your project turns out. Several years ago I implemented something similar, but instead of using font-lock (which wasn't mature at the time) I hacked my own (ELEMENT . OVERLAY-PROPERTY-LIST) association list. It had some nice features, like using overlay priorities to handled element nesting and a special function property so you could compute overlay properties dynamically, but I didn't maintain it to keep up with Emacs and PSGML. Now I think the right approach would be to implement XSL support in Emacs. > First, I'd like certain faces to use as a background any other > element they happen to be on. For example, in my font-lock-keywords > section I define entity references for this application as: > > ("&[a-zA-z]+;" . (0 my-entity-face t)) Sorry I can't help you with your face questions. But note that SGML's reference concrete syntax (the default, used by PSGML) also allows digits, hyphen, and period in entity names (just not as the first character); and XML additionally allows underscore and colon (even as the first character) in entity names. XML also allows non-ASCII letters and other Unicode characters. See http://xml.coverpages.org/sgmlsyn/sgmlsyn.htm#P55 http://www.w3.org/TR/REC-xml#NT-Name > I've defined my-entity-face with a red foreground color and a > weight of bold. What I would like is for the background to > match whatever it's on, so that if there's an entity reference > in text that happens to be white, it will be red with a white > background, but if, in another font-lock-keywords expression, > I have defined > > ("<title>\\(.*?\\)" 1 my-title-face t) How do you handle elements that span more than 1 line? Does font-lock handle nested elements correctly for you? > , with my-title-face having a light-green background, then I > would like an entity reference used in a to be red but > also with a light-green background. Is there any way of > accomplishing this? I've been experimenting to no avail. ... -- <a href="mailto:<kevin.rodgers@ihs.com>">Kevin Rodgers</a> From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: jester@panix.com (Jesse Sheidlower) Newsgroups: gmane.emacs.help Subject: Re: Background colors in font-lock-keywords Date: 27 May 2003 13:12:05 -0400 Organization: Oxford University Press Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <bb0695$6b1$1@panix2.panix.com> References: <bavjj0$ot1$1@panix2.panix.com> <3ED392AF.2030607@yahoo.com> NNTP-Posting-Host: main.gmane.org X-Trace: main.gmane.org 1054056261 3726 80.91.224.249 (27 May 2003 17:24:21 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 27 May 2003 17:24:21 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Tue May 27 19:24:17 2003 Return-path: <help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org> Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19Ki9S-0000kO-00 for <gnu-help-gnu-emacs@m.gmane.org>; Tue, 27 May 2003 19:22:18 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19Ki2h-0006OL-TY for gnu-help-gnu-emacs@m.gmane.org; Tue, 27 May 2003 13:15:19 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!bloom-beacon.mit.edu!panix!panix2.panix.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 69 Original-NNTP-Posting-Host: panix2.panix.com Original-X-Trace: reader1.panix.com 1054055526 24909 166.84.1.2 (27 May 2003 17:12:06 GMT) Original-X-Complaints-To: abuse@panix.com Original-NNTP-Posting-Date: Tue, 27 May 2003 17:12:06 +0000 (UTC) Original-Xref: shelby.stanford.edu gnu.emacs.help:113746 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor <help-gnu-emacs.gnu.org> List-Help: <mailto:help-gnu-emacs-request@gnu.org?subject=help> List-Post: <mailto:help-gnu-emacs@gnu.org> List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-gnu-emacs>, <mailto:help-gnu-emacs-request@gnu.org?subject=subscribe> List-Archive: <http://mail.gnu.org/pipermail/help-gnu-emacs> List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-gnu-emacs>, <mailto:help-gnu-emacs-request@gnu.org?subject=unsubscribe> Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:10241 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:10241 In article <3ED392AF.2030607@yahoo.com>, Kevin Rodgers <ihs_4664@yahoo.com> wrote: >Jesse Sheidlower wrote: > >> I'm developing a derived mode of psgml in order to set up my own >> highlighting of particular tags and tag groups using font-lock, >> and I'm having trouble with two things relating to the background >> of faces I'm using. > > >I'd like to hear how your project turns out. Several years ago I implemented >something similar, but instead of using font-lock (which wasn't mature at the >time) I hacked my own (ELEMENT . OVERLAY-PROPERTY-LIST) association list. It >had some nice features, like using overlay priorities to handled element nesting >and a special function property so you could compute overlay properties >dynamically, but I didn't maintain it to keep up with Emacs and PSGML. Now I >think the right approach would be to implement XSL support in Emacs. At least for now, I'm doing this in the most basic, kludgy way possible, as I'm new to programming in Emacs Lisp. I'd be interested to see your hacks as well! >> First, I'd like certain faces to use as a background any other >> element they happen to be on. For example, in my font-lock-keywords >> section I define entity references for this application as: >> >> ("&[a-zA-z]+;" . (0 my-entity-face t)) > > >Sorry I can't help you with your face questions. But note that SGML's reference >concrete syntax (the default, used by PSGML) also allows digits, hyphen, and >period in entity names (just not as the first character); and XML additionally >allows underscore and colon (even as the first character) in entity names. XML >also allows non-ASCII letters and other Unicode characters. See Yes, but this project is designed for a particular application and I know the content of all of my entities. In fact, I'm using a flavor of SGML where the period, rather than the semicolon, signals the end of an entity reference, but I silently changed it above to avoid having to explain it! That didn't work. >> I've defined my-entity-face with a red foreground color and a >> weight of bold. What I would like is for the background to >> match whatever it's on, so that if there's an entity reference >> in text that happens to be white, it will be red with a white >> background, but if, in another font-lock-keywords expression, >> I have defined >> >> ("<title>\\(.*?\\)" 1 my-title-face t) > > >How do you handle elements that span more than 1 line? Does font-lock handle >nested elements correctly for you? Again, for this application, the tags only appear on a single line; if it runs longer than 80 (or whatever) characters you just keep going, without any newlines or returns. Handling nested elements is what my question was about ;-). For current purposes, the entity references are the only hard thing, as the other elements I'm choosing to highlight aren't nested. I was hoping that an answer to my original question would help me solve the for-now-theoretical case of <title>This is a title with <foo>something else</foo> inside. Best, Jesse Sheidlower From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Oliver Scholz Newsgroups: gmane.emacs.help Subject: Re: Background colors in font-lock-keywords Date: Wed, 28 May 2003 00:23:57 +0200 Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org 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: main.gmane.org 1054074630 31087 80.91.224.249 (27 May 2003 22:30:30 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 27 May 2003 22:30:30 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Wed May 28 00:30:29 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19Kmwe-00081S-00 for ; Wed, 28 May 2003 00:29:24 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19Kmxp-0003Bo-II for gnu-help-gnu-emacs@m.gmane.org; Tue, 27 May 2003 18:30:37 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!newsfeed.gamma.ru!Gamma.RU!fu-berlin.de!uni-berlin.de!dialin-145-254-193-203.arcor-ip.NET!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 55 Original-NNTP-Posting-Host: dialin-145-254-193-203.arcor-ip.net (145.254.193.203) Original-X-Trace: fu-berlin.de 1054074319 4443111 145.254.193.203 (16 [87814]) X-Attribution: os X-Face: "HgH2sgK|bfH$; PiOJI6|qUCf.ve<51_Od(%ynHr?=>znn#~#oS>",F%B8&\vus),2AsPYb -n>PgddtGEn}s7kH?7kH{P_~vu?]OvVN^qD(L)>G^gDCl(U9n{:d>'DkilN!_K"eNzjrtI4Ya6;Td% IZGMbJ{lawG+'J>QXPZD&TwWU@^~A}f^zAb[Ru;CT(UA]c& User-Agent: Gnus/5.090019 (Oort Gnus v0.19) Emacs/21.3.50 (windows-nt) Cancel-Lock: sha1:iRggMDCrVgAfe8MyzU568pwVql8= Original-Xref: shelby.stanford.edu gnu.emacs.help:113761 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:10256 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:10256 jester@panix.com (Jesse Sheidlower) writes: [...] > First, I'd like certain faces to use as a background any other > element they happen to be on. For example, in my font-lock-keywords > section I define entity references for this application as: > > ("&[a-zA-z]+;" . (0 my-entity-face t)) > > I've defined my-entity-face with a red foreground color and a > weight of bold. What I would like is for the background to > match whatever it's on, so that if there's an entity reference > in text that happens to be white, it will be red with a white > background, but if, in another font-lock-keywords expression, > I have defined > > ("\\(.*?\\)" 1 my-title-face t) > > , with my-title-face having a light-green background, then I > would like an entity reference used in a to be red but > also with a light-green background. Is there any way of > accomplishing this? I've been experimenting to no avail. Use the `prepend' or `append' keyword. For example: (defface example-l-word-face '((t (:background "Seagreen4"))) "Face used for words beginning with \"l\".") (defvar example-font-lock-keywords '(("\\<lirum\\>" . 'font-lock-warning-face) ("\\<larum\\>" . 'font-lock-keyword-face) ("\\<l\\w+" (0 'example-l-word-face append)))) (define-derived-mode example-mode text-mode "EXAMPLE" "Example mode for testing font lock keywords." (setq font-lock-defaults '(example-font-lock-keywords))) > Second, is there a way to associate a background color with a particular > buffer only? [...] Unfortunately there isn't a way to do this. The thing that comes closest to this is something like: (set (make-local-variable 'default-text-properties) '(face example-l-word-face)) The disadvantages are obvious. Oliver -- 9 Prairial an 211 de la Révolution Liberté, Egalité, Fraternité! From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Stefan Monnier" <monnier+gnu.emacs.help/news/@flint.cs.yale.edu> Newsgroups: gmane.emacs.help Subject: Re: Background colors in font-lock-keywords Date: 27 May 2003 10:35:40 -0400 Organization: Yale University Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <5lllwscv9f.fsf@rum.cs.yale.edu> References: <bavjj0$ot1$1@panix2.panix.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1054074953 32470 80.91.224.249 (27 May 2003 22:35:53 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 27 May 2003 22:35:53 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Wed May 28 00:35:49 2003 Return-path: <help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org> Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19Kn2r-0008RQ-00 for <gnu-help-gnu-emacs@m.gmane.org>; Wed, 28 May 2003 00:35:49 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19KmyE-0003DF-BI for gnu-help-gnu-emacs@m.gmane.org; Tue, 27 May 2003 18:31:02 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!logbridge.uoregon.edu!canoe.uoregon.edu!news.wss.yale.edu!rum.cs.yale.edu!rum.cs.yale.edu Original-Newsgroups: gnu.emacs.help Original-Lines: 9 Original-NNTP-Posting-Host: rum.cs.yale.edu Original-X-Trace: news.wss.yale.edu 1054046144 19687 128.36.229.169 (27 May 2003 14:35:44 GMT) Original-X-Complaints-To: news@news.wss.yale.edu Original-NNTP-Posting-Date: Tue, 27 May 2003 14:35:44 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 X-Original-NNTP-Posting-Host: rum.cs.yale.edu X-Original-Trace: 27 May 2003 10:35:40 -0400, rum.cs.yale.edu Original-Xref: shelby.stanford.edu gnu.emacs.help:113762 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor <help-gnu-emacs.gnu.org> List-Help: <mailto:help-gnu-emacs-request@gnu.org?subject=help> List-Post: <mailto:help-gnu-emacs@gnu.org> List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-gnu-emacs>, <mailto:help-gnu-emacs-request@gnu.org?subject=subscribe> List-Archive: <http://mail.gnu.org/pipermail/help-gnu-emacs> List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-gnu-emacs>, <mailto:help-gnu-emacs-request@gnu.org?subject=unsubscribe> Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:10259 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:10259 >>>>> "Jesse" == Jesse Sheidlower <jester@panix.com> writes: > ("&[a-zA-z]+;" . (0 my-entity-face t)) ^^ This tells font-lock to override which ever face was there before. See C-h v font-lock-keywords RET. You want to use `append' or `prepend' instead. Stefan From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Oliver Scholz <alkibiades@gmx.de> Newsgroups: gmane.emacs.help Subject: Re: Background colors in font-lock-keywords Date: Wed, 28 May 2003 00:43:39 +0200 Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <usmr0t3hg.fsf@ID-87814.user.dfncis.de> References: <bavjj0$ot1$1@panix2.panix.com> <uel2kc9ky.fsf@ID-87814.user.dfncis.de> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1054075501 2364 80.91.224.249 (27 May 2003 22:45:01 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 27 May 2003 22:45:01 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Wed May 28 00:44:59 2003 Return-path: <help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org> Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19KnBK-0000aL-00 for <gnu-help-gnu-emacs@m.gmane.org>; Wed, 28 May 2003 00:44:34 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19KnCH-0000Xy-3g for gnu-help-gnu-emacs@m.gmane.org; Tue, 27 May 2003 18:45:33 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!news.osn.de!fu-berlin.de!uni-berlin.de!dialin-145-254-193-203.arcor-ip.NET!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 27 Original-NNTP-Posting-Host: dialin-145-254-193-203.arcor-ip.net (145.254.193.203) Original-X-Trace: fu-berlin.de 1054075437 4887671 145.254.193.203 (16 [87814]) X-Attribution: os X-Face: "HgH2sgK|bfH$; PiOJI6|qUCf.ve<51_Od(%ynHr?=>znn#~#oS>",F%B8&\vus),2AsPYb -n>PgddtGEn}s7kH?7kH{P_~vu?]OvVN^qD(L)>G^gDCl(U9n{:d>'DkilN!_K"eNzjrtI4Ya6;Td% IZGMbJ{lawG+'J>QXPZD&TwWU@^~A}f^zAb[Ru;CT(UA]c& User-Agent: Gnus/5.090019 (Oort Gnus v0.19) Emacs/21.3.50 (windows-nt) Cancel-Lock: sha1:V483F0tycglqsK78jGDXmfrv2h0= Original-Xref: shelby.stanford.edu gnu.emacs.help:113765 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor <help-gnu-emacs.gnu.org> List-Help: <mailto:help-gnu-emacs-request@gnu.org?subject=help> List-Post: <mailto:help-gnu-emacs@gnu.org> List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-gnu-emacs>, <mailto:help-gnu-emacs-request@gnu.org?subject=subscribe> List-Archive: <http://mail.gnu.org/pipermail/help-gnu-emacs> List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-gnu-emacs>, <mailto:help-gnu-emacs-request@gnu.org?subject=unsubscribe> Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:10260 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:10260 Oliver Scholz <alkibiades@gmx.de> writes: [...] > Unfortunately there isn't a way to do this. The thing that comes > closest to this is something like: > > (set (make-local-variable 'default-text-properties) > '(face example-l-word-face)) > > The disadvantages are obvious. [...] I forgot to add: you can also do something like: (overlay-put (make-overlay (point-min) (point-max)) 'face 'example-l-word-face) Still not exactly what you want and not a canonical thing to do in a major mode. But you don't have to add `prepend' keywords to all your font-lock directives. Oliver -- 9 Prairial an 211 de la Révolution Liberté, Egalité, Fraternité! From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: lawrence mitchell <wence@gmx.li> Newsgroups: gmane.emacs.help Subject: Re: Background colors in font-lock-keywords Date: Wed, 28 May 2003 01:13:10 +0100 Organization: funfunfun Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <?fnord?87d6i4vsh5.fsf@ID-97657.usr.dfncis.de> References: <bavjj0$ot1$1@panix2.panix.com> <uel2kc9ky.fsf@ID-87814.user.dfncis.de> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1054081157 25060 80.91.224.249 (28 May 2003 00:19:17 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 28 May 2003 00:19:17 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Wed May 28 02:19:16 2003 Return-path: <help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org> Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19Koey-0006W4-00 for <gnu-help-gnu-emacs@m.gmane.org>; Wed, 28 May 2003 02:19:16 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19KobE-0007fO-R0 for gnu-help-gnu-emacs@m.gmane.org; Tue, 27 May 2003 20:15:24 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!syros.belnet.be!news.belnet.be!feed.news.nacamar.de!fu-berlin.de!uni-berlin.de!vegetable.demon.co.UK!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 17 Original-NNTP-Posting-Host: vegetable.demon.co.uk (80.177.16.3) Original-X-Trace: fu-berlin.de 1054080790 4925209 80.177.16.3 (16 [97657]) X-No-Yes: No Mail-Copies-To: nobody User-Agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 Cancel-Lock: sha1:PJxdJt3JA3+/M3YfufzheQ9+1wM= Original-Xref: shelby.stanford.edu gnu.emacs.help:113767 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor <help-gnu-emacs.gnu.org> List-Help: <mailto:help-gnu-emacs-request@gnu.org?subject=help> List-Post: <mailto:help-gnu-emacs@gnu.org> List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-gnu-emacs>, <mailto:help-gnu-emacs-request@gnu.org?subject=subscribe> List-Archive: <http://mail.gnu.org/pipermail/help-gnu-emacs> List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-gnu-emacs>, <mailto:help-gnu-emacs-request@gnu.org?subject=unsubscribe> Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:10262 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:10262 Oliver Scholz wrote: [...] > (defvar example-font-lock-keywords > '(("\\<lirum\\>" . 'font-lock-warning-face) > ("\\<larum\\>" . 'font-lock-keyword-face) > ("\\<l\\w+" (0 'example-l-word-face append)))) ^^^^^^ Surely this wants to be prepend. At least, my reading of the font-lock-keywords docstring, and some testing would indicate so. [...] -- lawrence mitchell <wence@gmx.li> From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Oliver Scholz <alkibiades@gmx.de> Newsgroups: gmane.emacs.help Subject: Re: Background colors in font-lock-keywords Date: Wed, 28 May 2003 09:32:42 +0200 Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <uvfvvsezp.fsf@ID-87814.user.dfncis.de> References: <bavjj0$ot1$1@panix2.panix.com> <uel2kc9ky.fsf@ID-87814.user.dfncis.de> <?fnord?87d6i4vsh5.fsf@ID-97657.usr.dfncis.de> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1054107243 20042 80.91.224.249 (28 May 2003 07:34:03 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 28 May 2003 07:34:03 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Wed May 28 09:34:01 2003 Return-path: <help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org> Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19KvRh-0005Cv-00 for <gnu-help-gnu-emacs@m.gmane.org>; Wed, 28 May 2003 09:34:01 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19KvT5-0000aZ-23 for gnu-help-gnu-emacs@m.gmane.org; Wed, 28 May 2003 03:35:27 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!headwall.stanford.edu!fu-berlin.de!uni-berlin.de!dialin-145-254-194-080.arcor-ip.NET!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 28 Original-NNTP-Posting-Host: dialin-145-254-194-080.arcor-ip.net (145.254.194.80) Original-X-Trace: fu-berlin.de 1054107180 5060526 145.254.194.80 (16 [87814]) X-Attribution: os X-Face: "HgH2sgK|bfH$; PiOJI6|qUCf.ve<51_Od(%ynHr?=>znn#~#oS>",F%B8&\vus),2AsPYb -n>PgddtGEn}s7kH?7kH{P_~vu?]OvVN^qD(L)>G^gDCl(U9n{:d>'DkilN!_K"eNzjrtI4Ya6;Td% IZGMbJ{lawG+'J>QXPZD&TwWU@^~A}f^zAb[Ru;CT(UA]c& User-Agent: Gnus/5.090019 (Oort Gnus v0.19) Emacs/21.3.50 (windows-nt) Cancel-Lock: sha1:O1pWvS9gvPBpXaIyoMUtsBjtdS0= Original-Xref: shelby.stanford.edu gnu.emacs.help:113776 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor <help-gnu-emacs.gnu.org> List-Help: <mailto:help-gnu-emacs-request@gnu.org?subject=help> List-Post: <mailto:help-gnu-emacs@gnu.org> List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-gnu-emacs>, <mailto:help-gnu-emacs-request@gnu.org?subject=subscribe> List-Archive: <http://mail.gnu.org/pipermail/help-gnu-emacs> List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-gnu-emacs>, <mailto:help-gnu-emacs-request@gnu.org?subject=unsubscribe> Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:10271 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:10271 lawrence mitchell <wence@gmx.li> writes: > Oliver Scholz wrote: > > [...] > >> (defvar example-font-lock-keywords >> '(("\\<lirum\\>" . 'font-lock-warning-face) >> ("\\<larum\\>" . 'font-lock-keyword-face) >> ("\\<l\\w+" (0 'example-l-word-face append)))) > ^^^^^^ > Surely this wants to be prepend. At least, my reading of the > font-lock-keywords docstring, and some testing would indicate > so. [...] Erm, this code was just example code, so I am personally not so sure which one should take precedence, the old fontification or the new one. It's hard for me to make an educated guess, because the major mode has no meaning, and so the fontification has no meaning. But maybe you have a more general reason to say this. Could you please elaborate? Oliver -- 9 Prairial an 211 de la Révolution Liberté, Egalité, Fraternité! From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: lawrence mitchell <wence@gmx.li> Newsgroups: gmane.emacs.help Subject: Re: Background colors in font-lock-keywords Date: Wed, 28 May 2003 14:15:35 +0100 Organization: funfunfun Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <?fnord?87fzmzyzyg.fsf@ID-97657.usr.dfncis.de> References: <bavjj0$ot1$1@panix2.panix.com> <uel2kc9ky.fsf@ID-87814.user.dfncis.de> <?fnord?87d6i4vsh5.fsf@ID-97657.usr.dfncis.de> <uvfvvsezp.fsf@ID-87814.user.dfncis.de> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1054128083 24139 80.91.224.249 (28 May 2003 13:21:23 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 28 May 2003 13:21:23 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Wed May 28 15:21:21 2003 Return-path: <help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org> Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19L0qk-0006CR-00 for <gnu-help-gnu-emacs@m.gmane.org>; Wed, 28 May 2003 15:20:15 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19L0r2-00045q-0w for gnu-help-gnu-emacs@m.gmane.org; Wed, 28 May 2003 09:20:32 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!headwall.stanford.edu!fu-berlin.de!uni-berlin.de!vegetable.demon.co.UK!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 24 Original-NNTP-Posting-Host: vegetable.demon.co.uk (80.177.16.3) Original-X-Trace: fu-berlin.de 1054127735 5367213 80.177.16.3 (16 [97657]) X-No-Yes: No Mail-Copies-To: nobody User-Agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 Cancel-Lock: sha1:lcQYMy974b/cNKD6CWBVQGSv3Gk= Original-Xref: shelby.stanford.edu gnu.emacs.help:113785 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor <help-gnu-emacs.gnu.org> List-Help: <mailto:help-gnu-emacs-request@gnu.org?subject=help> List-Post: <mailto:help-gnu-emacs@gnu.org> List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-gnu-emacs>, <mailto:help-gnu-emacs-request@gnu.org?subject=subscribe> List-Archive: <http://mail.gnu.org/pipermail/help-gnu-emacs> List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-gnu-emacs>, <mailto:help-gnu-emacs-request@gnu.org?subject=unsubscribe> Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:10280 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:10280 Oliver Scholz wrote: [...] PREPEND versus APPEND in font-lock-keywords. > Erm, this code was just example code, so I am personally not so sure > which one should take precedence, the old fontification or the new > one. It's hard for me to make an educated guess, because the major > mode has no meaning, and so the fontification has no meaning. > But maybe you have a more general reason to say this. Could you > please elaborate? The way I read it, if using `append', rather than `prepend', in the example above, EXAMPLE-L-WORD-FACE would change the background iff FONT-LOCK-WARNING-FACE and FONT-LOCK-KEYWORD-FACE, did not set the background colour. Certainly in my Emacs setup, said faces have had their backgrounds set explicitly. Maybe a font-lock wizard can jump in with a better and/or correct explanation. -- lawrence mitchell <wence@gmx.li> From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: jester@panix.com (Jesse Sheidlower) Newsgroups: gmane.emacs.help Subject: Re: Background colors in font-lock-keywords Date: 28 May 2003 12:09:43 -0400 Organization: Oxford University Press Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <bb2n07$i62$1@panix2.panix.com> References: <bavjj0$ot1$1@panix2.panix.com> <5lllwscv9f.fsf@rum.cs.yale.edu> NNTP-Posting-Host: main.gmane.org X-Trace: main.gmane.org 1054139135 23978 80.91.224.249 (28 May 2003 16:25:35 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 28 May 2003 16:25:35 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Wed May 28 18:25:31 2003 Return-path: <help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org> Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19L3eU-0005ea-00 for <gnu-help-gnu-emacs@m.gmane.org>; Wed, 28 May 2003 18:19:46 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19L3Vg-0006tN-AY for gnu-help-gnu-emacs@m.gmane.org; Wed, 28 May 2003 12:10:40 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!logbridge.uoregon.edu!panix!panix2.panix.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 18 Original-NNTP-Posting-Host: panix2.panix.com Original-X-Trace: reader1.panix.com 1054138183 24282 166.84.1.2 (28 May 2003 16:09:43 GMT) Original-X-Complaints-To: abuse@panix.com Original-NNTP-Posting-Date: Wed, 28 May 2003 16:09:43 +0000 (UTC) Original-Xref: shelby.stanford.edu gnu.emacs.help:113791 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor <help-gnu-emacs.gnu.org> List-Help: <mailto:help-gnu-emacs-request@gnu.org?subject=help> List-Post: <mailto:help-gnu-emacs@gnu.org> List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-gnu-emacs>, <mailto:help-gnu-emacs-request@gnu.org?subject=subscribe> List-Archive: <http://mail.gnu.org/pipermail/help-gnu-emacs> List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-gnu-emacs>, <mailto:help-gnu-emacs-request@gnu.org?subject=unsubscribe> Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:10285 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:10285 In article <5lllwscv9f.fsf@rum.cs.yale.edu>, Stefan Monnier <monnier+gnu.emacs.help/news/@flint.cs.yale.edu> wrote: >>>>>> "Jesse" == Jesse Sheidlower <jester@panix.com> writes: >> ("&[a-zA-z]+;" . (0 my-entity-face t)) > ^^ >This tells font-lock to override which ever face was there before. >See C-h v font-lock-keywords RET. >You want to use `append' or `prepend' instead. Thanks to you and the other poster who pointed this out. I did look this up, but in the Reference Manual, which discussed it in more confusing terms, and my experiment with it didn't work. It is much more clear in the regular doc string, which I should have checked first, and it seems it was an error in my experiment that kept it from working. Jesse Sheidlower From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Oliver Scholz <alkibiades@gmx.de> Newsgroups: gmane.emacs.help Subject: Re: Background colors in font-lock-keywords Date: Wed, 28 May 2003 18:13:01 +0200 Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <ur86jxd6a.fsf@ID-87814.user.dfncis.de> References: <bavjj0$ot1$1@panix2.panix.com> <uel2kc9ky.fsf@ID-87814.user.dfncis.de> <?fnord?87d6i4vsh5.fsf@ID-97657.usr.dfncis.de> <uvfvvsezp.fsf@ID-87814.user.dfncis.de> <?fnord?87fzmzyzyg.fsf@ID-97657.usr.dfncis.de> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1054139245 24651 80.91.224.249 (28 May 2003 16:27:25 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 28 May 2003 16:27:25 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Wed May 28 18:27:16 2003 Return-path: <help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org> Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19L3aX-0005Gh-00 for <gnu-help-gnu-emacs@m.gmane.org>; Wed, 28 May 2003 18:15:41 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19L3aU-00086i-04 for gnu-help-gnu-emacs@m.gmane.org; Wed, 28 May 2003 12:15:38 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!headwall.stanford.edu!fu-berlin.de!uni-berlin.de!dialin-145-254-191-054.arcor-ip.NET!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 43 Original-NNTP-Posting-Host: dialin-145-254-191-054.arcor-ip.net (145.254.191.54) Original-X-Trace: fu-berlin.de 1054138402 5492057 145.254.191.54 (16 [87814]) X-Attribution: os X-Face: "HgH2sgK|bfH$; PiOJI6|qUCf.ve<51_Od(%ynHr?=>znn#~#oS>",F%B8&\vus),2AsPYb -n>PgddtGEn}s7kH?7kH{P_~vu?]OvVN^qD(L)>G^gDCl(U9n{:d>'DkilN!_K"eNzjrtI4Ya6;Td% IZGMbJ{lawG+'J>QXPZD&TwWU@^~A}f^zAb[Ru;CT(UA]c& User-Agent: Gnus/5.090019 (Oort Gnus v0.19) Emacs/21.3.50 (windows-nt) Cancel-Lock: sha1:zopBMLKUvgUl3qTUsDoCY1CWZXg= Original-Xref: shelby.stanford.edu gnu.emacs.help:113792 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor <help-gnu-emacs.gnu.org> List-Help: <mailto:help-gnu-emacs-request@gnu.org?subject=help> List-Post: <mailto:help-gnu-emacs@gnu.org> List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-gnu-emacs>, <mailto:help-gnu-emacs-request@gnu.org?subject=subscribe> List-Archive: <http://mail.gnu.org/pipermail/help-gnu-emacs> List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-gnu-emacs>, <mailto:help-gnu-emacs-request@gnu.org?subject=unsubscribe> Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:10286 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:10286 lawrence mitchell <wence@gmx.li> writes: > Oliver Scholz wrote: > > [...] PREPEND versus APPEND in font-lock-keywords. > >> Erm, this code was just example code, so I am personally not so sure >> which one should take precedence, the old fontification or the new >> one. It's hard for me to make an educated guess, because the major >> mode has no meaning, and so the fontification has no meaning. > >> But maybe you have a more general reason to say this. Could you >> please elaborate? > > The way I read it, if using `append', rather than `prepend', > in the example above, EXAMPLE-L-WORD-FACE would change the > background iff FONT-LOCK-WARNING-FACE and > FONT-LOCK-KEYWORD-FACE, did not set the background colour. > Certainly in my Emacs setup, said faces have had their > backgrounds set explicitly. [...] That's true; this is what the "precedence" is about. However, if a user sets the background colour of `font-lock-warning-face' etc. explicitely, she probably attaches some intensional significance with it. Maybe the background colour even is the only face attribute of `font-lock-warning-face' in her configuration? Whether it is a bug or a feature to override this or to not override this, depends entirely on what is more important. Is it more important to highlight "lirum" and "larum" as special words or is it more important to highlight words beginning with "l"? Maybe it's nice but not necessary to highlight "lambda" and "lalala", but "lirum" and "larum" are *the* important keywords to watch out for? In this case it is a bug to highlight "lirum" and "larum" as `words beginning with l'. I have no idea what is the proper thing to do for `example-mode'. And I am the author of it. :-| Oliver -- 9 Prairial an 211 de la Révolution Liberté, Egalité, Fraternité!