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. 097ec6cb85b16479e8e45


From: Ikumi Keita
Subject: [AUCTeX-diffs] GNU AUCTeX branch, master, updated. 097ec6cb85b16479e8e4512142cec1fdb3cd5f36
Date: Tue, 3 Aug 2021 09:35:37 -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  097ec6cb85b16479e8e4512142cec1fdb3cd5f36 (commit)
      from  41610c721c90b9e466e660b98de968519e78a9b4 (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 097ec6cb85b16479e8e4512142cec1fdb3cd5f36
Author: Ikumi Keita <ikumi@ikumi.que.jp>
Date:   Tue Aug 3 22:29:01 2021 +0900

    Avoid superfluous output directories
    
    * tex.el (TeX--master-output-dir): Add new optional argument ENSURE so
    that it doesn't make output dir when `TeX-region-file' is called from
    `TeX-set-mode-name', which can be called from
    `TeX-source-correlate-mode' in major mode function.
    (TeX--output-dir-arg): Feed t for the above new argument ENSURE.

diff --git a/tex.el b/tex.el
index df467de..46d6bbc 100644
--- a/tex.el
+++ b/tex.el
@@ -2545,13 +2545,14 @@ is assumed to be the same as the directory of 
`TeX-master'."
                  (string :tag "Custom" "build")))
 (make-variable-buffer-local 'TeX-output-dir)
 
-(defun TeX--master-output-dir (master-dir relative-to-master)
+(defun TeX--master-output-dir (master-dir relative-to-master &optional ensure)
   "Return the directory path where output files should be placed.
 If `TeX-output-dir' is nil, then return nil.
 
 MASTER-DIR is the directory path where the master file is
 located.  If RELATIVE-TO-MASTER is non-nil, make the returned
-path relative to the directory in MASTER-DIR."
+path relative to the directory in MASTER-DIR.  If ENSURE is
+non-nil, the output directory is created if it does not exist."
   (when TeX-output-dir
     (let* ((master-dir (expand-file-name (or master-dir "")))
            (out-dir (file-name-as-directory
@@ -2561,7 +2562,7 @@ path relative to the directory in MASTER-DIR."
                         TeX-output-dir
                         master-dir))))))
       ;; Make sure the directory exists
-      (unless (file-exists-p out-dir)
+      (unless (or (not ensure) (file-exists-p out-dir))
         (make-directory (file-name-as-directory out-dir) t))
       (if relative-to-master
           (file-relative-name out-dir master-dir)
@@ -2571,7 +2572,7 @@ path relative to the directory in MASTER-DIR."
   "Format the output directory as a command argument.
 ARGNAME is prepended to the quoted output directory.  If
 `TeX-output-dir' is nil then return an empty string."
-  (let ((out-dir (TeX--master-output-dir (TeX-master-directory) t)))
+  (let ((out-dir (TeX--master-output-dir (TeX-master-directory) t t)))
     (if out-dir
         (concat argname "\"" out-dir "\"")
       "")))

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

Summary of changes:
 tex.el | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
GNU AUCTeX



reply via email to

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