auctex-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[AUCTeX-diffs] [elpa] externals/auctex 74f5675 01/23: Adapt preview.el.i


From: Tassilo Horn
Subject: [AUCTeX-diffs] [elpa] externals/auctex 74f5675 01/23: Adapt preview.el.in for `TeX-translate-location-hook'
Date: Sat, 23 Jan 2021 04:10:05 -0500 (EST)

branch: externals/auctex
commit 74f5675333c40d58b441d87e964429f309ba4b91
Author: Ikumi Keita <ikumi@ikumi.que.jp>
Commit: Ikumi Keita <ikumi@ikumi.que.jp>

    Adapt preview.el.in for `TeX-translate-location-hook'
    
    * preview.el.in (preview-parse-messages): Transport the values between
    dynamic scope variables TeX-translate-location-* and corresponding
    lexical scope variables around the call to
    `TeX-translate-location-hook'.
    Update copyright year.
---
 preview.el.in | 24 ++++++++++++++++++++++--
 1 file changed, 22 insertions(+), 2 deletions(-)

diff --git a/preview.el.in b/preview.el.in
index eb40ae5..91ce6e1 100644
--- a/preview.el.in
+++ b/preview.el.in
@@ -1,7 +1,7 @@
 ;;; preview.el --- embed preview LaTeX images in source buffer
 
 ;; Copyright (C) 2001-2006, 2010-2015,
-;;               2017-2020  Free Software Foundation, Inc.
+;;               2017-2021  Free Software Foundation, Inc.
 
 ;; Author: David Kastrup
 ;; Keywords: tex, wp, convenience
@@ -3299,7 +3299,13 @@ call, and in its CDR the final stuff for the placement 
hook."
           close-data
           open-data
           fast-hook
-          slow-hook)
+          slow-hook
+          TeX-translate-location-file
+          TeX-translate-location-line
+          TeX-translate-location-error
+          TeX-translate-location-offset
+          TeX-translate-location-context
+          TeX-translate-location-string)
       ;; clear parsing variables
       (dolist (var preview-parse-variables)
         (set (nth 1 var) nil))
@@ -3422,9 +3428,23 @@ name(\\([^)]+\\))\\)\\|\
                                         (nconc fast-hook (list fast)))
                                 (setq slow-hook
                                       (nconc slow-hook (list lst)))))))
+                        ;; Functions in `TeX-translate-location-hook'
+                        ;; may examine and modify the following variables.
+                        (setq TeX-translate-location-file file
+                              TeX-translate-location-line line
+                              ;; TeX-translate-location-error error
+                              TeX-translate-location-offset offset
+                              ;; TeX-translate-location-context context
+                              TeX-translate-location-string string)
                         (condition-case err
                             (save-excursion (mapc #'funcall slow-hook))
                           (error (preview-log-error err "Translation hook")))
+                        (setq file TeX-translate-location-file
+                              line TeX-translate-location-line
+                              ;; error TeX-translate-location-error
+                              offset TeX-translate-location-offset
+                              ;; context TeX-translate-location-context
+                              string TeX-translate-location-string)
                         (push (vector file (+ line offset)
                                       string after-string
                                       snippet box counters)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]