Subject: Re: bug#71777: 29.4; sexp-at-point in latex-mode when sexp contains ";"

From: Stefan Monnier <[email-masked]>
Date: Wed, 26 Jun 2024 16:11:41 -0400

> I need to test if a parenthesis in LaTeX (latex-mode) starts
> a balanced expression.

You mentioned `forward-sexp` which should do the trick, so what made you
try `sexp-at-point`?

> sexp-at-point: Return the sexp at point, or nil if none is found.
>
> This is not possible with (thing-at-point 'sexp) because it does no return nil in the case, e.g.:
>
> $K(U_1, V_1, x_1; t_2, x_2$

The "<foo>-at-point" functions (by the very nature of the concept of
"foo at point") are DWIMish functions.
They're usually not appropriate for use from ELisp code unless that
ELisp code itself wants to be DWIMish.

        Stefan