[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Syntax properties and \_>
From: |
Ralf Angeli |
Subject: |
Syntax properties and \_> |
Date: |
Fri, 17 Dec 2004 23:27:24 +0100 |
User-agent: |
Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (gnu/linux) |
Hello everybody,
for font locking in AUCTeX am trying to match strings like "\\",
"\\*", "\-" but also "\newpage" and similar with a single regular
expression. I was trying to limit the match with help of \_> for
matching the empty string at the end of the strings. This works for
all constructs except "\\" because the character ?\\ has escape
syntax. Now I thought that placing a symbol syntax property onto the
second "\" would help, but it doesn't. Here is an example:
(with-temp-buffer
(insert "\\\\")
(put-text-property (1- (point)) (point) 'syntax-table '(3))
(newline)
(goto-char (point-min))
(let ((parse-sexp-lookup-properties t))
(re-search-forward "\\\\\\\\\\_>" nil t)))
Upon executing it you should see that it returns nil. But trying the
same example with "\\s_" instead of "\\\\\\\\\\_>" for the
`re-search-forward' statement returns a match.
Is this a bug in the way \_> is handled? It doesn't seem to recognize
syntax properties because there is a match if the syntax for "\" is
changed with `(modify-syntax-entry ?\\ "_")' instead of setting a
syntax property. Or am I doing something wrong?
--
Ralf
- Syntax properties and \_>,
Ralf Angeli <=