auctex-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[AUCTeX-devel] [Patch] `TeX-BibTeX-sentinel' checks BibTeX's output


From: Christian Schlauer
Subject: [AUCTeX-devel] [Patch] `TeX-BibTeX-sentinel' checks BibTeX's output
Date: Mon, 12 Sep 2005 18:37:12 +0200
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (windows-nt)

Hello!

Right now, AUCTeX doesn't warn the user if BibTeX complains about
something, see
<URL:http://article.gmane.org/gmane.emacs.auc-tex/3084>.

I attach a patch that reports the number of warnings/errors from the
BibTeX run instead of only suggesting "You should perhaps run LaTeX
again to get citations right."

It is good to report the actual number of warnings/errors: you might
have some bib entries that are not complete yet (missing year or
volume or ...), so you expect that there will be, say, 2 warnings.
Then you can see directly with the attached patch if the number of
warnings increases (bad) or is constant (expected).

I also changed "You should perhaps run LaTeX again to get citations
right." to "BibTeX finished successfully. Run LaTeX again to get
citations right." It seems to me that a BibTeX run is only triggered
when necessary (see `TeX-LaTeX-sentinel'), so one _should_ run LaTeX
again, not perhaps.

(I haven't found the time yet to sign up at Savannah and get familiar
with CVS, so could someone (Ralf?) check this in? Thanks!)

--- tex-buf.el~ 2005-06-12 14:46:08.000000000 +0200
+++ tex-buf.el  2005-09-11 12:57:34.000000000 +0200
@@ -932,7 +932,20 @@
 ;; should go into latex.el? --pg
 (defun TeX-BibTeX-sentinel (process name)
   "Cleanup TeX output buffer after running BibTeX."
-  (message "You should perhaps run LaTeX again to get citations right.")
+  (goto-char (point-max))
+  (cond
+   ;; Check whether BibTeX reports any warnings or errors.
+   ((re-search-backward (concat
+                        "^(There \\(?:was\\|were\\) \\([0-9]+\\) "
+                        "\\(warnings?\\|error messages?\\))") nil t)
+    ;; Tell the user their number so that she sees whether the
+    ;; situation is getting better or worse.
+    (message (concat "BibTeX finished with %s %s. "
+                    "Type `C-c C-l' to display BibTeX's output.")
+            (match-string 1) (match-string 2)))
+   (t
+    (message (concat "BibTeX finished successfully. "
+                    "Run LaTeX again to get citations right."))))
   (setq TeX-command-next TeX-command-default))
 
 ;;; Process Control
--- doc/changes.texi~   2005-08-24 09:49:18.000000000 +0200
+++ doc/changes.texi    2005-09-11 12:49:10.000000000 +0200
@@ -85,6 +85,10 @@
 Make sure to adjust your customizations.
 
 @item
+The output of a address@hidden run is now checked for warnings and errors,
+which are reported in the echo area.
+
address@hidden
 Of course a lot of bugs have been fixed.
 @end itemize
 
2005-09-11  Christian Schlauer  <address@hidden>

        * tex-buf.el (TeX-BibTeX-sentinel): Check whether BibTeX reports
        any warnings or errors.

        * doc/changes.texi: Mention it.

Regards,
-- 
Christian Schlauer

reply via email to

[Prev in Thread] Current Thread [Next in Thread]