[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/auctex d74338a1db 12/23: Add new custom option `TeX-fol
From: |
Tassilo Horn |
Subject: |
[elpa] externals/auctex d74338a1db 12/23: Add new custom option `TeX-fold-region-functions' |
Date: |
Thu, 18 Apr 2024 05:43:24 -0400 (EDT) |
branch: externals/auctex
commit d74338a1dbdb7031666b2c193ef5d829b6f5a0ba
Author: Paul Nelson <ultrono@gmail.com>
Commit: Arash Esbati <arash@gnu.org>
Add new custom option `TeX-fold-region-functions'
* tex-fold.el (TeX-fold-region-functions): New custom option.
(TeX-fold-region): Use it.
* doc/auctex.texi (Folding): Document it. (bug#70330)
---
doc/auctex.texi | 6 ++++++
tex-fold.el | 9 ++++++++-
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/doc/auctex.texi b/doc/auctex.texi
index 6e9d33c3a0..343caa5903 100644
--- a/doc/auctex.texi
+++ b/doc/auctex.texi
@@ -2649,6 +2649,12 @@ When this variable is non-@code{nil} and there is an
active regione, text
around the mark will be kept unfolded.
@end defopt
+@defopt TeX-fold-region-functions
+This variable is a list of functions which allow the user, or external
+packages, to fold additional @LaTeX{} constructs beyond those supported by
+default.
+@end defopt
+
@deffn Command TeX-fold-region
@kindex C-c C-o C-r
(@kbd{C-c C-o C-r}) Hide all configured macros in the marked region.
diff --git a/tex-fold.el b/tex-fold.el
index d786ff629d..e593aed58e 100644
--- a/tex-fold.el
+++ b/tex-fold.el
@@ -324,6 +324,12 @@ and `TeX-fold-math-spec-list', and environments in
`TeX-fold-env-spec-list'."
(TeX-fold-clearout-region start end)
(TeX-fold-region start end))))
+(defcustom TeX-fold-region-functions nil
+ "List of additional functions to call when folding a region.
+Each function is called with two arguments, the start and end positions
+of the region to fold."
+ :type '(repeat function))
+
(defun TeX-fold-region (start end)
"Fold all items in region from START to END."
(interactive "r")
@@ -335,7 +341,8 @@ and `TeX-fold-math-spec-list', and environments in
`TeX-fold-env-spec-list'."
(when (memq 'math TeX-fold-type-list)
(TeX-fold-region-macro-or-env start end 'math))
(when (memq 'comment TeX-fold-type-list)
- (TeX-fold-region-comment start end)))
+ (TeX-fold-region-comment start end))
+ (run-hook-with-args 'TeX-fold-region-functions start end))
(defun TeX-fold-region-macro-or-env (start end type)
"Fold all items of type TYPE in region from START to END.
- [elpa] externals/auctex updated (79c984e1a5 -> ecb6c62e85), Tassilo Horn, 2024/04/18
- [elpa] externals/auctex c008bb60b2 02/23: Make auto reveal feature configurable in folding, Tassilo Horn, 2024/04/18
- [elpa] externals/auctex 03793072c1 05/23: * tex.el (TeX-command): Adjust macOS version and name., Tassilo Horn, 2024/04/18
- [elpa] externals/auctex dfa05bf69d 01/23: Track the latest version of fntguide.tex, Tassilo Horn, 2024/04/18
- [elpa] externals/auctex 0fcc152333 03/23: Document the new customize option, Tassilo Horn, 2024/04/18
- [elpa] externals/auctex 0aa5010255 06/23: Update style/verbatim.el to package v1.5x, Tassilo Horn, 2024/04/18
- [elpa] externals/auctex 5343cf2ec3 07/23: Be aware of comments in docTeX-mode, Tassilo Horn, 2024/04/18
- [elpa] externals/auctex 5970fbf499 15/23: * .dir-locals.el: Catch up with Emacs' .dir-locals., Tassilo Horn, 2024/04/18
- [elpa] externals/auctex ec4e27ec21 04/23: * doc/changes.texi: Add an entry for `TeX-fold-auto-reveal'., Tassilo Horn, 2024/04/18
- [elpa] externals/auctex d74338a1db 12/23: Add new custom option `TeX-fold-region-functions',
Tassilo Horn <=
- [elpa] externals/auctex 5abc3d7f68 17/23: Change some `mark-active' to `(TeX-active-mark)', Tassilo Horn, 2024/04/18
- [elpa] externals/auctex f61de0abe6 18/23: Add section folding commands, Tassilo Horn, 2024/04/18
- [elpa] externals/auctex 18a3dc7b43 20/23: Make preview section commands preserve mark, Tassilo Horn, 2024/04/18
- [elpa] externals/auctex b4dde3e325 09/23: Fix `preview-region' on repeated math constructs, Tassilo Horn, 2024/04/18
- [elpa] externals/auctex 49c9feb133 10/23: Allow preprocessing of previews, Tassilo Horn, 2024/04/18
- [elpa] externals/auctex e4def30851 16/23: Make preview placement more flexible, Tassilo Horn, 2024/04/18
- [elpa] externals/auctex 07c2cf38a1 22/23: * NEWS.org: New file., Tassilo Horn, 2024/04/18
- [elpa] externals/auctex 9ba0093bec 08/23: Fix spelling of biblatex macro names, Tassilo Horn, 2024/04/18
- [elpa] externals/auctex ec48f765fb 13/23: Allow preview to work in non-file buffers, Tassilo Horn, 2024/04/18
- [elpa] externals/auctex 2fe75e6726 19/23: Make "locating previews..." message configurable, Tassilo Horn, 2024/04/18