auctex-diffs
[Top][All Lists]
Advanced

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

[AUCTeX-diffs] [elpa] externals/auctex 3c8e583 08/34: Introduce new vari


From: Tassilo Horn
Subject: [AUCTeX-diffs] [elpa] externals/auctex 3c8e583 08/34: Introduce new variable `LaTeX-global-package-files'
Date: Sun, 6 Jun 2021 11:40:01 -0400 (EDT)

branch: externals/auctex
commit 3c8e58307df2c5587a33b431c70f8bcf36f1e47b
Author: Arash Esbati <arash@gnu.org>
Commit: Arash Esbati <arash@gnu.org>

    Introduce new variable `LaTeX-global-package-files'
    
    * latex.el (LaTeX-global-package-files): New variable holding
    LaTeX package files.
    (LaTeX-arg-usepackage-read-packages-with-options): Set and use it
    instead of `TeX-global-input-files'.
    
    * tex.el (TeX-normal-mode): Reset also
    `LaTeX-global-package-files' when invoked with ARG.
    Silence the compiler.
---
 latex.el | 13 +++++++++----
 tex.el   |  2 ++
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/latex.el b/latex.el
index f9cfdeb..1f20960 100644
--- a/latex.el
+++ b/latex.el
@@ -2424,6 +2424,11 @@ To insert a hook here, you must insert it in the 
appropiate style file.")
 Initialized once at the first time you prompt for an input file.
 May be reset with `\\[universal-argument] \\[TeX-normal-mode]'.")
 
+(defvar LaTeX-global-package-files nil
+  "List of the LaTeX package files.
+Initialized once at the first time you prompt for a LaTeX package.
+May be reset with `\\[universal-argument] \\[TeX-normal-mode]'.")
+
 (defun LaTeX-arg-usepackage-read-packages-with-options ()
   "Read the packages and the options for the usepackage macro.
 
@@ -2433,18 +2438,18 @@ of the options, nil otherwise."
   (let* ((TeX-file-extensions '("sty"))
          (crm-separator ",")
          packages var options)
-    (unless TeX-global-input-files
+    (unless LaTeX-global-package-files
       (if (if (eq TeX-arg-input-file-search 'ask)
               (not (y-or-n-p "Find packages yourself? "))
             TeX-arg-input-file-search)
           (progn
             (message "Searching for LaTeX packages...")
-            (setq TeX-global-input-files
+            (setq LaTeX-global-package-files
                   (mapcar #'list (TeX-search-files-by-type
-                                 'texinputs 'global t t)))
+                                  'texinputs 'global t t)))
             (message "Searching for LaTeX packages...done"))))
     (setq packages (TeX-completing-read-multiple
-                    "Packages: " TeX-global-input-files))
+                    "Packages: " LaTeX-global-package-files))
     ;; Clean up hook before use in `LaTeX-arg-usepackage-insert'.
     (setq LaTeX-after-usepackage-hook nil)
     (mapc #'TeX-load-style packages)
diff --git a/tex.el b/tex.el
index 3b07c68..e9b8798 100644
--- a/tex.el
+++ b/tex.el
@@ -85,6 +85,7 @@
 (defvar BibTeX-global-style-files)
 (defvar LaTeX-default-verb-delimiter)
 (defvar LaTeX-global-class-files)
+(defvar LaTeX-global-package-files)
 (defvar LaTeX-optcl)
 (defvar LaTeX-optop)
 (defvar TeX-Biber-global-files)
@@ -5980,6 +5981,7 @@ With optional argument ARG, also reload the style hooks."
             TeX-Biber-global-files nil
             TeX-global-input-files nil
             LaTeX-global-class-files nil
+            LaTeX-global-package-files nil
             LaTeX-includegraphics-global-files nil))
   (let ((TeX-auto-save t))
     (if (buffer-modified-p)




reply via email to

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