auctex-devel
[Top][All Lists]
Advanced

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

Re: Output to directory patch


From: Al Haji-Ali
Subject: Re: Output to directory patch
Date: Sun, 07 Mar 2021 18:50:08 +0000
User-agent: mu4e 1.5.8; emacs 27.1

Hi Ikumi,

On 07/03/2021, Ikumi Keita wrote:
>> I just pushed a new version of the patch to my public repo (rebased to
>> master) https://github.com/haji-ali/auctex
>
> I encountered other problems, even when `TeX-output-dir' is nil:

Thank you again for taking the time and teasing out these issues. I am 
dog-fooding this patch but I never thought of setting TeX-master to nil (I 
actually just learned it's a valid value in AUCTeX) and I don't usually open 
compressed files.

> Obviously the remaining cross dependency between `TeX-master-file' and
> `TeX-master-output-dir' is the origin of these troubles. I recommend to
> restrict call on `TeX-master-output-dir' in `TeX-master-file' within
> cases that the extension matches output files.
> Or it would be much nice if it is possible to remove the cross
> dependency completely. Isn't it possible to implement
> `TeX-master-output-dir' without calling `TeX-master-file' at all?
The inter-dependency between `TeX-master-output-dir' and `TeX-master-file` is 
not real, as you previously pointed out. Since `TeX-master-file` calls 
`TeX-master-output-dir' with a non-nil second argument and TeX-master-file in 
then never called inside `TeX-master-output-dir'. I only kept the call to 
TeX-master-file inside `TeX-master-output-dir' so that when the function is 
called from other functions one does not have to provide the master file as an 
argument and it is obtained from TeX-master-file.

The reason `TeX-master-output-dir' needs the name of master file (and the 
buffer of the master file) is because the value of TeX-output-dir should be 
obtained from that file and not from other sub-files. The issue previously is 
that when TeX-master was nil, TeX-master-file returned "<none>.tex" and I 
didn't account for this case. Similar wrong behaviour occurs when the returned 
master file does not exist (like in the case of the compressed file). In any 
case, I fixed this by checking that the file exists before opening it. I also 
changed the behaviour so that such checks are only done when the extension is 
an output extension as you suggested. Please find a patch to the 
`tex-build-only` branch attached. If you think the changes are reasonable, I 
will push them to my local repo so that Tassilo can pull them.

>
>> BTW, I added a note in `TeX-command-default` where the filename `name`
>> is compared to the output of `TeX-region-file` to determine if the
>> file comes from TeX-region-file or TeX-master-file. This is another
>> reason why I believe passing file-fn to TeX-command-default is more
>> appropriate.
>
> Agreed. The current (unmodified) implementation is ugly, IMHO.
>
I am happy to change it to a comparison based on the `file-fn` argument 
instead, if there's no better solution.

> It seems a bit redundant for me. As discussed previously, the
> "--output-directory" feature would have a limited scope of application
> because it can't handle \include on sub directories. Users who enable
> `TeX-output-dir' option should regard it as an auxiliary tool valid for
> only simple cases in the first place.
I see your point.
My intention is to increase the number of cases in which `--output-directory` 
works, if such improvement is not difficult.
In any case, if changing environment variables in AUCTeX is not desirable, then 
maybe we can just mention in the eventual documentation of TeX-output-dir that 
adding the output directory to `TEXINPUTS` and `BIBINPUTS` might be needed in 
some cases (I personally do this in my private configuration).

Best regards,
-- Al

Attachment: tex-build-only-fix.patch
Description: Text Data


reply via email to

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