[Top][All Lists]

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

[elpa] externals/auctex 31ee142 38/48: Fix regression of `TeX-view'

From: Tassilo Horn
Subject: [elpa] externals/auctex 31ee142 38/48: Fix regression of `TeX-view'
Date: Sun, 16 Sep 2018 01:47:26 -0400 (EDT)

branch: externals/auctex
commit 31ee142567534235f0e8b354fb23d5f4244b4770
Author: Ikumi Keita <address@hidden>
Commit: Ikumi Keita <address@hidden>

    Fix regression of `TeX-view'
    * tex-buf.el (TeX-active-master): Add dummy argument for
    compatibility.  In `TeX-view', `TeX-commmand' is called with
    `TeX-active-master', so the `file' argument is `TeX-active-master'
    in subsequent call of `TeX-command-expand'.  In that case,
    `TeX--master-or-region-file-with-extra-quotes' calls
    `TeX-active-master' with three arguments.
    (TeX--master-or-region-file-with-extra-quotes): Adapt doc string.
    * tex.el (TeX-expand-list-builtin): Adapt comment.
    * tests/tex/command-expansion.el (TeX-command-expand-active-master):
    New test.
 tests/tex/command-expansion.el | 13 +++++++++++++
 tex-buf.el                     | 24 ++++++++++++++++--------
 tex.el                         |  2 +-
 3 files changed, 30 insertions(+), 9 deletions(-)

diff --git a/tests/tex/command-expansion.el b/tests/tex/command-expansion.el
index 14e425d..dd1f09b 100644
--- a/tests/tex/command-expansion.el
+++ b/tests/tex/command-expansion.el
@@ -126,4 +126,17 @@ See 
     ;;              (TeX-master-file "pdf" t)))
+(ert-deftest TeX-command-expand-active-master ()
+  "Test whether `TeX-active-master' is valid argument for 
+  (let ((TeX-master "abc")
+       TeX-current-process-region-p)
+    (setq TeX-current-process-region-p nil)
+    (should (string=
+            (TeX-command-expand "%s" #'TeX-active-master)
+            TeX-master))
+    (setq TeX-current-process-region-p t)
+    (should (string=
+            (TeX-command-expand "%s" #'TeX-active-master)
+            TeX-region))))
 ;;; command-expansion.el ends here
diff --git a/tex-buf.el b/tex-buf.el
index 49f9645..cc35938 100644
--- a/tex-buf.el
+++ b/tex-buf.el
@@ -584,12 +584,12 @@ without further expansion."
 (defun TeX--master-or-region-file-with-extra-quotes
     (&optional extension nondirectory ask extra)
   "Return file name with quote for shell.
-Wrapper for `TeX-master-file' or `TeX-region-file' to be used in
-It is assumed that `orig-file' has dynamic binding of the value of
-`TeX-master-file' or `TeX-region-file'.  Pass EXTENSION, NONDIRECTORY
-and ASK to that function as-is, and arrange the returned file name for
-use with command shell.
+Wrapper for `TeX-master-file', `TeX-region-file' or
+`TeX-active-master' to be used in `TeX-command-expand'.
+It is assumed that `orig-file' has dynamic binding of the value
+of `TeX-master-file', `TeX-region-file' or `TeX-active-master'.
+Pass EXTENSION, NONDIRECTORY and ASK to that function as-is, and
+arrange the returned file name for use with command shell.
 Enclose the file name with space within quotes `\"' first when
 \" \\input\" is supplemented (indicated by dynamically binded
 variable `TeX-command-text' having string value.)
@@ -2024,14 +2024,22 @@ command."
        (with-current-buffer TeX-command-buffer
         (TeX-process-buffer (TeX-active-master)))))
-(defun TeX-active-master (&optional extension nondirectory)
+(defun TeX-active-master (&optional extension nondirectory _ignore)
   "The master file currently being compiled.
 If optional argument EXTENSION is non-nil, add that file extension to
 the name.  Special value t means use `TeX-default-extension'.
 If optional second argument NONDIRECTORY is non-nil, do not include
-the directory."
+the directory.
+The compatibility argument IGNORE is ignored."
+  ;; The third argument `_ignore' is kept for symmetry with
+  ;; `TeX-master-file's third argument `ask'.  For example, it's used
+  ;; in `TeX--master-or-region-file-with-extra-quotes', where we don't
+  ;; know which function has to be called.  Keep this in mind should
+  ;; you want to use another argument here.
+  ;; See also the similar comment in `TeX-region-file'.
   (if TeX-current-process-region-p
       (TeX-region-file extension nondirectory)
     (TeX-master-file extension nondirectory)))
diff --git a/tex.el b/tex.el
index 68a7942..9995af3 100644
--- a/tex.el
+++ b/tex.el
@@ -495,7 +495,7 @@ string."
                    (or (if TeX-source-correlate-output-page-function
                            (funcall TeX-source-correlate-output-page-function))
-    ;; `file' means to call `TeX-master-file' or `TeX-region-file'
+    ;; `file' means to call `TeX-master-file', `TeX-region-file' or 
     ("%s" file nil t)
     ("%t" file t t)
     ;; If any TeX codes appear in the interval between %` and %', move

reply via email to

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