myhome/.emacs.d/plugins/latexmk-mode.el
Marcin Woźniak b82dc58f26
Added programs
Signed-off-by: Marcin Woźniak <y0rune@aol.com>
2021-03-22 21:27:54 +01:00

28 lines
579 B
EmacsLisp

;;; latexmk-mode.el --- LatexMK minor mode
;;; Commentary:
;;; none
;;; Code:
(define-minor-mode latexmk-mode
"Toggle LatexMK mode."
:init-value nil
:lighter " LatexMK "
)
(defun my/run-latexmk ()
(interactive)
(start-process "latexmk" "latexmk out" "latexmk" "--silent" "--pdf" (buffer-file-name (current-buffer)))
)
(defun my/try-run-latexmk ()
"Try to run latexmk."
(if (bound-and-true-p latexmk-mode)
(my/run-latexmk)
)
)
(add-hook 'after-save-hook 'my/try-run-latexmk)
(add-hook 'latex-mode-hook 'latexmk-mode)
;;; latexmk-mode.el ends here