auctex-diffs
[Top][All Lists]
Advanced

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

[AUCTeX-diffs] Changes to auctex/tex-buf.el,v


From: Ralf Angeli
Subject: [AUCTeX-diffs] Changes to auctex/tex-buf.el,v
Date: Sun, 13 Sep 2009 09:25:07 +0000

CVSROOT:        /cvsroot/auctex
Module name:    auctex
Changes by:     Ralf Angeli <angeli>    09/09/13 09:25:06

Index: tex-buf.el
===================================================================
RCS file: /cvsroot/auctex/auctex/tex-buf.el,v
retrieving revision 1.277
retrieving revision 1.278
diff -u -b -r1.277 -r1.278
--- tex-buf.el  5 Apr 2009 17:52:26 -0000       1.277
+++ tex-buf.el  13 Sep 2009 09:25:05 -0000      1.278
@@ -1494,11 +1494,22 @@
 
         ;; And the context for the help window.
         (context-start (point))
+        context-available
 
         ;; And the line number to position the cursor.
-        (line (if (re-search-forward "l\\.\\([0-9]+\\)" nil t)
-                  (string-to-number (TeX-match-buffer 1))
-                1))
+        (line (cond
+               ;; regular style
+               ((re-search-forward "l\\.\\([0-9]+\\)" nil t)
+                (setq context-available t)
+                (string-to-number (TeX-match-buffer 1)))
+               ;; file:line:error style
+               ((save-excursion
+                  (re-search-backward ":\\([0-9]+\\): "
+                                      (line-beginning-position) t))
+                (string-to-number (TeX-match-buffer 1)))
+               ;; nothing found
+               (t 1)))
+
         ;; And a string of the context to search for.
         (string (progn
                   (beginning-of-line)
@@ -1506,10 +1517,14 @@
                   (TeX-match-buffer 1)))
 
         ;; And we have now found to the end of the context.
-        (context (buffer-substring context-start (progn
-                                                   (forward-line 1)
+        (context (if context-available
+                     (buffer-substring context-start (progn (forward-line 1)
                                                    (end-of-line)
-                                                   (point))))
+                                                            (point)))
+                   ;; There is no real context available, so we
+                   ;; simply show the line with the error message.
+                   (buffer-substring (1- (line-beginning-position))
+                                     context-start)))
         ;; We may use these in another buffer.
         (offset (or (car TeX-error-offset) 0))
         (file (car TeX-error-file)))




reply via email to

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