On 03/02/2021, Uwe Brauer wrote: > 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.
Yes, that would work in practice. Setting a single variable in a hook won't be noticeable, so I wouldn't worry about the performance hit. >> 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 > The new variable `TeX-build-dir` is a buffer-local variable. When a new buffer is created, the default value of `TeX-build-dir` is nil, unless you change the default value (after loading auctex) using `setq-default`. To be clear, you can either set `TeX-build-dir` in a hook like `LaTeX-mode-hook` or in your init file using `setq-default`. What would not work is setting `TeX-build-dir` using `setq` in your init file. Best regards, -- Al
