[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: dwim as the value of TeX-master
From: |
Tassilo Horn |
Subject: |
Re: dwim as the value of TeX-master |
Date: |
Sat, 10 Jul 2021 09:59:22 +0200 |
User-agent: |
mu4e 1.5.13; emacs 28.0.50 |
Hongyi Zhao <hongyi.zhao@gmail.com> writes:
>> > If the variable is dwim, AUCTeX will try to avoid querying by
>> > attempting to “do what I mean”; and then change the file.
>> >
>> > But I'm still not so clear on the specific mechanism/algorithm
>> > denoted by “do what I mean”.
>>
>> AUCTeX will look at the TeX-master values in all buffers whose file
>> reside in the same directory as the current one
>
> What will happen if the non-master files reside in sub-folders of the
> master file's directory?
It will work as long as you have some open sub-file buffer and then
start another sub-file in the same directory. If not, you'll be queried
for the master file.
>> and use the first TeX-master value which is a string (and so denotes
>> the path to the master file). That's based on the assumption that
>> one usually has a layout like
>>
>> main.tex # The master file where TeX-master is t which includes
>> # the individual chapter files.
>> chapter1.tex # TeX-master is "main.tex"
>> chapter2.tex # TeX-master is "main.tex"
>>
>
> This seems cumbersome due to I must set TeX-master for each of them.
I don't agree. I mean, how often do you start another sub-file without
having another sub-file open already? And you do it at most once for
any sub-file because the value is saved in a local variables section.
>> So when you now create a new chapter3.tex, it will most probably also
>> want to have TeX-master set to "main.tex".
>>
>> Obviously, this dwim method can do wrong guesses when you have
>> multiple multi-file documents in the same directory and work on
>> several of them at once.
>
> Maybe a more intelligent algorithm should be developed.
Feel free to state your ideas but the current, simple algorithm has
served us quite well so far.
Bye,
Tassilo