auctex-diffs
[Top][All Lists]
Advanced

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

[AUCTeX-diffs] GNU AUCTeX branch, master, updated. 2cca33f68a2df99cd3600


From: Mosè Giordano
Subject: [AUCTeX-diffs] GNU AUCTeX branch, master, updated. 2cca33f68a2df99cd3600b1d3193b2b3727ced80
Date: Sun, 07 Feb 2016 22:45:38 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU AUCTeX".

The branch, master has been updated
       via  2cca33f68a2df99cd3600b1d3193b2b3727ced80 (commit)
       via  2c21439771b038682814b239dfba0b8d799d487c (commit)
       via  416f1315ca14e4d7eff16e78c601f43a3f31a795 (commit)
      from  464bef63b52ef3aee0b50c4bee76d24dc6b58ddc (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 2cca33f68a2df99cd3600b1d3193b2b3727ced80
Author: Mosè Giordano <address@hidden>
Date:   Sun Feb 7 23:41:07 2016 +0100

    Minor fix in TeX-documentation-texdoc
    
    * tex.el (TeX-documentation-texdoc): Make it possible to run the
      function in read-only buffers.

diff --git a/tex.el b/tex.el
index b7077fc..3633fd3 100644
--- a/tex.el
+++ b/tex.el
@@ -6102,7 +6102,7 @@ Prompt for selection of the package of which to show the 
documentation.
 If called with a prefix argument ARG, after selecting the
 package, prompt for selection of the manual of that package to
 show."
-  (interactive "*P")
+  (interactive "P")
   (let ((pkg (thing-at-point 'symbol))
        buffer list doc)
     ;; Strip off properties.  XXX: XEmacs doesn't have

commit 2c21439771b038682814b239dfba0b8d799d487c
Author: Mosè Giordano <address@hidden>
Date:   Sun Feb 7 23:38:22 2016 +0100

    Improve parsing of certain warnings
    
    * tex-buf.el (TeX-warning): Get full context and line numbers for
      warnings matching `LaTeX-warnings-regexp'.
    * tests/tex/compilation-log.txt: Add example warnings for this case.
    * tests/tex/error-parsing.el: Update result of test accordingly.

diff --git a/tests/tex/compilation-log.txt b/tests/tex/compilation-log.txt
index 98b3422..f97b300 100644
--- a/tests/tex/compilation-log.txt
+++ b/tests/tex/compilation-log.txt
@@ -1,13 +1,43 @@
-(./test.tex
+(./test.tex (./nice-class.cls
+Document Class: nice-class 1970/01/01 v42 A good class
+
+Package nice-class Warning: ******************************************
+(nice-class)                * THIS IS JUST A WARNING WITH A PESKY
+(nice-class)                * UNMATCHED CLOSED PARENTHESIS :-)
+(nice-class)                ****************************************** on 
input line 32.
+
+)
+
 (/opt/texlive/2015/texmf-dist/tex/context/base/supp-pdf.mkii
 [Loading MPS to PDF converter (version 2006.09.02).]
 )
 
-Package foo Warning: This is a warning!
+./test.tex:2: Class nice-class Error: ***********************************
+(nice-class)              * This is a very bad error!
+(nice-class)              ************************************.
+
+See the suftesi class documentation for explanation.
+Type  H <return>  for immediate help.
+ ...                                              
+                                                  
+l.2 \begin{document}
+
+(/other/packages/loaded.sty)
+ABD: EveryShipout initializing macros
+
+Package foo Warning: This is a warning! on input line 3.
 
 [1{/opt/texlive/2015/texmf-var/fonts/map/pdftex/updmap/pdftex.map}] 
(./test.aux)
 
 (./secondary-file.tex [8] [9] [10]
 Underfull \hbox (badness 6608) in paragraph at lines 131--132
 []|\T1/jkpl/m/n/10.95 (+20) Something bla
-[11] [12]))
+[11] [12])
+
+LaTeX Warning: Reference `wrong' on page 1 undefined on input line 4.
+
+[1{/opt/texlive/2015/texmf-var/fonts/map/pdftex/updmap/pdftex.map}] 
(./test.aux)
+
+LaTeX Warning: There were undefined references.
+
+)
diff --git a/tests/tex/error-parsing.el b/tests/tex/error-parsing.el
index ce09750..b826fc3 100644
--- a/tests/tex/error-parsing.el
+++ b/tests/tex/error-parsing.el
@@ -49,13 +49,45 @@ command line and from another directory."
              (insert-file-contents TeX-test-compilation-log)
              (TeX-parse-all-errors)
             TeX-error-list)
-          '((warning "./test.tex" nil "Package foo Warning: This is a warning!"
-                     0 "Package foo Warning: This is a warning!\n"
-                     nil nil nil 170)
+          '((warning
+             "./nice-class.cls" 32
+             "Package nice-class Warning: 
******************************************"
+             0
+             "Package nice-class Warning: 
******************************************
+(nice-class)                * THIS IS JUST A WARNING WITH A PESKY
+(nice-class)                * UNMATCHED CLOSED PARENTHESIS :-)
+(nice-class)                ****************************************** on 
input line 32.\n"
+             nil 32 nil 376)
+            (error
+              "./test.tex" 2
+              "Class nice-class Error: ***********************************" 0
+              "\n(nice-class)              * This is a very bad error!
+(nice-class)              ************************************.
+
+See the suftesi class documentation for explanation.
+Type  H <return>  for immediate help.
+ ...                                              
+                                                  
+l.2 \\begin{document}
+
+(/other/packages/loaded.sty)
+ABD: EveryShipout initializing macros"
+              "\\begin{document}\n\n(/other/packages/loaded.sty)" nil nil 971)
+            (warning "./test.tex" 3
+              "Package foo Warning: This is a warning! on input line 3." 0
+             "Package foo Warning: This is a warning! on input line 3.\n"
+             nil 3 nil 1030)
             (bad-box
              "./secondary-file.tex" 131
              "Underfull \\hbox (badness 6608) in paragraph at lines 131--132"
              0 "\n[]|\\T1/jkpl/m/n/10.95 (+20) Something bla" "bla"
-             132 10 391)))))
+             132 10 1251)
+             (warning "./test.tex" 4
+              "LaTeX Warning: Reference `wrong' on page 1 undefined on input 
line 4."
+              0
+              "LaTeX Warning: Reference `wrong' on page 1 undefined on input 
line 4.\n"
+              "wrong" 4 nil 1334)
+             (warning "./test.tex" 4 "LaTeX Warning: There were undefined 
references."
+              0 "LaTeX Warning: There were undefined references.\n" nil 4 nil 
1465)))))
 
 ;;; error-parsing.el ends here
diff --git a/tex-buf.el b/tex-buf.el
index 0d924c7..3ba1f87 100644
--- a/tex-buf.el
+++ b/tex-buf.el
@@ -2510,7 +2510,18 @@ warning."
                                 (beginning-of-line))
                               (point)))
 
-        (context (progn
+        (context (if (string-match LaTeX-warnings-regexp warning)
+                     ;; The warnings matching `LaTeX-warnings-regexp' are
+                     ;; emitted by \GenericWarning macro, or macros based on it
+                     ;; (\ClassWarning, \PackageWarning, etc).  After such
+                     ;; warnings there is an empty line, just look for it to
+                     ;; find the end.
+                     (progn
+                       (beginning-of-line)
+                       (while (null (eolp))
+                         (forward-line 1))
+                       (buffer-substring context-start (progn (end-of-line)
+                                                              (point))))
                    (forward-line 1)
                    (end-of-line)
                    (while (equal (current-column) 79)
@@ -2530,6 +2541,17 @@ warning."
         (offset (or (car TeX-error-offset) 0))
         (file (car TeX-error-file)))
 
+    ;; Second chance to get line number right.  If `line' is nil, check whether
+    ;; the reference to the line number is in `context'.  For example, this is
+    ;; the case for warnings emitted with \ClassWarning and \PackageWarning.
+    ;; XXX: maybe it suffices to evaluate `line' after `context' above, but I
+    ;; don't know if there are cases in which it's important to get `line'
+    ;; before `context'.
+    (and (null line)
+        (string-match line-string context)
+        (setq line-end
+              (setq line (string-to-number (match-string 1 context)))))
+
     ;; This is where we start next time.
     (goto-char error-point)
     (setq TeX-error-point (point))

commit 416f1315ca14e4d7eff16e78c601f43a3f31a795
Author: Mosè Giordano <address@hidden>
Date:   Sun Feb 7 19:13:42 2016 +0100

    Catch LaTeX class warnings
    
    * tex-buf.el (LaTeX-warnings-regexp): New variable.  This is the same
      regexp used before by `TeX-LaTeX-sentinel-has-warnings' and
      `TeX-parse-error', but now catches class warnings as well.
    (TeX-LaTeX-sentinel-has-warnings, TeX-parse-error): Use
    `LaTeX-warnings-regexp'.

diff --git a/tex-buf.el b/tex-buf.el
index d44cbc7..0d924c7 100644
--- a/tex-buf.el
+++ b/tex-buf.el
@@ -1389,13 +1389,16 @@ Return nil ifs no errors were found."
       (setq TeX-command-next TeX-command-Show))
     nil))
 
+(defvar LaTeX-warnings-regexp
+  "\\(?:LaTeX [-A-Za-z0-9]*\\|\\(?:Class\\|Package\\) [-A-Za-z0-9]+ 
\\)Warning:"
+  "Regexp matching LaTeX warnings.")
+
 (defun TeX-LaTeX-sentinel-has-warnings ()
   "Return non-nil, if the output buffer contains warnings.
 Warnings can be indicated by LaTeX or packages."
   (save-excursion
     (goto-char (point-min))
-    (re-search-forward
-     "^\\(LaTeX [-A-Za-z]*\\|Package [-A-Za-z0-9]+ \\)Warning:" nil t)))
+    (re-search-forward (concat "^" LaTeX-warnings-regexp) nil t)))
 
 (defun TeX-LaTeX-sentinel-has-bad-boxes ()
   "Return non-nil, if LaTeX output indicates overfull or underfull boxes."
@@ -2266,7 +2269,7 @@ Return non-nil if an error or warning is found."
          "^\\(\\(?:Overfull\\|Underfull\\|Tight\\|Loose\\)\
  \\\\.*?[0-9]+--[0-9]+\\)\\|"
          ;; LaTeX warning
-         "^\\(\\(?:LaTeX [-A-Za-z]*\\|Package [-A-Za-z0-9]+ \\)Warning:.*\\)"))
+         "^\\(" LaTeX-warnings-regexp ".*\\)"))
        (error-found nil))
     (while
        (cond

-----------------------------------------------------------------------

Summary of changes:
 tests/tex/compilation-log.txt |   36 +++++++++++++++++++++++++++++++++---
 tests/tex/error-parsing.el    |   40 ++++++++++++++++++++++++++++++++++++----
 tex-buf.el                    |   33 +++++++++++++++++++++++++++++----
 tex.el                        |    2 +-
 4 files changed, 99 insertions(+), 12 deletions(-)


hooks/post-receive
-- 
GNU AUCTeX



reply via email to

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