Subject: Re: bug#65824: Indent after open delimiters in verb constructs

From: Ikumi Keita <[email-masked]>
Date: Tue, 12 Sep 2023 01:38:42 +0900

Hi Arash,

>>>>> Arash Esbati <[email-masked]> writes:
> Any better ideas how to do this?

That seems a sensible solution to me.

> My only concern is that `LaTeX-verbatim-p' (which is used by
> `TeX-verbatim-p') uses `save-match-data' which is known to be
> expensive. I don't have any benchmarks, but there might be performance
> hit when indenting/filling large portions of text.

Hmm, it really matters, I think there are two actions that we can take:
1. Remove `save-match-data' from `LaTeX-verbatim-p' and announce the
   removal in changes.texi. Grepping over the current source briefly,
   the only usage of (La)TeX-verbatim-p that needs to preserve the match
   data is `LaTeX-search-forward-comment-start'. So wrapping it with
   `save-match-data' in that function is easy. (In addition,
   `LaTeX-search-forward-comment-start' is only used as a value of
   `TeX-search-forward-comment-start-function', which is only used in
   `TeX-search-forward-comment-start', which isn't used at all now.)
2. Implement LaTeX mode function for `indent-region'. Now AUCTeX has
   "line-by-line" indent function only, but there are apparent overheads
   when AUCTeX indents a region. We could implement region-oriented
   indent function which works with less overheads.

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine