I have bound
TeX-command to a key
f7 to compile my document with
latexmk. When I press it, and it needs to be compiled, it compiles it without asking. If not, views it, without asking (that's because of the -1 option):
(global-set-key (kbd "<f7>") 'my-run-latex) (defun my-run-latex () (interactive) (if (equal current-buffer-hash (setq current-buffer-hash (secure-hash 'md5 (current-buffer)))) (TeX-view) (setq TeX-save-query nil) (TeX-save-document (TeX-master-file)) (TeX-command "Latexmk" 'TeX-master-file -1)))
Now this applies to the tex master file. How can I make it apply to the file in the current buffer?
Note that I also want to have this command bound to another key for compiling the master file. So it wouldn't be a solution to set the current buffer as master file.
I tried to replace
(TeX-command "Latexmk" 'TeX-master-file -1) by
(TeX-command-buffer "Latexmk") which works but doesn't compile without asking. Then I tried to replace it with
(TeX-command "Latexmk" 'TeX-master-file -1) with returns an error message "Wrong number of arguments buffer-file-name, 2".