[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/auctex 5f40b686b4 14/23: Call custom folding functions
From: |
Tassilo Horn |
Subject: |
[elpa] externals/auctex 5f40b686b4 14/23: Call custom folding functions with consistent point |
Date: |
Thu, 18 Apr 2024 05:43:24 -0400 (EDT) |
branch: externals/auctex
commit 5f40b686b46f74c441441839ad67703b743c900f
Author: Paul Nelson <ultrono@gmail.com>
Commit: Arash Esbati <arash@gnu.org>
Call custom folding functions with consistent point
* tex-fold.el (TeX-fold-hide-item): Call folding spec with point
at beginning of item.
* doc/auctex.texi (Folding): Mention the new convention.
(bug#70331)
---
doc/auctex.texi | 9 +++++----
tex-fold.el | 4 +++-
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/doc/auctex.texi b/doc/auctex.texi
index 343caa5903..064ba297ac 100644
--- a/doc/auctex.texi
+++ b/doc/auctex.texi
@@ -2767,10 +2767,11 @@ respective mandatory argument of a @LaTeX{} macro will
be used as the
placeholder.
If the first element is a function symbol, the function will be called
-with all mandatory arguments of the macro and the result of the function
-call will be used as a replacement for the macro.
-Such functions typically return a string, but may also return the
-symbol @code{abort} to indicate that the macro should not be folded.
+with all mandatory arguments of the macro, and with point positioned at
+the beginning of the macro. The result of the function call will be used
+as a replacement for the macro. Such functions typically return a string,
+but may also return the symbol @code{abort} to indicate that the macro
+should not be folded.
The placeholder is made by copying the text from the buffer together with
its properties, i.e.@: its face as well. If fontification has not
diff --git a/tex-fold.el b/tex-fold.el
index e593aed58e..fadc145a13 100644
--- a/tex-fold.el
+++ b/tex-fold.el
@@ -816,7 +816,9 @@ That means, put respective properties onto overlay OV."
(setq arg-list (append arg-list (list (car arg)))))
(setq n (1+ n)))
(or (condition-case nil
- (apply spec arg-list)
+ (save-excursion
+ (goto-char ov-start)
+ (apply spec arg-list))
(error nil))
"[Error: No content or function found]")))
(t (or (TeX-fold-macro-nth-arg spec ov-start ov-end)
- [elpa] externals/auctex f61de0abe6 18/23: Add section folding commands, (continued)
- [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
- [elpa] externals/auctex ed37457621 21/23: ; Fix commit e4def30851, Tassilo Horn, 2024/04/18
- [elpa] externals/auctex 5f40b686b4 14/23: Call custom folding functions with consistent point,
Tassilo Horn <=
- [elpa] externals/auctex d9f8ff12b1 11/23: Support mcite compat macros provided by biblatex, Tassilo Horn, 2024/04/18
- [elpa] externals/auctex ecb6c62e85 23/23: Merge remote-tracking branch 'origin/master' into externals/auctex, Tassilo Horn, 2024/04/18