From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.help Subject: Re: glitches with font-lock-add-keywords Date: Tue, 06 Jun 2006 08:38:32 +0200 Message-ID: <448522E8.6070403@gmx.at> References: <4483D436.1070105@gmx.at> <4484A7FF.7090708@speakeasy.net> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1149576145 13991 80.91.229.2 (6 Jun 2006 06:42:25 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 6 Jun 2006 06:42:25 +0000 (UTC) Cc: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jun 06 08:42:23 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 1FnVGc-0004L9-QQ for geh-help-gnu-emacs@m.gmane.org; Tue, 06 Jun 2006 08:42:19 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FnVGc-0006OB-81 for geh-help-gnu-emacs@m.gmane.org; Tue, 06 Jun 2006 02:42:18 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FnVG6-00067D-GN for help-gnu-emacs@gnu.org; Tue, 06 Jun 2006 02:41:46 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FnVG3-00063d-8U for help-gnu-emacs@gnu.org; Tue, 06 Jun 2006 02:41:45 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FnVG2-00062r-9s for help-gnu-emacs@gnu.org; Tue, 06 Jun 2006 02:41:42 -0400 Original-Received: from [213.165.64.20] (helo=mail.gmx.net) by monty-python.gnu.org with smtp (Exim 4.52) id 1FnVNL-0004tn-Gk for help-gnu-emacs@gnu.org; Tue, 06 Jun 2006 02:49:15 -0400 Original-Received: (qmail invoked by alias); 06 Jun 2006 06:41:40 -0000 Original-Received: from N833P019.adsl.highway.telekom.at (EHLO [62.47.48.19]) [62.47.48.19] by mail.gmx.net (mp038) with SMTP; 06 Jun 2006 08:41:40 +0200 X-Authenticated: #14592706 User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: de-DE, de, en-us, en Original-To: gebser@speakeasy.net In-Reply-To: <4484A7FF.7090708@speakeasy.net> X-Y-GMX-Trusted: 0 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:35339 Archived-At: > 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. "(sp\\?)" will match all occurrences of the character sequence "(sp?)". It never matches "What's lisp?". Additional escaped parentheses won't change anything here. The blue highlighting you mention probably comes from paren matching overlays and should disappear as soon as you move the cursor. > > 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 "???". I couldn't simply change your initial proposal to something like "\\<\\?\\?\\?\\>" because in most modes "?" doesn't have word syntax contradicting the use of "\\<" and "\\>". "\\_<" and "\\_>" force matches at symbol begin and end but might not work with Emacs 21. Maybe (defvar my-extra-keywords '(("\\<\\(FIXME\\):" 1 font-lock-warning-face prepend) ("\\<\\(XXX\\|xxx\\)\\>\\|\\?\\?\\?\\|(sp\\?)" . 'my-extra-face))) is all you need. Otherwise you would have to specify the semantics of the word "just" more distinctly.