[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: |
Fri, 05 Feb 2021 15:29:45 +0000 |
User-agent: |
mu4e 1.5.8; emacs 27.1 |
> I am a big fan of Al's patch and the functionality it provides (I am
> currently not using preview latex much, sorry David and think that
> subfiles has overtaken include (input is a another thing)).
Thank you Uwe.
An updated patch (against 6db8a1a3) is here
https://raw.githubusercontent.com/haji-ali/auctex/tex-build/etc/auctex-output-dir.patch
This should hopefully fix the issue that was pointed out by Ikumi regarding the
default command and C-c C-a. I also made sure to make `TeX-output-dir` local so
that it can be controlled buffer-wise, so make sure to use setq-default instead
of setq if you are changing this in your Emacs init file.
I would appreciate any feedback or input on my implementation of the fix, below:
The main problem that I ran against is that the function `TeX-command` accepts
an argument `file-fn` which points to the function (usually TeX-master-file or
TeX-region-file) that is supposed to return the filename. However, TeX-command
then calls other functions like TeX-run-command with the *result* of this
function without actually passing the function. This is problematic because
these commands then infer filenames by appending extensions (like "pdf" or
"idx"), instead of using the original function with this extension as I think
they should (particularly for getting my patch to work).
I am guessing that changing the arguments of these functions would be
problematic because it would break existing user code. So I resolved this by
introducing a new variable `TeX-command-file-function` which contains the value
of file-fn when TeX-command is called. This is similar to
TeX-command-sequence-file-function but I wasn't sure if I can use that variable
instead of defining a new one.
I also changed TeX-save-document to accept a file-function (as well as a
string) as argument. If the argument is a file-function then the function is
called to get the filename. Finally, I defined a new function called
TeX-get-command-filename which gets the filename from
`TeX-command-file-function` or the argument if these are callable, otherwise it
simply returns the argument (possibly with an extension).
Let me know if the patch works for you and if the implementation is agreeable.
The remaining issues are in preview-latex which I will get to once the core
functionality is implemented correctly.
Best regards,
-- Al
Re: Output to directory patch, Ikumi Keita, 2021/02/04
- Re: Output to directory patch, Al Haji-Ali, 2021/02/04
- Re: Output to directory patch, Ikumi Keita, 2021/02/04
- Re: Output to directory patch, Al Haji-Ali, 2021/02/04
- Re: Output to directory patch, Ikumi Keita, 2021/02/05
- Re: Output to directory patch, Al Haji-Ali, 2021/02/05
- Re: Output to directory patch, Uwe Brauer, 2021/02/05
- Re: Output to directory patch,
Al Haji-Ali <=
- Re: Output to directory patch, Ikumi Keita, 2021/02/07
- Re: Output to directory patch, Al Haji-Ali, 2021/02/14
- Re: Output to directory patch, Mosè Giordano, 2021/02/14
- Re: Output to directory patch, Uwe Brauer, 2021/02/15
- Re: Output to directory patch, Al Haji-Ali, 2021/02/15
- Re: Output to directory patch, Ikumi Keita, 2021/02/15
- Re: Output to directory patch, Uwe Brauer, 2021/02/15
- Re: Output to directory patch, Ikumi Keita, 2021/02/22
- Re: Output to directory patch, Al Haji-Ali, 2021/02/22
- Re: Output to directory patch, Ikumi Keita, 2021/02/23