[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: regexp problem with 2 character comment starter
From: |
Stefan Monnier |
Subject: |
Re: regexp problem with 2 character comment starter |
Date: |
Wed, 23 Mar 2005 15:18:25 -0500 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) |
> (re-search-forward "\\s<") won't find comments that begin with
> a 2 character comment starter.
Indeed. (re-search-forward "\\s<") does not search for a beginning of
comment, but for a character whose syntax is "<", e.g. it'll not only ignore
"/*" in C, but it will also "incorrectly" find a ";" in elisp that's
preceded by a backslash. It'll also find characters of syntax "<" placed
inside strings.
You can try comment-search-forward instead. Note: you have to make sure
that comment-normalize-vars has been called in the current buffer before
using functions like comment-search-forward.
> "Move to EOL. If there, to EOL sans comments."
What would it say if written in English? ;-)
Stefan