branch: elpa commit 0423aae23efdc9bc0a1df6194190910a7655feae Author: Mosè Giordano <m...@gnu.org> Commit: Mosè Giordano <m...@gnu.org>
New function TeX-error-report-has-errors-p * tex-buf.el (TeX-error-report-has-errors-p): New function. (TeX-error-report-switches): Update docstring. (TeX-LaTeX-sentinel, TeX-command-sequence-sentinel): Use `TeX-error-report-has-errors-p'. * tex-bar.el (TeX-bar-TeX-button-alist, TeX-bar-LaTeX-button-alist): Ditto. --- tex-bar.el | 12 ++++-------- tex-buf.el | 12 ++++++++---- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tex-bar.el b/tex-bar.el index f3cbaf1..185eb39 100644 --- a/tex-bar.el +++ b/tex-bar.el @@ -176,10 +176,8 @@ the argument BUTTON-ALIST in function `toolbarx-install-toolbar'." (TeX-bar-help-from-command-list "PDFTeX"))) (next-error :image "error" :command TeX-next-error - :enable (plist-get TeX-error-report-switches - (intern (TeX-master-file))) - :visible (plist-get TeX-error-report-switches - (intern (TeX-master-file)))) + :enable (TeX-error-report-has-errors-p) + :visible (TeX-error-report-has-errors-p) (view :image (lambda nil (if TeX-PDF-mode "viewpdf" "viewdvi")) :command (TeX-command "View" 'TeX-master-file -1) :help (lambda (&rest ignored) @@ -322,10 +320,8 @@ the argument BUTTON-ALIST in function `toolbarx-install-toolbar'." (TeX-bar-help-from-command-list "PDFLaTeX"))) (next-error :image "error" :command TeX-next-error - :enable (plist-get TeX-error-report-switches - (intern (TeX-master-file))) - :visible (plist-get TeX-error-report-switches - (intern (TeX-master-file)))) + :enable (TeX-error-report-has-errors-p) + :visible (TeX-error-report-has-errors-p) (view :image (lambda nil (if TeX-PDF-mode "viewpdf" "viewdvi")) :command (TeX-command "View" 'TeX-master-file -1) :help (lambda (&rest ignored) diff --git a/tex-buf.el b/tex-buf.el index 1212ec7..d65b62c 100644 --- a/tex-buf.el +++ b/tex-buf.el @@ -1014,9 +1014,13 @@ Return the new process." (defvar TeX-error-report-switches nil "Reports presence of errors after `TeX-run-TeX'. -To test whether the current buffer has an compile error from last +To test whether the current buffer has a compile error from last run of `TeX-run-TeX', use - (plist-get TeX-error-report-switches (intern (TeX-master-file)))") + (TeX-error-report-has-errors-p)") + +(defun TeX-error-report-has-errors-p () + "Return non-nil if current buffer has compile errors from last TeX run." + (plist-get TeX-error-report-switches (intern (TeX-master-file)))) (defun TeX-run-TeX (name command file) "Create a process for NAME using COMMAND to format FILE with TeX." @@ -1551,7 +1555,7 @@ Rerun to get mark in right position\\." nil t) (md5 (current-buffer))))) (push (cons idx-file t) LaTeX-idx-changed-alist))) - (unless (plist-get TeX-error-report-switches (intern (TeX-master-file))) + (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 @@ -1657,7 +1661,7 @@ variable is nil." (with-current-buffer TeX-command-buffer (unless (or - (plist-get TeX-error-report-switches (intern (TeX-master-file))) + (TeX-error-report-has-errors-p) (null TeX-command-sequence-command)) (TeX-command-sequence TeX-command-sequence-command nil TeX-command-sequence-file-function))))))