|
From: | Joost Kremers |
Subject: | Re: [AUCTeX] How to modify TeX-view-program-selection |
Date: | Thu, 13 Sep 2018 15:41:26 +0200 |
User-agent: | mu4e 1.1.0; emacs 26.1.50 |
On Thu, Sep 13 2018, David Kastrup wrote:
Joost Kremers <address@hidden> writes:On Thu, Sep 13 2018, Greg Bognar wrote:(add-hook 'LaTeX-mode-hook '(lambda ()(add-to-list 'TeX-view-program-selection '((output-pdf "zathura"))) ))There's no need to do this in LaTeX-mode-hook, it should be enough to have (add-to-list 'TeX-view-program-selection '((output-pdf "Zathura")))in your init file.Ah, but that depends on TeX-view-program-selection already beingdefined. You'd have to put this into an eval-after-load incantation orsimilar for this to work reliably.
My apologies, you are of course right. I do this sort of stuff in a use-package declaration in the :config section, which is executed after the package is loaded, so I tend to forget about eval-after-load.
Doing it in LaTeX-mode-hook means it's executed each time you open aLaTeX file, which is harmless but unnecessary.But the usual way to do such stuff.
Really? I mean, true, I see it a lot in (mostly older) config snippets Google spits up, but I thought it was generally discouraged to use a hook if there's no need for it, because it's not always as harmless as this example. (In fact, I've run into problems with it myself from time to time.)
-- Joost Kremers Life has its moments
[Prev in Thread] | Current Thread | [Next in Thread] |