[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 253/299: Cater for bad boxes in error descriptions.
From: |
Stefan Monnier |
Subject: |
[elpa] 253/299: Cater for bad boxes in error descriptions. |
Date: |
Sun, 02 Nov 2014 03:11:48 +0000 |
monnier pushed a commit to branch externals/auctex
in repository elpa.
commit c2bdd117cc7fa70e22cabeddc9bee00ee6af83b0
Author: Mosè Giordano <address@hidden>
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 <address@hidden>
+
+ * 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 <address@hidden>
* 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)
- [elpa] 238/299: Use LaTeX-biblatex-use-Biber to manually select bibliography processor., (continued)
- [elpa] 238/299: Use LaTeX-biblatex-use-Biber to manually select bibliography processor., Stefan Monnier, 2014/11/01
- [elpa] 246/299: Make style/babel.el file non-executable., Stefan Monnier, 2014/11/01
- [elpa] 234/299: Ask for TeX-master if unknown., Stefan Monnier, 2014/11/01
- [elpa] 244/299: Fix typo in listings.el., Stefan Monnier, 2014/11/01
- [elpa] 237/299: Update biblatex support in style file., Stefan Monnier, 2014/11/01
- [elpa] 250/299: Add TeX-previous-error to Command menu., Stefan Monnier, 2014/11/01
- [elpa] 247/299: Convert font-latex-fontify-sectioning to float when used as a number., Stefan Monnier, 2014/11/01
- [elpa] 252/299: Fix possible infinite loop in TeX-parse-all-errors., Stefan Monnier, 2014/11/01
- [elpa] 249/299: Backport from ELPA repository., Stefan Monnier, 2014/11/01
- [elpa] 245/299: Use TeX-esc as completion separator for units in siunitx.el., Stefan Monnier, 2014/11/01
- [elpa] 253/299: Cater for bad boxes in error descriptions.,
Stefan Monnier <=
- [elpa] 257/299: Fix TeX-find-display-help., Stefan Monnier, 2014/11/01
- [elpa] 251/299: Color TeX Help buffer., Stefan Monnier, 2014/11/01
- [elpa] 255/299: Better check for mgs., Stefan Monnier, 2014/11/01
- [elpa] 258/299: Prettify file names in error overview., Stefan Monnier, 2014/11/01
- [elpa] 259/299: Update Future Development section in manual., Stefan Monnier, 2014/11/01
- [elpa] 254/299: Simplify error finding and help displaying functions., Stefan Monnier, 2014/11/01
- [elpa] 263/299: Fix remaining XEmacs compilation issues., Stefan Monnier, 2014/11/01
- [elpa] 260/299: Improve selection of the forward/inverse search method., Stefan Monnier, 2014/11/01
- [elpa] 262/299: Fix some XEmacs compilation issues., Stefan Monnier, 2014/11/01
- [elpa] 264/299: Fix some runtime issues in XEmacs., Stefan Monnier, 2014/11/01