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. 41c5f9a1d16d3f9bca0de


From: Mosè Giordano
Subject: [AUCTeX-diffs] GNU AUCTeX branch, master, updated. 41c5f9a1d16d3f9bca0de17b7e8fabdc14481684
Date: Mon, 09 Mar 2015 21:14:41 +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  41c5f9a1d16d3f9bca0de17b7e8fabdc14481684 (commit)
       via  31c42ca3e46faa0121299ff1a0e054b3701bde77 (commit)
      from  69b02a0cadaab0c658c26049ace19d6818e16959 (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 41c5f9a1d16d3f9bca0de17b7e8fabdc14481684
Author: Mosè Giordano <address@hidden>
Date:   Mon Mar 9 21:56:35 2015 +0100

    Improve error/warning reporting when file cannot be determined.
    
    * tex-buf.el (TeX-find-display-help): Display the help also when
    the file cannot be determined.

diff --git a/ChangeLog b/ChangeLog
index fb17b04..826ca12 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2015-03-09  Mosè Giordano  <address@hidden>
 
+       * tex-buf.el (TeX-find-display-help): Display the help also when
+       the file cannot be determined.
+
        * latex.el (LaTeX-end-regexp): Add "\]".
        (LaTeX-indent-calculate): Indent "\[...\]" display math as a
        regular environment.
diff --git a/tex-buf.el b/tex-buf.el
index 2623023..1385f48 100644
--- a/tex-buf.el
+++ b/tex-buf.el
@@ -1820,14 +1820,6 @@ Return non-nil if an error or warning is found."
 (defun TeX-find-display-help (type file line error offset context string
                                   line-end bad-box error-point)
   "Find the error and display the help."
-  (unless file
-    (cond
-     ;; XXX: error messages have to be different?
-     ((equal type 'error)
-      (error "Error occurred after last TeX file closed"))
-     (t
-      (error "Could not determine file for warning"))))
-
   ;; Go back to TeX-buffer
   (let ((runbuf (TeX-active-buffer))
        (master (with-current-buffer TeX-command-buffer
@@ -1835,33 +1827,41 @@ Return non-nil if an error or warning is found."
        (command-buffer TeX-command-buffer)
        error-file-buffer start)
     (run-hooks 'TeX-translate-location-hook)
-    (setq error-file-buffer
-         (find-file
-          (expand-file-name file (file-name-directory master))))
-    ;; Set the value of `TeX-command-buffer' in the next file with an
-    ;; error to be displayed to the value it has in the current buffer.
-    (with-current-buffer error-file-buffer
-      (set (make-local-variable 'TeX-command-buffer) command-buffer))
-
-    ;; Find the location of the error or warning.
-    (when line
-      (goto-char (point-min))
-      (forward-line (+ offset line -1))
-      (cond
-       ;; Error.
-       ((equal type 'error)
-       (if (not (string= string " "))
-           (search-forward string nil t)))
-       ;; Warning or bad box.
-       (t
-       (beginning-of-line 0)
-       (setq start (point))
-       (goto-char (point-min))
-       (forward-line (+ offset line-end -1))
-       (end-of-line)
-       (when string
-         (search-backward string start t)
-         (search-forward string nil t)))))
+
+    (if file
+       (progn
+         (setq error-file-buffer
+               (find-file
+                (expand-file-name file (file-name-directory master))))
+         ;; Set the value of `TeX-command-buffer' in the next file with an
+         ;; error to be displayed to the value it has in the current buffer.
+         (with-current-buffer error-file-buffer
+           (set (make-local-variable 'TeX-command-buffer) command-buffer))
+
+         ;; Find the location of the error or warning.
+         (when line
+           (goto-char (point-min))
+           (forward-line (+ offset line -1))
+           (cond
+            ;; Error.
+            ((equal type 'error)
+             (if (not (string= string " "))
+                 (search-forward string nil t)))
+            ;; Warning or bad box.
+            (t
+             (beginning-of-line 0)
+             (setq start (point))
+             (goto-char (point-min))
+             (forward-line (+ offset line-end -1))
+             (end-of-line)
+             (when string
+               (search-backward string start t)
+               (search-forward string nil t))))))
+      ;; When the file cannot be determined stay here but issue a warning.
+      (message (concat "Could not determine file for "
+                      (cond ((equal type 'error) "error")
+                            (t "warning"))))
+      (beep))
 
     ;; Display the help.
     (cond ((eq TeX-display-help 'expert)

commit 31c42ca3e46faa0121299ff1a0e054b3701bde77
Author: Mosè Giordano <address@hidden>
Date:   Mon Mar 9 21:29:46 2015 +0100

    Indent \[...\] display math as a normal environment.
    
    * latex.el (LaTeX-end-regexp): Add "\]".
    (LaTeX-indent-calculate): Indent "\[...\]" display math as a
    regular environment.

diff --git a/ChangeLog b/ChangeLog
index 1cebd1e..fb17b04 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2015-03-09  Mosè Giordano  <address@hidden>
+
+       * latex.el (LaTeX-end-regexp): Add "\]".
+       (LaTeX-indent-calculate): Indent "\[...\]" display math as a
+       regular environment.
+
 2015-03-08  Arash Esbati  <address@hidden>
 
        * Makefile.in (STYLESRC): Add new style.
diff --git a/latex.el b/latex.el
index fc5ebdb..c232c24 100644
--- a/latex.el
+++ b/latex.el
@@ -2948,7 +2948,7 @@ indentation level in columns."
   :group 'LaTeX-indentation
   :type 'regexp)
 
-(defcustom LaTeX-end-regexp "end\\b"
+(defcustom LaTeX-end-regexp "end\\b\\|\\]"
   "*Regexp matching macros considered ends."
   :group 'LaTeX-indentation
   :type 'regexp)
@@ -3141,6 +3141,10 @@ outer indentation in case of a commented line.  The 
symbols
             ;; End brace in the start of the line.
             (- (LaTeX-indent-calculate-last force-type)
                TeX-brace-indent-level))
+           ((and (texmathp)
+                 ;; Display math \[...\], treat as a generic environment.
+                 (equal "\\[" (car texmathp-why)))
+            LaTeX-indent-level)
            (t (LaTeX-indent-calculate-last force-type))))))
 
 (defun LaTeX-indent-level-count ()

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

Summary of changes:
 ChangeLog  |    9 +++++++
 latex.el   |    6 ++++-
 tex-buf.el |   70 ++++++++++++++++++++++++++++++------------------------------
 3 files changed, 49 insertions(+), 36 deletions(-)


hooks/post-receive
-- 
GNU AUCTeX



reply via email to

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