[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [AUCTeX-devel] Fun with syntax tables
From: |
David Kastrup |
Subject: |
Re: [AUCTeX-devel] Fun with syntax tables |
Date: |
Thu, 21 Jul 2005 21:59:53 +0200 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) |
Ralf Angeli <address@hidden> writes:
> Suppose you have line like
> foo \verb|bar| baz
> in a LaTeX buffer. font-latex puts syntax properties (string quote
> syntax) onto the | characters which then get picked up by
> `font-lock-fontify-syntactically-region'. This happens with help of
> `parse-partial-sexp'.
>
> This is fine in LaTeX mode, but fails in documentation parts of docTeX
> mode. There the line would look like this:
> % foo \verb|bar| baz
> That means with a comment starter at the front.
>
> The problem is that with % as the comment start and \n as the comment
> end `parse-partial-sexp' won't find the stuff marked with string quote
> syntax inside of the comment. Here is an example:
[...]
> If you execute it, it should return 13 which is the end of the line.
> If you remove the % character from the inserted string it will return
> 8 which is the position just after the second | character.
>
> Can anybody tell me how to make the string quote stuff visible for
> `parse-partial-sexp'?
Well, there are some variables that mildly sound like they could be
useful.
#1 would be
parse-sexp-ignore-comments
Variable: Non-nil means `forward-sexp', etc., should treat comments as
whitespace.
Plist: standard-value variable-documentation
Some others of possible relevance:
comment-use-global-state
Variable: Non-nil means that the global syntactic context is used.
Plist: variable-documentation
comment-use-syntax
Variable: Non-nil if syntax-tables can be used instead of regexps.
Plist: variable-documentation
font-lock-comment-end-skip
Variable: If non-nil, Font Lock mode uses this instead of `comment-end'.
Plist: variable-documentation
font-lock-comment-start-regexp
Variable: Regexp to match the start of a comment.
Plist: variable-documentation
font-lock-comment-start-skip
Variable: If non-nil, Font Lock mode uses this instead of
`comment-start-skip'.
Plist: variable-documentation
--
David Kastrup, Kriemhildstr. 15, 44793 Bochum