[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[AUCTeX-diffs] GNU AUCTeX branch, master, updated. 87d277dc2b6b3c1e74b00
From: |
Mosè Giordano |
Subject: |
[AUCTeX-diffs] GNU AUCTeX branch, master, updated. 87d277dc2b6b3c1e74b0016535270561851fc563 |
Date: |
Mon, 02 Jun 2014 09:49:24 +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 87d277dc2b6b3c1e74b0016535270561851fc563 (commit)
from fb40d4253a9937a325b39ad886ba709d07016c3d (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 87d277dc2b6b3c1e74b0016535270561851fc563
Author: Mosè Giordano <address@hidden>
Date: Mon Jun 2 11:45:30 2014 +0200
Color TeX Help buffer.
diff --git a/ChangeLog b/ChangeLog
index 521819d..e8a16bf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2014-06-02 Mosè Giordano <address@hidden>
+
+ * tex-buf.el (TeX-error--find-display-help): Use new fourth
+ argument of `TeX-help-error'.
+ (TeX-warning): Rename mandatory argument to `warning'. Do not add
+ leading "** " to warning string.
+ (TeX-warning--find-display-help): Use new fourth argument of
+ `TeX-help-error'.
+ (TeX-error-description-faces): New group.
+ (TeX-error-description-error): New face.
+ (TeX-error-description-warning): Ditto.
+ (TeX-error-description-tex-said): Ditto.
+ (TeX-error-description-help): Ditto.
+ (TeX-help-error): Add new `type' argument. Color help messages
+ using the new faces.
+
2014-05-27 Mosè Giordano <address@hidden>
* tex.el (TeX-mode-specific-command-menu-entries): Add
diff --git a/tex-buf.el b/tex-buf.el
index 7e016da..614f156 100644
--- a/tex-buf.el
+++ b/tex-buf.el
@@ -1778,21 +1778,19 @@ information in `TeX-error-list' instead of displaying
the error."
(goto-char TeX-error-point)
(TeX-pop-to-buffer error-file-buffer nil t))
(TeX-display-help
- (TeX-help-error error context runbuf))
+ (TeX-help-error error context runbuf 'error))
(t
(message (concat "! " error))))))
-(defun TeX-warning (string &optional store)
- "Display a warning for STRING.
+(defun TeX-warning (warning &optional store)
+ "Display a warning for WARNING.
If optional argument STORE is non-nil, store the warning
information in `TeX-error-list' instead of displaying the
warning."
- (let* ((error (concat "** " string))
-
- ;; bad-box is nil if this is a "LaTeX Warning"
- (bad-box (string-match "\\\\[vh]box.*[0-9]*--[0-9]*" string))
+ (let* (;; bad-box is nil if this is a "LaTeX Warning"
+ (bad-box (string-match "\\\\[vh]box.*[0-9]*--[0-9]*" warning))
;; line-string: match 1 is beginning line, match 2 is end line
(line-string (if bad-box " \\([0-9]*\\)--\\([0-9]*\\)"
"on input line \\([0-9]*\\)\\."))
@@ -1837,11 +1835,11 @@ warning."
(if store
;; Store the warning information.
(add-to-list 'TeX-error-list
- (list 'warning file line error offset context
+ (list '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 error offset context string line-end bad-box))))
+ file line warning offset context string line-end bad-box))))
(defun TeX-warning--find-display-help (file line error offset context
string line-end bad-box)
@@ -1881,14 +1879,58 @@ 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))
+ runbuf 'warning))
(t
(message (concat "! " error))))))
;;; - Help
-(defun TeX-help-error (error output runbuffer)
- "Print ERROR in context OUTPUT from RUNBUFFER in another window."
+(defgroup TeX-error-description-faces nil
+ "Faces used in error descriptions."
+ :prefix "TeX-error-description-"
+ :group 'AUCTeX)
+
+(defface TeX-error-description-error
+ ;; This is the same as `error' face in latest GNU Emacs versions.
+ '((default :weight bold)
+ (((class color) (min-colors 88) (background light)) :foreground "Red1")
+ (((class color) (min-colors 88) (background dark)) :foreground "Pink")
+ (((class color) (min-colors 16) (background light)) :foreground "Red1")
+ (((class color) (min-colors 16) (background dark)) :foreground "Pink")
+ (((class color) (min-colors 8)) :foreground "red")
+ (t :inverse-video t))
+ "Face for \"Error\" string in error descriptions.")
+
+(defface TeX-error-description-warning
+ ;; This is the same as `warning' face in latest GNU Emacs versions.
+ '((default :weight bold)
+ (((class color) (min-colors 16)) :foreground "DarkOrange")
+ (((class color)) :foreground "yellow"))
+ "Face for \"Warning\" string in error descriptions.")
+
+(defface TeX-error-description-tex-said
+ ;; This is the same as `font-lock-function-name-face' face in latest GNU
Emacs
+ ;; versions.
+ '((((class color) (min-colors 88) (background light))
+ :foreground "Blue1")
+ (((class color) (min-colors 88) (background dark))
+ :foreground "LightSkyBlue")
+ (((class color) (min-colors 16) (background light))
+ :foreground "Blue")
+ (((class color) (min-colors 16) (background dark))
+ :foreground "LightSkyBlue")
+ (((class color) (min-colors 8))
+ :foreground "blue" :weight bold)
+ (t :inverse-video t :weight bold))
+ "Face for \"TeX said\" string in error descriptions.")
+
+(defface TeX-error-description-help
+ '((t :inherit TeX-error-description-tex-said))
+ "Face for \"Help\" string in error descriptions.")
+
+(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."
(let ((old-buffer (current-buffer))
(log-file (with-current-buffer runbuffer
@@ -1905,34 +1947,42 @@ warning."
(TeX-pop-to-buffer (get-buffer-create "*TeX Help*") nil t)
(let ((inhibit-read-only t))
(erase-buffer)
- (insert "ERROR: " error
- "\n\n--- TeX said ---"
- output
- "\n--- HELP ---\n"
- (let ((help (cdr (nth TeX-error-pointer
- TeX-error-description-list))))
- (save-excursion
- (if (and (string= help "No help available")
- (let* ((log-buffer (find-buffer-visiting log-file)))
- (if log-buffer
- (progn
- (set-buffer log-buffer)
- (revert-buffer t t))
- (setq log-buffer
- (find-file-noselect log-file))
- (set-buffer log-buffer))
- (auto-save-mode nil)
- (setq buffer-read-only t)
- (goto-char (point-min))
- (search-forward error nil t 1))
- (re-search-forward "^l\\." nil t)
- (re-search-forward "^ [^\n]+$" nil t))
- (let ((start (1+ (point))))
- (forward-char 1)
- (re-search-forward "^$")
- (concat "From the .log file...\n\n"
- (buffer-substring start (point))))
- help)))))
+ (insert
+ (cond
+ ((equal type 'error)
+ (propertize "ERROR" 'font-lock-face 'TeX-error-description-error))
+ ((equal type 'warning)
+ (propertize "WARNING" 'font-lock-face 'TeX-error-description-warning)))
+ ": " error
+ (propertize "\n\n--- TeX said ---" 'font-lock-face
+ 'TeX-error-description-tex-said)
+ output
+ (propertize "\n--- HELP ---\n" 'font-lock-face
+ 'TeX-error-description-help)
+ (let ((help (cdr (nth TeX-error-pointer
+ TeX-error-description-list))))
+ (save-excursion
+ (if (and (string= help "No help available")
+ (let* ((log-buffer (find-buffer-visiting log-file)))
+ (if log-buffer
+ (progn
+ (set-buffer log-buffer)
+ (revert-buffer t t))
+ (setq log-buffer
+ (find-file-noselect log-file))
+ (set-buffer log-buffer))
+ (auto-save-mode nil)
+ (setq buffer-read-only t)
+ (goto-char (point-min))
+ (search-forward error nil t 1))
+ (re-search-forward "^l\\." nil t)
+ (re-search-forward "^ [^\n]+$" nil t))
+ (let ((start (1+ (point))))
+ (forward-char 1)
+ (re-search-forward "^$")
+ (concat "From the .log file...\n\n"
+ (buffer-substring start (point))))
+ help)))))
(goto-char (point-min))
(TeX-special-mode)
(TeX-pop-to-buffer old-buffer nil t)))
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 16 +++++++
tex-buf.el | 130 +++++++++++++++++++++++++++++++++++++++++------------------
2 files changed, 106 insertions(+), 40 deletions(-)
hooks/post-receive
--
GNU AUCTeX
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [AUCTeX-diffs] GNU AUCTeX branch, master, updated. 87d277dc2b6b3c1e74b0016535270561851fc563,
Mosè Giordano <=