auctex-diffs
[Top][All Lists]
Advanced

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

[AUCTeX-diffs] GNU AUCTeX branch, master, updated. 31ee142567534235f0e8b


From: Ikumi Keita
Subject: [AUCTeX-diffs] GNU AUCTeX branch, master, updated. 31ee142567534235f0e8b354fb23d5f4244b4770
Date: Mon, 9 Jul 2018 05:53:18 -0400 (EDT)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU AUCTeX".

The branch, master has been updated
       via  31ee142567534235f0e8b354fb23d5f4244b4770 (commit)
      from  8d30dc1db0a1ea626ee97681ed44649d6e2dabd4 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 31ee142567534235f0e8b354fb23d5f4244b4770
Author: Ikumi Keita <address@hidden>
Date:   Mon Jul 9 18:51:02 2018 +0900

    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.

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 
<https://lists.gnu.org/r/bug-auctex/2014-08/msg00012.html>."
     ;;              (TeX-master-file "pdf" t)))
     ))
 
+(ert-deftest TeX-command-expand-active-master ()
+  "Test whether `TeX-active-master' is valid argument for 
`TeX-command-expand'."
+  (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
-`TeX-command-expand'.
-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))
                        "1")))
-    ;; `file' means to call `TeX-master-file' or `TeX-region-file'
+    ;; `file' means to call `TeX-master-file', `TeX-region-file' or 
`TeX-active-master'
     ("%s" file nil t)
     ("%t" file t t)
     ;; If any TeX codes appear in the interval between %` and %', move

-----------------------------------------------------------------------

Summary of changes:
 tests/tex/command-expansion.el | 13 +++++++++++++
 tex-buf.el                     | 24 ++++++++++++++++--------
 tex.el                         |  2 +-
 3 files changed, 30 insertions(+), 9 deletions(-)


hooks/post-receive
-- 
GNU AUCTeX



reply via email to

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