[Top][All Lists]

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

Re: Output filenames and the inconsistency of the `file` variable

From: Al Haji-Ali
Subject: Re: Output filenames and the inconsistency of the `file` variable
Date: Wed, 26 Aug 2020 16:51:26 +0100
User-agent: mu4e 1.5.5; emacs 27.1

Hi Ikumi,

> TeX-active-master just calls TeX-master-file or TeX-region-file
> depending on the value of TeX-current-process-region-p, which is set
> early stage in TeX-command. So TeX-active-master would usually be a
> drop-in replacement for TeX-master-file and TeX-region-file as long as
> it is called inside TeX-command.

Ah I see. Then I guess we can simply have this change.

diff --git a/tex.el b/tex.el
index 9a1d1b6d..9a9e574f 100644
--- a/tex.el
+++ b/tex.el
@@ -1165,7 +1165,7 @@ entry in `TeX-view-program-list-builtin'."
                                 (get-file-buffer (TeX-region-file t)))
-    (let ((pdf (concat file "." (TeX-output-extension))))
+    (let ((pdf (TeX-active-master (TeX-output-extension))))
       (pop-to-buffer (or (find-buffer-visiting pdf)
                         (find-file-noselect pdf))))))

@@ -1189,7 +1189,7 @@ viewer."
   (require 'url-util)
   (let* ((uri (concat "file://" (url-encode-url
-                                 (concat file "." (TeX-output-extension))))))
+                                 (TeX-active-master (TeX-output-extension))))))
         (owner (dbus-call-method
                 :session (format "org.%s.%s.Daemon" de app)
                 (format "/org/%s/%s/Daemon" de app)

Another change that I want to suggest (for the same reason) is the following in 

diff --git a/tex-buf.el b/tex-buf.el
index ff6be7e6..62913f86 100644
--- a/tex-buf.el
+++ b/tex-buf.el
@@ -82,7 +82,7 @@ Return non-nil if document needs to be re-TeX'ed."
   (if (string-equal name "")
       (setq name (TeX-master-file)))

-  (TeX-check-files (concat name "." (TeX-output-extension))
+  (TeX-check-files (TeX-active-master (TeX-output-extension))
                   (cons name (TeX-style-list))

@@ -826,7 +826,7 @@ omitted) and `TeX-region-file'."
           ;; comparison.
           (if (string-equal (expand-file-name name)
                             (expand-file-name (TeX-region-file)))
-              (TeX-check-files (concat name "." (TeX-output-extension))
+              (TeX-check-files (TeX-active-master (TeX-output-extension))
                                ;; Each original will be checked for all dirs
                                ;; in `TeX-check-path' so this needs to be just
                                ;; a filename without directory.

To construct the output file name using `TeX-active-master` rather 
concatenating strings. I am less sure about this change because it changes the 
behavior of user functions (`TeX-save-document` and `TeX-command-default`), but 
I don't know if such a change would break anything or what is a better way to 
handle this. Any feedback is much appreciated.

Also, if these changes are acceptable, should I create a pull request with them 
on the gitlab AUCTeX repository? Or is posting the diffs here sufficient?

Best regards,
-- Al

reply via email to

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