From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.help Subject: Re: Syntax Highlighting Latency in Emacs Date: Mon, 27 Dec 2004 10:09:10 -0700 Message-ID: <33attoF3pmj8uU1@individual.net> References: <9badnW_9ItZTWSHcRVn-iw@comcast.com> <1dSdnQiE5LRBk1fcRVn-rg@comcast.com> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1104167653 21965 80.91.229.6 (27 Dec 2004 17:14:13 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 27 Dec 2004 17:14:13 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Dec 27 18:14:08 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CiyRc-0003wI-00 for ; Mon, 27 Dec 2004 18:14:08 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CiycP-0006Lk-Td for geh-help-gnu-emacs@m.gmane.org; Mon, 27 Dec 2004 12:25:17 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!logbridge.uoregon.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 31 Original-X-Trace: individual.net EW4F6o9o4U9zuIeQl34aLAb2taWJGTqPtd9csutjt948PPaj4= User-Agent: Mozilla Thunderbird 0.9 (X11/20041105) X-Accept-Language: en-us, en In-Reply-To: <1dSdnQiE5LRBk1fcRVn-rg@comcast.com> Original-Xref: shelby.stanford.edu gnu.emacs.help:127540 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: main.gmane.org gmane.emacs.help:22999 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:22999 jab3 wrote: > Peter Lee finally wrote on Wed December 22 2004 04:55 pm: >>maybe something like: >> >>(global-set-key (kbd "C-c m") (lambda () (interactive) (highlight-regexp >>"\%s" "hi-yellow"))) > > Excellent. I got that to work with font-lock-function-name-face, so > everything's all starting to come together. I have a question though. I > had to do something odd (at least I consider it odd :); to make '\n' work > in the .emacs file with the lambda function, I had to use 4 \ for it to > only use the '\n'. That is, > > (highlight-regexp "\\\\n" "font-lock-function-name-face") > > is the only thing that worked correctly. If I only did "\\n" then Emacs > highlighted all 'n's. Why is it necessary to use '\\\\n' to represent > '\n'? I can understand '\\n' - it's just the double that is confusing > me. :) You want to match the 2-character sequence `backslash lowercase-n', right? In order to match the backslash character, the regular expression is `\\'; the string that contains 2 backslashes is "\\\\". This is discussed in the Regexps node [aka Syntax of Regular Expressions =============================] of the Emacs manual; also look for the description of strings in the Init Syntax node [aka Init File Syntax] and Glossary node. -- Kevin Rodgers