Skip to content

Instantly share code, notes, and snippets.

@dschaehi
Last active September 5, 2024 06:40
Show Gist options
  • Select an option

  • Save dschaehi/7cf7476f99ff645e1b5f8d458237aa44 to your computer and use it in GitHub Desktop.

Select an option

Save dschaehi/7cf7476f99ff645e1b5f8d458237aa44 to your computer and use it in GitHub Desktop.
Fix Emacs AucTeX LaTeXMk not reverting the PDF buffer automatically.
(defun advice-after-TeX-TeX-sentinel (&rest args)
(unless (TeX-error-report-has-errors-p)
(run-hook-with-args 'TeX-after-compilation-finished-functions
(with-current-buffer TeX-command-buffer
(expand-file-name
(TeX-active-master (TeX-output-extension)))))))
(advice-add 'TeX-TeX-sentinel :after #'advice-after-TeX-TeX-sentinel)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment