all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Syntax properties and \_>
@ 2004-12-17 22:27 Ralf Angeli
  2004-12-20 10:56 ` Richard Stallman
  0 siblings, 1 reply; 3+ messages in thread
From: Ralf Angeli @ 2004-12-17 22:27 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-12-20 13:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-17 22:27 Syntax properties and \_> Ralf Angeli
2004-12-20 10:56 ` Richard Stallman
2004-12-20 13:42   ` Ralf Angeli

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.