From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ken Newsgroups: gmane.emacs.help Subject: Re: glitches with font-lock-add-keywords Date: Mon, 05 Jun 2006 17:54:07 -0400 Message-ID: <4484A7FF.7090708@speakeasy.net> References: <4483D436.1070105@gmx.at> Reply-To: help-gnu-emacs@gnu.org NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1149544500 31519 80.91.229.2 (5 Jun 2006 21:55:00 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 5 Jun 2006 21:55:00 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jun 05 23:54:59 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 1FnN2B-0005Qa-Ip for geh-help-gnu-emacs@m.gmane.org; Mon, 05 Jun 2006 23:54:51 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FnN2B-00020v-5h for geh-help-gnu-emacs@m.gmane.org; Mon, 05 Jun 2006 17:54:51 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FnN1z-0001zz-EP for help-gnu-emacs@gnu.org; Mon, 05 Jun 2006 17:54:39 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FnN1y-0001xa-3f for help-gnu-emacs@gnu.org; Mon, 05 Jun 2006 17:54:39 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FnN1x-0001xG-ST for help-gnu-emacs@gnu.org; Mon, 05 Jun 2006 17:54:37 -0400 Original-Received: from [69.17.117.4] (helo=mail2.sea5.speakeasy.net) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1FnN9C-000531-0a for help-gnu-emacs@gnu.org; Mon, 05 Jun 2006 18:02:06 -0400 Original-Received: (qmail 6584 invoked from network); 5 Jun 2006 21:54:35 -0000 Original-Received: from dsl093-011-017.cle1.dsl.speakeasy.net (HELO [192.168.0.27]) (gebser@[66.93.11.17]) (envelope-sender ) by mail2.sea5.speakeasy.net (qmail-ldap-1.03) with AES256-SHA encrypted SMTP for ; 5 Jun 2006 21:54:35 -0000 User-Agent: Mozilla Thunderbird 1.0 (X11/20041207) X-Accept-Language: en-us, en Original-To: martin rudalics , help-gnu-emacs@gnu.org In-Reply-To: <4483D436.1070105@gmx.at> 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:35335 Archived-At: martin rudalics wrote: >> (defvar my-extra-keywords >> '(("\\<\\(FIXME\\):" 1 font-lock-warning-face prepend) >> ("\\<\\(XXX\\|xxx\\|???\\|(sp?)\\)\\>" . font-lock-keyword-face))) >> >> The strings "XXX" and "xxx" are the only ones which are colorized at >> all, showing up as magenta. I would like all of them to be something >> more striking, like lime-green. Is there a table or some sort of >> "translation" which can be used to determine what actual color names >> correspond to vars like "font-lock-warning-face" and >> "font-lock-keyword"? Or, better, can actual color names be used >> instead, and if so, where would I find a table or listing of them? > > (defface my-extra-face '((t (:foreground "LimeGreen"))) > "My extra face. Pick your favorite group on the next line." > :group 'basic-faces) > >> Secondly: None of the strings containing a '?' are colorized at all >> (they're just black, the same as "normal" text); I understand that '?' >> is a special character in elisp and so requires some minor syntactical >> gymnastics to induce emacs to treat it as a regular character. So what >> is the syntax I should use for that here? > > Assuming that the question mark is a symbol constituent and "(" and ")" > are open and close parenthesis characters you can try: > > (defvar my-extra-keywords > '(("\\<\\(FIXME\\):" 1 font-lock-warning-face prepend) > ("\\<\\(XXX\\|xxx\\)\\>\\|\\_<\\(\\?\\?\\?\\)\\_>\\|(sp\\?)" . > 'my-extra-face))) Thanks, Martin, The LimeGreen is showing up and the "sp?" inside of "(sp?)". I'm thinking that the "()" chars are being overwritten by other, blue highlighting. I changed the last line above to: ("\\<\\(XXX\\|xxx\\)\\>\\|\\_<\\(\\?\\?\\?\\)\\_>\\|(\\(sp\\?\\))" . 'my-extra-face))) because I don't want the last three chars of "What's lisp?" to be highlighted, but only "(sp?)". So all of that is fine. However, "???" is not being highlighted. There's a lot of characters clustered around the "???"... I'm wondering if they're all supposed to be there.... Again, I just want ??? to be highlighted, not _<(???)>_ or anything like that... just "???". Thanks for any solutions. -- As a statistic, the US Unemployment Rate is like saying that no one is drowning because the flood waters have risen only five inches today.