Subject: Re: bug#65591: 30.0.50; ELPA pgk expreg: marking paragraph doesn't work in AUCTeX LaTeX-mode

From: Yuan Fu <[email-masked]>
Date: Wed, 30 Aug 2023 00:31:47 -0700

> 
> When using `expreg-expand' repeatedly in an AUCTeX LaTeX-mode buffer, it
> will never mark the complete paragraph.  The reason is that
> `expreg--paragraph' tries to distinguish between programming and
> text/prose modes where in the former, it wants to mark the defun whereas
> in the latter, it marks the paragraph.
> 
> AUCTeX LaTeX-mode (and (La)TeX as a language) is kind of a middle ground
> between prog-mode and text-mode.  It is derived from text-mode (and NOT
> prog-mode) but it defines a `beginning-of-defun-function' which deals
> with environments, e.g., \begin{foo}...\end{foo}.  It can make sense to
> mark both, the current environment as well as the current paragraph.
> However, currently expreg defines a programming mode to derive from
> prog-mode OR define a `beginning-of-defun-function' and for a
> programming mode, paragraph marking is disabled.
> 
> I guess it would be better to have separate `expreg--paragraph' and
> `expreg--defun' functions instead of conflating paragraph and defun
> marking in `expreg--paragraph’.

I make expreg—paragraph to process both defun and paragraph, rather exclusively one of them. This should fix It for TeX modes. Please see if works :-)

Yuan