[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"
- [AUCTeX-diffs] [elpa] externals/auctex updated (a18be78 -> b41e063), Tassilo Horn, 2020/12/20
- [AUCTeX-diffs] [elpa] externals/auctex 9656d30 21/62: Fix insertion of unnecessary backslash, Tassilo Horn, 2020/12/20
- [AUCTeX-diffs] [elpa] externals/auctex f7c0c73 01/62: Enable lexical-binding for AUCTeX core files, Tassilo Horn, 2020/12/20
- [AUCTeX-diffs] [elpa] externals/auctex 8951549 04/62: ; Trivial cleanups,
Tassilo Horn <=
- [AUCTeX-diffs] [elpa] externals/auctex 2e196d2 07/62: ; Silence the compiler, Tassilo Horn, 2020/12/20
- [AUCTeX-diffs] [elpa] externals/auctex 717e5f0 06/62: Simplify nested `let's, Tassilo Horn, 2020/12/20
- [AUCTeX-diffs] [elpa] externals/auctex 96c945a 11/62: Remove `TeX-arg-none', Tassilo Horn, 2020/12/20
- [AUCTeX-diffs] [elpa] externals/auctex c3b76ca 18/62: * tex-ispell.el: Enable lexical-binding., Tassilo Horn, 2020/12/20
- [AUCTeX-diffs] [elpa] externals/auctex 42f061a 17/62: Improve style/amsthm.el, Tassilo Horn, 2020/12/20
- [AUCTeX-diffs] [elpa] externals/auctex 00b2d73 12/62: Add missing argument to function body, Tassilo Horn, 2020/12/20
- [AUCTeX-diffs] [elpa] externals/auctex 19cdfe0 22/62: Put point after the graphic file argrument, Tassilo Horn, 2020/12/20
- [AUCTeX-diffs] [elpa] externals/auctex dabe30c 02/62: Arrange test condition, Tassilo Horn, 2020/12/20
- [AUCTeX-diffs] [elpa] externals/auctex 9d0ccc1 13/62: Update style/fancyvrb.el to package version 3.6, Tassilo Horn, 2020/12/20
- [AUCTeX-diffs] [elpa] externals/auctex 5bffc24 24/62: ; * font-latex.el (font-latex-update-math-env): Fix docstring., Tassilo Horn, 2020/12/20