auctex-diffs
[Top][All Lists]
Advanced

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

[AUCTeX-diffs] [elpa] externals/auctex 8951549 04/62: ; Trivial cleanups


From: Tassilo Horn
Subject: [AUCTeX-diffs] [elpa] externals/auctex 8951549 04/62: ; Trivial cleanups
Date: Sun, 20 Dec 2020 10:39:50 -0500 (EST)

branch: externals/auctex
commit 89515499379810aa6f89afb78d6bc128e62c9944
Author: Ikumi Keita <ikumi@ikumi.que.jp>
Commit: Tassilo Horn <tsdh@gnu.org>

    ; Trivial cleanups
    
    * tex-buf.el (TeX-command-expand): Omit one `let'.
    (TeX--master-or-region-file-with-extra-quotes): Omit spurious `funcall'.
    Add descriptions about arguments in doc-string.
    * tex.el (declare-function): Fix arglist for updated
    `TeX-command-expand'.
---
 tex-buf.el | 63 +++++++++++++++++++++++++++++++-------------------------------
 tex.el     |  2 +-
 2 files changed, 32 insertions(+), 33 deletions(-)

diff --git a/tex-buf.el b/tex-buf.el
index b9d9085..134bf36 100644
--- a/tex-buf.el
+++ b/tex-buf.el
@@ -550,48 +550,47 @@ without further expansion."
                             "%"))
                (or list (TeX-expand-list)))
          pat (regexp-opt (mapcar #'car list)))
-    (let ((file-fn #'TeX--master-or-region-file-with-extra-quotes))
-      (while (setq TeX-expand-pos (string-match pat TeX-expand-command 
TeX-expand-pos))
-        (setq string (match-string 0 TeX-expand-command)
-             entry (assoc string list)
-             expansion (car (cdr entry)) ;Second element
-             arguments (cdr (cdr entry)) ;Remaining elements
-             string (save-match-data
-                      (cond
-                        ((memq expansion (list 'TeX-active-master
-                                               #'TeX-active-master))
-                         (let ((res (apply file-fn arguments)))
-                           ;; Advance past the file name in order to
-                           ;; prevent expanding any substring of it.
-                           (setq TeX-expand-pos
-                                 (+ TeX-expand-pos (length res)))
-                           res))
-                        ((functionp expansion)
-                         (apply expansion arguments))
-                       ((boundp expansion)
-                         (apply (symbol-value expansion) arguments))
-                       (t
-                        (error "Nonexpansion %s" expansion)))))
-        (if (stringp string)
-           (setq TeX-expand-command
-                 (replace-match string t t TeX-expand-command))))
-      TeX-expand-command)))
+    (while (setq TeX-expand-pos (string-match pat TeX-expand-command 
TeX-expand-pos))
+      (setq string (match-string 0 TeX-expand-command)
+           entry (assoc string list)
+           expansion (car (cdr entry)) ;Second element
+           arguments (cdr (cdr entry)) ;Remaining elements
+           string (save-match-data
+                    (cond
+                      ((eq expansion #'TeX-active-master)
+                       (let ((res (apply 
#'TeX--master-or-region-file-with-extra-quotes arguments)))
+                         ;; Advance past the file name in order to
+                         ;; prevent expanding any substring of it.
+                         (setq TeX-expand-pos
+                               (+ TeX-expand-pos (length res)))
+                         res))
+                      ((functionp expansion)
+                       (apply expansion arguments))
+                     ((boundp expansion)
+                       (apply (symbol-value expansion) arguments))
+                     (t
+                      (error "Nonexpansion %s" expansion)))))
+      (if (stringp string)
+         (setq TeX-expand-command
+               (replace-match string t t TeX-expand-command))))
+    TeX-expand-command))
 
 (defun TeX--master-or-region-file-with-extra-quotes
     (&optional extension nondirectory ask extra)
   "Return the current master or region file name with quote for shell.
-I.e. it encloses the file name with space within quotes `\"'
-first when \" \\input\" is supplemented (indicated by dynamically
-binded variable `TeX-command-text' having string value.)  It also
-encloses the file name within \\detokenize{} when the following
-three conditions are met:
+Pass arguments EXTENSION NONDIRECTORY ASK to `TeX-active-master'.
+If the returned file name contains space, enclose it within
+quotes `\"' when \" \\input\" is supplemented (indicated by
+dynamically bound variable `TeX-command-text' having string
+value.) Also enclose the file name within \\detokenize{} when
+the following three conditions are met:
   1. compiling with standard (pdf)LaTeX or upLaTeX
   2. \" \\input\" is supplemented
   3. EXTRA is non-nil (default when expanding \"%T\")
 
 Helper function of `TeX-command-expand'."
   (shell-quote-argument
-   (let* ((raw (funcall #'TeX-active-master extension nondirectory ask))
+   (let* ((raw (TeX-active-master extension nondirectory ask))
          ;; String `TeX-command-text' means that the file name is
          ;; given through \input command.
          (quote-for-space (if (and (stringp TeX-command-text)
diff --git a/tex.el b/tex.el
index ce31831..efcb8e1 100644
--- a/tex.el
+++ b/tex.el
@@ -53,7 +53,7 @@
 (declare-function TeX-output-extension "tex-buf"
                  nil)
 (declare-function TeX-command-expand "tex-buf"
-                 (command file &optional list))
+                 (command &optional list))
 (declare-function TeX-active-master "tex-buf"
                  (&optional extension nondirectory ignore))
 (declare-function TeX-pop-to-buffer "tex-buf"



reply via email to

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