>>> "AH" == Al Haji-Ali <[email protected]> writes:
> On 03/02/2021, Uwe Brauer wrote: >>> I have my setup like this >> >>> (setq TeX-output-dir "build" >>> TeX-region "build/_region_") >> >> Ah of course, I still sticked to the local buffer setting for testing. >> This is much better, because I realised that I almost entirely will use >> a build directory. >> > I have this in a hook, so it is still set locally. I am not sure I understand, if you put it say in the LaTeX-mode-hook, every time you open latex file this variable is set, so for all practical purpose it is global. Another point is that I thought one should avoid putting to much stuff in hooks because it slows down things. At least Carste Dominik claimed this in is cdlatex pkg comparing it with auctex. > If you want to > include this in your emacs init to use a build directory by default > for all buffers be sure to use setq-default instead of setq. I am also not sure I see why I should use setq-default in this case. I thought I can use it say for abbrev >> BTW your function copy-tex-output is also very useful for me, maybe it >> should be included as well? > Yes, it probably should be included as well, perhaps as a command > that can invoked from TeX-command-master. Although it is easy > enough for users to include it in their config. I didn't want to > make too many changes to AUCTeX before the one I have are > finalized/approved. Ok > For the benefit of others, below are two functions to copy the > output file to other directories (defaults to directory of the > master file) and to attach the output file to an email > (defun TeX-copy-output () > (interactive) > (let* ((default (expand-file-name (TeX-active-master nil))) > (default-dir (file-name-directory default)) > (default-file (concat (file-name-nondirectory default) "." > (TeX-output-extension))) > (outputfile (expand-file-name (TeX-active-master > (TeX-output-extension)))) > (filename (read-file-name "Save as:" default-dir > default-file nil default-file))) > (copy-file outputfile filename t))) > (defun TeX-attach-output () > (interactive) > (require 'gnus-dired) > (gnus-dired-attach (list (expand-file-name (TeX-active-master > (TeX-output-extension)))))) I use both > One could also add the following hook so that only the (pdf or dvi) > output file is automatically copied to the master directory after > compilation: > (add-hook 'TeX-after-compilation-finished-functions > (lambda (file) > (let ((output (expand-file-name file)) > (copy (expand-file-name (concat > (with-current-buffer > TeX-command-buffer > (TeX-active-master nil)) > "." (TeX-output-extension))))) > (when (and (not (string= output copy)) (file-exists-p output)) > (copy-file output copy t))))) > I don't use this last hook since it defeats the purpose of the > output-directory patch for me, but some people might find it > useful. Right, Regards Uwe
smime.p7s
Description: S/MIME cryptographic signature
