GNU bug report logs -
#73724
[PATCH] Add folding support for begin and end macros
Previous Next
Reported by: Paul Nelson <ultrono <at> gmail.com>
Date: Wed, 9 Oct 2024 20:38:01 UTC
Severity: normal
Tags: patch
Done: Arash Esbati <arash <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your message dated Wed, 16 Oct 2024 18:56:33 +0200
with message-id <m21q0gvvem.fsf <at> macmutant.fritz.box>
and subject line Re: bug#73724: [PATCH] Add folding support for begin and end macros
has caused the debbugs.gnu.org bug report #73724,
regarding [PATCH] Add folding support for begin and end macros
to be marked as done.
(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)
--
73724: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=73724
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
[Message part 3 (text/plain, inline)]
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
[0001-Add-folding-support-for-begin-and-end-macros.patch (application/octet-stream, attachment)]
[Message part 5 (message/rfc822, inline)]
Paul Nelson <ultrono <at> gmail.com> 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
This bug report was last modified 215 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.