[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/auctex e4def30851 16/23: Make preview placement more fl
From: |
Tassilo Horn |
Subject: |
[elpa] externals/auctex e4def30851 16/23: Make preview placement more flexible |
Date: |
Thu, 18 Apr 2024 05:43:25 -0400 (EDT) |
branch: externals/auctex
commit e4def30851678ca9114d08348b24ccb197617c7f
Author: Paul Nelson <ultrono@gmail.com>
Commit: Arash Esbati <arash@gnu.org>
Make preview placement more flexible
* preview.el.in (preview-find-end-function): New variable.
(preview-parse-messages): Use it. (bug#70348)
---
preview.el.in | 36 +++++++++++++++++++++++++-----------
1 file changed, 25 insertions(+), 11 deletions(-)
diff --git a/preview.el.in b/preview.el.in
index 2fbf3a520e..d46aadb2f1 100644
--- a/preview.el.in
+++ b/preview.el.in
@@ -3270,6 +3270,14 @@ Return a new string."
(defvar-local preview--region-begin nil)
+(defvar preview-find-end-function nil
+ "Function used to compute the end position for a new overlay.
+The function bound to this variable will be called inside
+`preview-parse-messages' with one argument, an integer describing the
+beginning of the overlay. This is intended to be used in conjunction
+with `preview-preprocess-function' when the latter introduces
+significant modifications.")
+
(defun preview-parse-messages (open-closure)
"Turn all preview snippets into overlays.
This parses the pseudo error messages from the preview
@@ -3588,22 +3596,28 @@ name(\\([^)]+\\))\\)\\|\
(if box
(progn
(if (and lstart (= snippet lsnippet))
- (setq close-data
- (nconc
- (preview-place-preview
- snippet
+ (let* ((region-beg
(save-excursion
(preview-back-command
(= (prog1 (point)
(goto-char lstart))
lstart))
- (point))
- (point)
- (preview-TeX-bb box)
- (cons lcounters counters)
- tempdir
- (cdr open-data))
- close-data))
+ (point)))
+ (region-end
+ (if preview-find-end-function
+ (funcall preview-find-end-function
+ region-beg)
+ (point)))
+ (ovl (preview-place-preview
+ snippet
+ region-beg
+ region-end
+ (preview-TeX-bb box)
+ (cons lcounters counters)
+ tempdir
+ (cdr open-data)))
+ (ov (car ovl)))
+ (setq close-data (nconc ovl close-data))
(with-current-buffer run-buffer
(preview-log-error
(list 'error
- [elpa] externals/auctex 2fe75e6726 19/23: Make "locating previews..." message configurable, (continued)
- [elpa] externals/auctex 2fe75e6726 19/23: Make "locating previews..." message configurable, 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 5343cf2ec3 07/23: Be aware of comments in docTeX-mode, 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 5970fbf499 15/23: * .dir-locals.el: Catch up with Emacs' .dir-locals., Tassilo Horn, 2024/04/18
- [elpa] externals/auctex f61de0abe6 18/23: Add section folding commands, Tassilo Horn, 2024/04/18
- [elpa] externals/auctex ed37457621 21/23: ; Fix commit e4def30851, Tassilo Horn, 2024/04/18
- [elpa] externals/auctex 07c2cf38a1 22/23: * NEWS.org: New file., Tassilo Horn, 2024/04/18
- [elpa] externals/auctex d9f8ff12b1 11/23: Support mcite compat macros provided by biblatex, 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 e4def30851 16/23: Make preview placement more flexible,
Tassilo Horn <=
- [elpa] externals/auctex d74338a1db 12/23: Add new custom option `TeX-fold-region-functions', Tassilo Horn, 2024/04/18
- [elpa] externals/auctex 5abc3d7f68 17/23: Change some `mark-active' to `(TeX-active-mark)', Tassilo Horn, 2024/04/18
- [elpa] externals/auctex 9ba0093bec 08/23: Fix spelling of biblatex macro names, Tassilo Horn, 2024/04/18