GNU bug report logs - #71777
29.4; sexp-at-point in latex-mode when sexp contains ";"

Previous Next

Package: emacs;

Reported by: Gabriele Nicolardi <gabriele <at> medialab.sissa.it>

Date: Tue, 25 Jun 2024 20:41:02 UTC

Severity: normal

Found in version 29.4

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #32 received at 71777 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Gabriele Nicolardi <gabriele <at> medialab.sissa.it>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 71777 <at> debbugs.gnu.org
Subject: Re: bug#71777: 29.4; sexp-at-point in latex-mode when sexp contains
 ";"
Date: Wed, 26 Jun 2024 16:25:08 -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`?
> Because `forward-sexp` does not return nil if the parenthesis does not start
> a balanced expression.

There is no function that does just what you want; you need to make them
do what you want.  E.g.

    (save-excursion
      (condition-case nil
          (progn (forward-sexp 1) t)
        (scan-error nil)))

Note that "test if a parenthesis in LaTeX (latex-mode) starts a balanced
expression" is a kind of weird request, because it will only return nil
if there's a missing close-paren but not if there are too many
close-parens, i.e. it only detects one half of the imbalances.


        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.