unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: bojohan+news@dd.chalmers.se (Johan Bockgård)
To: help-gnu-emacs@gnu.org
Subject: Re: Adding a colon as a word boundary for syntax highlighting
Date: Mon, 18 Feb 2008 13:58:33 +0100	[thread overview]
Message-ID: <yoij7ih2a0au.fsf@remote2.student.chalmers.se> (raw)
In-Reply-To: 13ri26n4913br9a@news.supernews.com

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	other threads:[~2008-02-18 12:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-18  4:27 Adding a colon as a word boundary for syntax highlighting Tim Johnson
2008-02-18 12:58 ` Johan Bockgård [this message]
2008-02-18 16:00   ` Tim Johnson
2008-02-18 16:08 ` Stefan Monnier
2008-02-18 19:23   ` Tim Johnson
2008-02-20 19:41     ` Stefan Monnier
2008-02-20 20:37       ` Tim Johnson

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=yoij7ih2a0au.fsf@remote2.student.chalmers.se \
    --to=bojohan+news@dd.chalmers.se \
    --cc=help-gnu-emacs@gnu.org \
    /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).