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

    Fix last commit
    
    * tex-buf.el (TeX-command-expand): Redefine the value of `file' just
    once per call of `TeX-command-expand'.  Previous code could give
    spurious quote when the given command string contains more than one
    "%" expanders tied with the symbol `file'.
---
 tex-buf.el | 29 +++++++++++------------------
 1 file changed, 11 insertions(+), 18 deletions(-)

diff --git a/tex-buf.el b/tex-buf.el
index 0849198..8b87c4c 100644
--- a/tex-buf.el
+++ b/tex-buf.el
@@ -554,6 +554,17 @@ without further expansion."
                             "%"))
                (or list (TeX-expand-list)))
          pat (regexp-opt (mapcar #'car list)))
+    ;; `TeX-command-expand' is called with `file' argument being one
+    ;; of `TeX-master-file', `TeX-region-file' and
+    ;; `TeX-active-master'.  The return value of these functions
+    ;; sometimes needs suitable "decorations" for an argument for
+    ;; underlying shell or latex executable, or both, when the
+    ;; relavant file name involves some special characters such as
+    ;; space and multibyte characters.  Hence embed that function in a
+    ;; template prepared for that purpose.
+    (setq file (apply-partially
+               #'TeX--master-or-region-file-with-extra-quotes
+               file))
     (while (setq pos (string-match pat command pos))
       (setq string (match-string 0 command)
            entry (assoc string list)
@@ -570,24 +581,6 @@ without further expansion."
                                 (functionp expansion))
                            (apply expansion arguments))
                           ((boundp expansion)
-                           (if (eq expansion 'file)
-                               ;; `TeX-command-expand' is called with
-                               ;; `file' argument being one of
-                               ;; `TeX-master-file',
-                               ;; `TeX-region-file' and
-                               ;; `TeX-active-master'.  The return
-                               ;; value of these functions sometimes
-                               ;; needs suitable "decorations" for an
-                               ;; argument for underlying shell or
-                               ;; latex executable, or both, when the
-                               ;; relavant file name involves some
-                               ;; special characters such as space
-                               ;; and multibyte characters.  Hence
-                               ;; embed that function in a template
-                               ;; prepared for that purpose.
-                               (setq file (apply-partially
-                                           
#'TeX--master-or-region-file-with-extra-quotes
-                                           file)))
                             (setq expansion-res
                                   (apply (symbol-value expansion) arguments))
                             (when (eq expansion 'file)

_______________________________________________
auctex-diffs mailing list
auctex-di...@gnu.org
https://lists.gnu.org/mailman/listinfo/auctex-diffs

Reply via email to