Re: Fortifying bug

Ralf Angeli <[email protected]>
Newsgroups gmane.emacs.auc-tex
Message-ID <[email protected]>
* [email protected] (2005-02-15) writes:

> \verb+\+ breaks fortifying. After the second `+' all LaTeX source
> appears as if between $$, in my case at least. Remains like this until
> another \verb+\+ is encountered.

Well, I've been aware of that for some time know but unfortunately I
don't know how to fix it.  The backslash has escape syntax which seems
to override the syntax property placed at the position following it.
This will lead to `parse-partial-sexp' not finding the correct end of
the \verb construct.  I don't know if there is a way to get rid of the
backslash's escape syntax in verbatim commands/environments, or how to
make `parse-partial-sexp' ignore it.

Here is some code in case somebody wants to experiment:

(with-temp-buffer
  (insert "foo +\\+ bar")
  (put-text-property 5 6 'syntax-table '(15))
  (put-text-property 7 8 'syntax-table '(15))
  (goto-char (point-min))
  (set (make-local-variable 'parse-sexp-lookup-properties) t)
  (let ((old-state (parse-partial-sexp (point-min) (point-max)
				       nil nil nil 'syntax-table)))
    (parse-partial-sexp (point) (point-max)
			nil nil old-state 'syntax-table))
  (point))

Note how the value returned changes upon replacing the "\\" e.g. with
"a".

-- 
Ralf
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.