GNU bug report logs - #73302
TeX-find-closing-brace and verbatim macros

Previous Next

Package: auctex;

Reported by: Paul Nelson <ultrono <at> gmail.com>

Date: Mon, 16 Sep 2024 16:13:02 UTC

Severity: normal

Done: Arash Esbati <arash <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


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

From: Paul Nelson <ultrono <at> gmail.com>
To: Arash Esbati <arash <at> gnu.org>
Cc: Ikumi Keita <ikumi <at> ikumi.que.jp>, 73302 <at> debbugs.gnu.org
Subject: Re: bug#73302: TeX-find-closing-brace and verbatim macros
Date: Sat, 21 Sep 2024 10:50:05 +0200
On an unrelated note, I did encounter another issue with this change:
it sporadically breaks some of the folding carried out by my package
https://github.com/ultronozm/czm-tex-mint.el, due to a weird bug that
I'm having trouble diagnosing.

The issue concerns detecting verbatim macros in code immediately after
moving out of an mmm-mode block in a LaTeX buffer.  Specifically, with
point at the beginning of the final line of such a block, evaluating

  (progn (forward-line) (TeX-verbatim-p))

returns non-nil, but should instead return nil.  For instance, if we
interactively do (forward-line) followed by (TeX-verbatim-p), then we
get nil.

As a result, (TeX-verbatim-p) returns t in cases where
(LaTeX-verbatim-macro-boundaries) doesn't return anything useful, and
so TeX-fold-macro-nth-arg fails to detect arguments.

The issue really boils down to

  (progn (forward-line) (syntax-propertize (point)) (nth 3 (syntax-ppss)))

The issue disappears when tested via edebug, which makes it a bit
tricky for me to debug further.  I've noticed that the issue does NOT
arise with

  (progn (forward-line) (mmm-update-submode-region) (syntax-propertize
(point)) (nth 3 (syntax-ppss)))

but DOES still arise when putting the same lines in my code (rather
than running it via M-:).

Any quick thoughts/suggestions?

Is there some function that "very forcefully" updates whatever
internals (syntax-propertize (point)) (nth 3 (syntax-ppss)) depend
upon?

Is one forced to resort to idle timer trickery?  That would be a bit
painful in the case I'm considering.




This bug report was last modified 231 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.