monnier pushed a commit to branch externals/auctex
in repository elpa.
commit c2bdd117cc7fa70e22cabeddc9bee00ee6af83b0
Author: Mosè Giordano <[email protected]>
Date: Wed Jun 4 22:02:58 2014 +0200
Cater for bad boxes in error descriptions.
* tex-buf.el (TeX-parse-TeX): Use
`TeX-error-list-find-display-help'.
(TeX-error-list-find-display-help): New function.
(TeX-warning): Use `bad-box' when there is a bad box.
(TeX-warning--find-display-help): Cater for bad boxes.
(TeX-help-error): Ditto.
---
ChangeLog | 9 +++++++++
tex-buf.el | 40 +++++++++++++++++++++++++++-------------
2 files changed, 36 insertions(+), 13 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 109025e..c663758 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2014-06-04 Mos� Giordano <[email protected]>
+
+ * tex-buf.el (TeX-parse-TeX): Use
+ `TeX-error-list-find-display-help'.
+ (TeX-error-list-find-display-help): New function.
+ (TeX-warning): Use `bad-box' when there is a bad box.
+ (TeX-warning--find-display-help): Cater for bad boxes.
+ (TeX-help-error): Ditto.
+
2014-06-02 Mos� Giordano <[email protected]>
* tex-buf.el (TeX-error--find-display-help): Use new fourth
diff --git a/tex-buf.el b/tex-buf.el
index 790feee..e006ea6 100644
--- a/tex-buf.el
+++ b/tex-buf.el
@@ -966,10 +966,10 @@ Return nil ifs no errors were found."
(setq TeX-command-next TeX-command-default)
;; error reported to TeX-error-report-switches
(setq TeX-error-report-switches
- (plist-put TeX-error-report-switches
- (intern (plist-get TeX-error-report-switches
- 'TeX-current-master))
- t))
+ (plist-put TeX-error-report-switches
+ (intern (plist-get TeX-error-report-switches
+ 'TeX-current-master))
+ t))
t)
(setq TeX-command-next TeX-command-Show)
nil))
@@ -1539,10 +1539,7 @@ already in an Emacs buffer) and the cursor is placed at
the error."
(beep)
(TeX-pop-to-buffer old-buffer))
(t
- (apply (intern
- (concat "TeX-" (symbol-name (car item))
- "--find-display-help"))
- (cdr item)))))
+ (TeX-error-list-find-display-help item))))
(goto-char TeX-error-point)
(TeX-parse-error old-buffer)))))
@@ -1691,6 +1688,20 @@ Return non-nil if an error or warning is found."
t)))
error-found))
+(defun TeX-error-list-find-display-help (item)
+ "Find the error and display the help associated to it.
+ITEM is an element of `TeX-error-list' with all relevant
+information about the error or warning."
+ (let ((type (car item)))
+ (apply (intern (concat "TeX-"
+ (cond
+ ((equal type 'error)
+ "error")
+ ((or (equal type 'warning) (equal type 'bad-box))
+ "warning"))
+ "--find-display-help"))
+ (cdr item))))
+
(defun TeX-error (&optional store)
"Display an error.
@@ -1836,8 +1847,8 @@ warning."
(if store
;; Store the warning information.
(add-to-list 'TeX-error-list
- (list 'warning file line warning offset context
- string line-end bad-box) t)
+ (list (if bad-box 'bad-box 'warning) file line warning
+ offset context string line-end bad-box) t)
;; Find the warning point and display the help.
(TeX-warning--find-display-help
file line warning offset context string line-end bad-box))))
@@ -1880,7 +1891,7 @@ warning."
(TeX-pop-to-buffer error-file-buffer nil t))
(TeX-display-help
(TeX-help-error error (if bad-box context (concat "\n" context))
- runbuf 'warning))
+ runbuf (if bad-box 'bad-box 'warning)))
(t
(message (concat "! " error))))))
@@ -1931,7 +1942,8 @@ warning."
(defun TeX-help-error (error output runbuffer type)
"Print ERROR in context OUTPUT from RUNBUFFER in another window.
-TYPE is a symbol specifing if ERROR is a real error or a warning."
+TYPE is a symbol specifing if ERROR is a real error, a warning or
+a bad box."
(let ((old-buffer (current-buffer))
(log-file (with-current-buffer runbuffer
@@ -1953,7 +1965,9 @@ TYPE is a symbol specifing if ERROR is a real error or a
warning."
((equal type 'error)
(propertize "ERROR" 'font-lock-face 'TeX-error-description-error))
((equal type 'warning)
- (propertize "WARNING" 'font-lock-face 'TeX-error-description-warning)))
+ (propertize "WARNING" 'font-lock-face 'TeX-error-description-warning))
+ ((equal type 'bad-box)
+ (propertize "BAD BOX" 'font-lock-face 'TeX-error-description-warning)))
": " error
(propertize "\n\n--- TeX said ---" 'font-lock-face
'TeX-error-description-tex-said)