Subject: bug#73724: closed (Re: bug#73724: [PATCH] Add folding support for begin and end macros)

From: [email-masked] (GNU bug Tracking System)
Date: Wed, 16 Oct 2024 16:58:02 +0000

Your bug report

#73724: [PATCH] Add folding support for begin and end macros

which was filed against the auctex package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
73724: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=73724
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#73724: [PATCH] Add folding support for begin and end macros
From: Arash Esbati <[email-masked]>
To: Paul Nelson <[email-masked]>
Cc: [email-masked]
Date: Wed, 16 Oct 2024 18:56:33 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Paul Nelson <[email-masked]> writes:

> Hi Arash, thanks, please find attached the updated patch.  Paul

Hi Paul,

many thanks for your contribution and your patience.  I installed that
patch under your name, and therefore closing this report.

Best, Arash

Subject: [PATCH] Add folding support for begin and end macros
From: Paul Nelson <[email-masked]>
To: [email-masked]
Date: Wed, 9 Oct 2024 22:37:14 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

This patch supports the folding of \begin{...} and \end{...} macros.

The naive way to attempt such folding in AUCTeX via string
specifications in TeX-fold-macro-spec-list has many drawbacks.  I
would be happy to elaborate upon these, but do not do so in this
message.

This patch adds function specifications to TeX-fold-macro-spec-list
and a new user-facing option TeX-fold-begin-end-spec-list that
controls how to fold begin/end arguments.  To get a flavor, see the
screenshots at https://github.com/ultronozm/czm-tex-fold.el (but let
me note that I've streamlined the code while preparing this patch).

I'll illustrate here with some examples:

- If the option TeX-fold-begin-end-spec-list is nil, then behavior is as before.

- If the option contains an item such as

    (("↴" . "↲") ("itemize" "enumerate" "description" "frame"))

  then, e.g., \begin{enumerate} and \end{enumerate} fold to ↴ and ↲,
respectively.

- If the option contains an item such as

    ((TeX-fold-format-theorem-environment . "◼")
         ("note" ("theorem" "thm")))

  then

  - \begin{note} folds to "Note",
  - \begin{theorem} and \begin{thm} fold to "Theorem",
  - \begin{theorem}[Foo] and \begin{thm}[Foo] fold to "Theorem (Foo)".
  - \end{note}, etc., fold to "◼".

I've supplied what I believe to be reasonable defaults (attempting to
err on the conservative side), but would welcome any feedback.

Thanks, best,

Paul