auctex-diffs
[Top][All Lists]
Advanced

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

[AUCTeX-diffs] [elpa] externals/auctex 3df1e313ea 25/60: Adapt TeX-regio


From: Tassilo Horn
Subject: [AUCTeX-diffs] [elpa] externals/auctex 3df1e313ea 25/60: Adapt TeX-region-hook for lexical-binding
Date: Fri, 8 Apr 2022 11:52:50 -0400 (EDT)

branch: externals/auctex
commit 3df1e313ea852b7dc2f86a5fec5f28c3881e9e58
Author: Tassilo Horn <tsdh@gnu.org>
Commit: Tassilo Horn <tsdh@gnu.org>

    Adapt TeX-region-hook for lexical-binding
    
    * tex-buf.el (TeX-region-hook): Update docstring.
    (TeX-region-orig-buffer): Convert to defvar-local.
    (TeX-region-master-buffer): New variable.
    (TeX-region-create): Set TeX-region-master-buffer in addition to
    TeX-region-orig-buffer before runnig TeX-region-hook.
---
 tex-buf.el | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/tex-buf.el b/tex-buf.el
index eeff2fc06c..bc363a1d36 100644
--- a/tex-buf.el
+++ b/tex-buf.el
@@ -2069,9 +2069,10 @@ The compatibility argument IGNORE is ignored."
 (defvar TeX-region-hook nil
   "List of hooks to run before the region file is saved.
 The hooks are run in the region buffer, you may use the variable
-`master-buffer' to access the buffer of the master file and
-`orig-buffer' to access the buffer where \\[TeX-command-region] or
-\\[TeX-command-buffer] is invoked from.")
+`TeX-region-master-buffer' to access the buffer of the master
+file and `TeX-region-orig-buffer' to access the buffer where
+\\[TeX-command-region] or \\[TeX-command-buffer] is invoked
+from.")
 
 (defun TeX-quote-filename (file)
   "Convert file name into a form acceptable to TeX."
@@ -2110,9 +2111,12 @@ The hooks are run in the region buffer, you may use the 
variable
                                 "\\\\unexpanded{\\&}" file t)
     file))
 
-(defvar TeX-region-orig-buffer nil
+(defvar-local TeX-region-orig-buffer nil
   "The original buffer in which the TeX-region was created.")
-(make-variable-buffer-local 'TeX-region-orig-buffer)
+
+(defvar-local TeX-region-master-buffer nil
+  "The TeX-master buffer of the document for which the TeX-region
+was created.")
 
 (defun TeX-region-create (file region original offset)
   "Create a new file named FILE with the string REGION.
@@ -2238,6 +2242,7 @@ original file."
                 ") }\n"
                 trailer)
         (setq TeX-region-orig-buffer orig-buffer)
+        (setq TeX-region-master-buffer master-buffer)
         (run-hooks 'TeX-region-hook)
         (if (string-equal (buffer-string) original-content)
             (set-buffer-modified-p nil)




reply via email to

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