auctex-devel
[Top][All Lists]
Advanced

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

Output to directory patch


From: Al Haji-Ali
Subject: Output to directory patch
Date: Wed, 03 Feb 2021 10:32:28 +0000
User-agent: mu4e 1.5.8; emacs 27.1

Hello,

I've had some time to work on this patch (which outputs the tex output files to 
a directory). The attached is against the latest commit 6db8a1a373.
I am not sure if there's still interest in incorporating this patch, but I have 
been using this setup for quite some time and I am very pleased by it. Uwe 
Brauer also helped me debug the patch and found a couple of issues that I fixed.

Currently, I am wondering if I can get some input from the community on some 
implementation aspects.

Here are the things I changed:
- The buffer-local variable `TeX-output-dir` which contains the output 
directory. This is only relevant in the buffer of the master file.

- The way that the output directory is prepended to an output file in 
`TeX-master-file` is by checking if the extension is in the "clean" list that 
`TeX-clean` would normally delete.
This required some refactoring of `TeX-clean` and introducing a function 
`TeX--clean-extensions-regexp`. I also implemented a function 
`TeX-master-output-file` which returns an output file by prepending the 
`TeX-output-dir` (if non-nil).

- I defined several expansion macros including
    -- `%(output-dir)"` which expands to `--output-directory=DIR` and is used 
for TeX and Biber
    -- `%(O?aux)` returning the aux output file, used for `makeglossaries`.
    -- `%(O?idx)` returning the idx output file, used for `makeindex`.
    -- `%(O?pdf)` returning a pdf output file, used for `Ps2pdf` and `Dvipdfmx`.

- I changed the command list to use the previously defined macros.

- The output files of region are not moved into the output directory. It is not 
clear to me what the correct behaviour here would be. My opinion is that 
`TeX-region` should control both the place of `_region_.tex` and its output 
files. This is not currently supported in AUCTeX but is implemented in this 
patch through the `%(output-dir)` expansion.

Here are the points I am unsure of:
- In tex-buf.el, there are several calls  which append outputs extensions 
("(TeX-output-extension)", ".ind", ".idx" and ".bbl") to an argument `name` or 
similar to get a filename. These should be changed to use TeX-active-master or 
similar instead but I am unsure of the implications or how to do this without 
breaking previous behaviour.

- There is the question of creating the output directory if it doesn't exists. 
Some commands (including TeX) assume that the directory exists. Currently I am 
creating the directory in `TeX-run-TeX` by calling `TeX--ensure-output-dir`.

- There are several commands that might need changing to account for the 
output-directory (or could use it). I don't use these tools nor know their 
particularities, so I am hoping someone who does can give me guidance. These 
include
   -- Makeinfo
   -- AmSTeX
   -- ConTeXt
   -- upmendex

- Known issue: The directory in `TeX-output-dir` cannot be hidden (or start 
with `.`). This is a limitation by the tex suite for security reasons.

Any input on this is welcome. I would be happy if this is to be included in 
AUCTeX (I already signed the FSF agreement).

Best regards,
-- Al

Attachment: auctex-output-dir.patch
Description: Text Data


reply via email to

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