[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/auctex 41c5f9a 24/35: Improve error/warning reporting w
From: |
Tassilo Horn |
Subject: |
[elpa] externals/auctex 41c5f9a 24/35: Improve error/warning reporting when file cannot be determined. |
Date: |
Sun, 22 Mar 2015 09:27:06 +0000 |
branch: externals/auctex
commit 41c5f9a1d16d3f9bca0de17b7e8fabdc14481684
Author: Mosè Giordano <address@hidden>
Commit: Mosè Giordano <address@hidden>
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.
---
ChangeLog | 3 ++
tex-buf.el | 70 ++++++++++++++++++++++++++++++------------------------------
2 files changed, 38 insertions(+), 35 deletions(-)
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)
- [elpa] externals/auctex b858aae 10/35: Make TeX-pdf-tools-sync-view work with region files, (continued)
- [elpa] externals/auctex b858aae 10/35: Make TeX-pdf-tools-sync-view work with region files, Tassilo Horn, 2015/03/22
- [elpa] externals/auctex b2957c8 11/35: Fix bug in pdf-tools support, Tassilo Horn, 2015/03/22
- [elpa] externals/auctex 86f4a1e 12/35: Add a hook that's run after an environment is modified, Tassilo Horn, 2015/03/22
- [elpa] externals/auctex 566426b 08/35: New style for color.sty, Tassilo Horn, 2015/03/22
- [elpa] externals/auctex 3cf92fc 14/35: Fix font-locking issue, Tassilo Horn, 2015/03/22
- [elpa] externals/auctex 39badf0 15/35: New defcustom LaTeX-fill-excluded-macros, Tassilo Horn, 2015/03/22
- [elpa] externals/auctex 83306b4 13/35: Add some expl3 support, Tassilo Horn, 2015/03/22
- [elpa] externals/auctex 074af82 16/35: Add docs for LaTeX-fill-excluded-macros, Tassilo Horn, 2015/03/22
- [elpa] externals/auctex 61ed48c 19/35: Replace add-to-list with pushnew, Tassilo Horn, 2015/03/22
- [elpa] externals/auctex 31c42ca 23/35: Indent \[...\] display math as a normal environment., Tassilo Horn, 2015/03/22
- [elpa] externals/auctex 41c5f9a 24/35: Improve error/warning reporting when file cannot be determined.,
Tassilo Horn <=
- [elpa] externals/auctex 59f9440 26/35: Fix void-function error occuring if cl is not loaded, Tassilo Horn, 2015/03/22
- [elpa] externals/auctex 4034de2 21/35: New style for caption.sty., Tassilo Horn, 2015/03/22
- [elpa] externals/auctex a2a4777 25/35: Add TeX-after-TeX-LaTeX-command-finished-hook, Tassilo Horn, 2015/03/22
- [elpa] externals/auctex b853739 17/35: Add uninstall rules to Makefiles., Tassilo Horn, 2015/03/22
- [elpa] externals/auctex d23de0a 18/35: Style for bidibeamer which delegates to beamer, Tassilo Horn, 2015/03/22
- [elpa] externals/auctex a375093 20/35: New style enumitem.el, Tassilo Horn, 2015/03/22
- [elpa] externals/auctex 69b02a0 22/35: New style for geometry.sty., Tassilo Horn, 2015/03/22
- [elpa] externals/auctex 003f475 28/35: New style ltablex.el., Tassilo Horn, 2015/03/22
- [elpa] externals/auctex f16c051 31/35: Fix header of style/mn2e.el., Tassilo Horn, 2015/03/22
- [elpa] externals/auctex 8d7fef3 27/35: Improve styles enumitem.el and caption.el., Tassilo Horn, 2015/03/22