help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Adding a colon as a word boundary for syntax highlighting


From: Johan Bockgård
Subject: Re: Adding a colon as a word boundary for syntax highlighting
Date: Mon, 18 Feb 2008 13:58:33 +0100
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.50 (gnu/linux)

Tim Johnson <tim@johnsons-web.com> writes:

> I'm using the following regex subexpression:
> "\\<\\("
> As the left-hand word boundary for syntax highlighting in
> a lisp-style programming language.
>
> "\\(" adds the opening parenthesis as a word boundary.

That doesn't make sense.

> I would like to add the colon (':') as an additional word
> boundary character.
> The subexpressions:
> "\\<\\(:" and "\\<\\(\\:" don't seem to work.
> In addition I have the following entry:
> (?: . "w") to the syntax table. 
> Could someone advise me on how to make this work correctly.

Note that font-lock can use a different syntax table than the mode's
ordinary syntax table.

> On a related note, I believe that there is an emacs add-on that
> allows the user to test elisp regexes, but for the life of me,
> I can't remember where to find it.

M-x re-builder or
regex-tool.el

-- 
Johan Bockgård


reply via email to

[Prev in Thread] Current Thread [Next in Thread]