From: Kevin Rodgers <ihs_4664@yahoo.com>
Subject: Re: Syntax Highlighting Latency in Emacs
Date: Mon, 27 Dec 2004 10:09:10 -0700 [thread overview]
Message-ID: <33attoF3pmj8uU1@individual.net> (raw)
In-Reply-To: <1dSdnQiE5LRBk1fcRVn-rg@comcast.com>
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
next prev parent reply other threads:[~2004-12-27 17:09 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-12-12 1:42 Syntax Highlighting Latency in Emacs jab3
2004-12-12 13:13 ` Thien-Thi Nguyen
2004-12-12 13:22 ` Peter Dyballa
[not found] ` <mailman.5367.1102858474.27204.help-gnu-emacs@gnu.org>
2004-12-12 22:23 ` jab3
2004-12-21 18:38 ` Peter Lee
2004-12-21 20:03 ` jab3
2004-12-22 21:55 ` Peter Lee
2004-12-23 0:18 ` jab3
2004-12-27 17:09 ` Kevin Rodgers [this message]
2004-12-13 9:35 ` Pierre-Charles David
2004-12-13 12:08 ` Kai Grossjohann
[not found] ` <mailman.5589.1102940728.27204.help-gnu-emacs@gnu.org>
2004-12-13 23:42 ` Stefan Monnier
2004-12-21 20:04 ` jab3
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=33attoF3pmj8uU1@individual.net \
--to=ihs_4664@yahoo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).