GNU bug report logs -
#71777
29.4; sexp-at-point in latex-mode when sexp contains ";"
Previous Next
Full log
View this message in rfc822 format
> The `forward-sexp` function does not necessarily give an error if the
> parenthesis does not start a balanced expression. E.g.
>
> $( x + y ]$
Yup. Most of the functions that are meant to be used to parse code
while it's being edited don't check validity. Basically they try to
find "what is the meaning of this text" rather than "does this text have
meaning". That's on purpose, because it makes them more usable even
when the text is not 100% valid.
`read` (which parses an ELisp s-exp and is used in `sexp-at-point` to
try and turn the string "( x + y ]" (found by `forward-sexp) into a Lisp
value) is one of the rare exceptions because that one is not meant to
parse text as you type it but rather to parse text in order to process
it (typically, to execute it).
But it obeys the ELisp syntax rather than the LaTeX syntax.
> here "(" does not start a balanced expression but `forward-sexp` does not
> return an error.
I don't think there's code in Emacs which does what you want, so if you
really need to check proper pairing you're going to have to write the code.
Stefan
This bug report was last modified 331 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.