auctex-diffs
[Top][All Lists]
Advanced

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

[AUCTeX-diffs] GNU AUCTeX branch, simplify-TeX-parse-error, created. f91


From: Tassilo Horn
Subject: [AUCTeX-diffs] GNU AUCTeX branch, simplify-TeX-parse-error, created. f91946802bd0bc6689de31493da9d8f8e55abfbb
Date: Thu, 24 Apr 2014 18:46:19 +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, simplify-TeX-parse-error has been created
        at  f91946802bd0bc6689de31493da9d8f8e55abfbb (commit)

- Log -----------------------------------------------------------------
commit f91946802bd0bc6689de31493da9d8f8e55abfbb
Author: Tassilo Horn <address@hidden>
Date:   Thu Apr 24 20:43:31 2014 +0200

    Improve TeX error parsing.
    
    * tex-buf.el (TeX-error): Error if file containing the TeX error
    doesn't exist instead of finding a new file.
    (TeX-parse-error): Greatly simplify the new file and end of file
    regexps.

diff --git a/tex-buf.el b/tex-buf.el
index 84ca2da..c2c3ba6 100644
--- a/tex-buf.el
+++ b/tex-buf.el
@@ -1483,16 +1483,9 @@ You might want to examine and modify the free variables 
`file',
          ;; TeX error
          "^\\(!\\|\\(.*?\\):[0-9]+:\\) \\|"
          ;; New file
-         "(\\(\"[^\"]*?\"\\|/*\
-\\(?:\\.+[^()\r\n{} \\/]*\\|[^()\r\n{} .\\/]+\
-\\(?: [^()\r\n{} .\\/]+\\)*\\(?:\\.[-0-9a-zA-Z_.]*\\)?\\)\
-\\(?:[\\/]+\\(?:\\.+[^()\r\n{} \\/]*\\|[^()\r\n{} .\\/]+\
-\\(?: [^()\r\n{} .\\/]+\\)*\\(?:\\.[-0-9a-zA-Z_.]*\\)?\\)?\\)*\\)\
-)*\\(?: \\|\r?$\\)\\|"
-         ;; End of file.  The [^:] skips package messages like:
-         ;; Package hyperref Message: Driver (autodetected): hpdftex.
-         ;; [Loading MPS to PDF converter (version 2006.09.02).]
-         "\\()\\)[^:.]\\|"
+         "(\n?\\([^())]+\\)\\|"
+         ;; End of file.
+         "\\()\\)\\|"
          ;; Hook to change line numbers
          " !\\(?:offset(\\([---0-9]+\\))\\|"
          ;; Hook to change file name
@@ -1545,11 +1538,12 @@ You might want to examine and modify the free variables 
`file',
         ((match-beginning 3)
          (let ((file (TeX-match-buffer 3))
                (end (match-end 3)))
-           ;; Strip quotation marks and remove newlines if necessary
+           ;; Trim, strip quotation marks and remove newlines if necessary
            (when (or (eq (string-to-char file) ?\")
-                     (string-match "\n" file))
-             (setq file
-                   (mapconcat 'identity (split-string file "[\"\n]+") "")))
+                     (string-match "[ \t\n]" file))
+             (setq file (mapconcat 'identity
+                                   (split-string file "[\"\n]+" nil "[ \t]")
+                                   "")))
            (push file TeX-error-file)
            (push nil TeX-error-offset)
            (goto-char end))
@@ -1624,8 +1618,10 @@ You might want to examine and modify the free variables 
`file',
     (setq TeX-error-point (point))
 
     ;; Find the error.
-    (if (null file)
-       (error "Error occurred after last TeX file closed"))
+    (when (null file)
+      (error "Error occurred after last TeX file closed"))
+    (when (not (file-exists-p file))
+      (error "No such file: %s" file))
     (let ((runbuf (current-buffer))
          (master (with-current-buffer
                      TeX-command-buffer

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


hooks/post-receive
-- 
GNU AUCTeX



reply via email to

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