In Spacemacs, how can I customize a variable used in a layer that's loaded lazily?
Specifically, I'm trying to use Zathura and Synctex with Spacemacs' Latex layer. I have the following code in my dotspacemacs/user-config
.
(with-eval-after-load "tex"
'(progn
(add-to-list 'TeX-view-program-list
'("Zathura"
("zathura "
(mode-io-correlate " --synctex-forward %n:0:%b -x \"emacsclient +%{line} %{input}\" ")
" %o")
"zathura"))
(add-to-list 'TeX-view-program-selection
'(output-pdf "Zathura"))
(TeX-PDF-mode 1)
))
My intent is to mutate the variables TeX-view-program-list
and TeX-view-program-selection
after the Latex layer is loaded since before that the variables are free, but this code doesn't seem to be working. Note that if I explicitly evaluate those two add-to-list
expressions after opening a .tex
file, they have their intended effect and Spacemacs defaults to viewing with Zathura.
Does anyone know if there's a canonical way to customize the variables used in the Emacs modes provided by Spacemacs layers?
M-x customize-variable RET TeX-view-program-list RET
. See Customization in the Emacs manual.