aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Pfeiffer2004-04-07 12:57:04 +0000
committerDaniel Pfeiffer2004-04-07 12:57:04 +0000
commitf6164cdd527b0322da085cff66c186fd53c2b83c (patch)
treedaa8ba0096501f0ea557a53caab480ada10e69f6
parent3a8b699318f2779aabadb05b5986577d6816eced (diff)
downloademacs-f6164cdd527b0322da085cff66c186fd53c2b83c.tar.gz
emacs-f6164cdd527b0322da085cff66c186fd53c2b83c.zip
(compilation-warning-face, compilation-info-face, compilation-skip-threshold)
(compilation-skip-visited, compilation-context-lines): Declare :version when added to Emacs. (compilation-error-regexp-alist-alist): Extend caml and irix. (compilation-setup): Fix if font-locked w/o font-lock-defaults. (compilation-mode-font-lock-keywords): Temporarily undo line as function patch, which wasn't ready.
-rw-r--r--lisp/ChangeLog11
-rw-r--r--lisp/progmodes/compile.el174
2 files changed, 93 insertions, 92 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 74f39d570f8..18256b09a78 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,14 @@
12004-04-07 Daniel Pfeiffer <occitan@esperanto.org>
2
3 * progmodes/compile.el (compilation-warning-face)
4 (compilation-info-face, compilation-skip-threshold)
5 (compilation-skip-visited, compilation-context-lines): Declare
6 :version when added to Emacs.
7 (compilation-error-regexp-alist-alist): Extend caml and irix.
8 (compilation-setup): Fix if font-locked w/o font-lock-defaults.
9 (compilation-mode-font-lock-keywords): Temporarily undo line as
10 function patch, which wasn't ready.
11
12004-04-07 Kenichi Handa <handa@m17n.org> 122004-04-07 Kenichi Handa <handa@m17n.org>
2 13
3 * international/latin1-disp.el (latin1-display-setup): Check each 14 * international/latin1-disp.el (latin1-display-setup): Check each
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 404494ac313..f53336c409d 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -69,8 +69,6 @@
69 69
70;;; Code: 70;;; Code:
71 71
72;; This is the parsing engine for compile:
73
74(defgroup compilation nil 72(defgroup compilation nil
75 "Run compiler as inferior of Emacs, parse error messages." 73 "Run compiler as inferior of Emacs, parse error messages."
76 :group 'tools 74 :group 'tools
@@ -169,9 +167,9 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1))
169 \\([0-9]+\\)\\(?:[) \t]\\|:[^0-9\n]\\)" 2 3 nil (1)) 167 \\([0-9]+\\)\\(?:[) \t]\\|:[^0-9\n]\\)" 2 3 nil (1))
170 168
171 (caml 169 (caml
172 "^ *File \"\\([^,\" \n\t]+\\)\", lines? \\([0-9]+\\)-?\\([0-9]+\\)?,\ 170 "^ *File \\(\"?\\)\\([^,\" \n\t<>]+\\)\\1, lines? \\([0-9]+\\)-?\\([0-9]+\\)?\\(?:$\\|,\
173\\(?: characters? \\([0-9]+\\)-?\\([0-9]+\\)?:\\)?\\([ \n]Warning:\\)?" 171\\(?: characters? \\([0-9]+\\)-?\\([0-9]+\\)?:\\)?\\([ \n]Warning:\\)?\\)"
174 1 (2 . 3) (4 . 5) (6)) 172 2 (3 . 4) (5 . 6) (7))
175 173
176 (comma 174 (comma
177 "^\"\\([^,\" \n\t]+\\)\", line \\([0-9]+\\)\ 175 "^\"\\([^,\" \n\t]+\\)\", line \\([0-9]+\\)\
@@ -189,8 +187,8 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1))
189 \\(?:warnin\\(g\\)\\|informationa\\(l\\)\\)?" 1 2 3 (4 . 5)) 187 \\(?:warnin\\(g\\)\\|informationa\\(l\\)\\)?" 1 2 3 (4 . 5))
190 188
191 (irix 189 (irix
192 "^[a-z0-9/]+: \\(?:[eE]rror\\|[wW]arnin\\(g\\)\\)[0-9 ]*:\ 190 "^[a-z0-9/]+: \\(?:[eE]rror\\|[wW]arnin\\(g\\)\\|[iI]nf\\(o\\)\\)[0-9 ]*:\
193 \\([^,\" \n\t]+\\)\\(?:, line\\|:\\) \\([0-9]+\\):" 2 3 nil (1)) 191 \\([^,\" \n\t]+\\)\\(?:, line\\|:\\) \\([0-9]+\\):" 3 4 nil (1 . 2))
194 192
195 (java 193 (java
196 "^\\(?:[ \t]+at \\|==[0-9]+== +\\(?:at\\|b\\(y\\)\\)\\).+(\\([^()\n]+\\):\\([0-9]+\\))$" 2 3 nil (1)) 194 "^\\(?:[ \t]+at \\|==[0-9]+== +\\(?:at\\|b\\(y\\)\\)\\).+(\\([^()\n]+\\):\\([0-9]+\\))$" 2 3 nil (1))
@@ -452,7 +450,8 @@ starting the compilation process.")
452 (((class color)) (:foreground "Orange" :weight bold)) 450 (((class color)) (:foreground "Orange" :weight bold))
453 (t (:weight bold))) 451 (t (:weight bold)))
454 "Face used to highlight compiler warnings." 452 "Face used to highlight compiler warnings."
455 :group 'font-lock-highlighting-faces) 453 :group 'font-lock-highlighting-faces
454 :version "21.4")
456 455
457(defface compilation-info-face 456(defface compilation-info-face
458 '((((type tty) (class color)) (:foreground "green" :weight bold)) 457 '((((type tty) (class color)) (:foreground "green" :weight bold))
@@ -460,7 +459,8 @@ starting the compilation process.")
460 (((class color) (background dark)) (:foreground "Green" :weight bold)) 459 (((class color) (background dark)) (:foreground "Green" :weight bold))
461 (t (:weight bold))) 460 (t (:weight bold)))
462 "Face used to highlight compiler warnings." 461 "Face used to highlight compiler warnings."
463 :group 'font-lock-highlighting-faces) 462 :group 'font-lock-highlighting-faces
463 :version "21.4")
464 464
465(defvar compilation-message-face nil 465(defvar compilation-message-face nil
466 "Face name to use for whole messages. 466 "Face name to use for whole messages.
@@ -649,76 +649,60 @@ Faces `compilation-error-face', `compilation-warning-face',
649 649
650(defun compilation-mode-font-lock-keywords () 650(defun compilation-mode-font-lock-keywords ()
651 "Return expressions to highlight in Compilation mode." 651 "Return expressions to highlight in Compilation mode."
652 (if compilation-parse-errors-function 652 (nconc
653 ;; An old package! Try the compatibility code. 653 ;; make directory tracking
654 '((compilation-compat-parse-errors)) 654 (if compilation-directory-matcher
655 (append 655 `((,(car compilation-directory-matcher)
656 ;; make directory tracking 656 ,@(mapcar (lambda (elt)
657 (if compilation-directory-matcher 657 `(,(car elt)
658 `((,(car compilation-directory-matcher) 658 (compilation-directory-properties
659 ,@(mapcar (lambda (elt) 659 ,(car elt) ,(cdr elt))
660 `(,(car elt) 660 t))
661 (compilation-directory-properties 661 (cdr compilation-directory-matcher)))))
662 ,(car elt) ,(cdr elt)) 662
663 t)) 663 ;; Compiler warning/error lines.
664 (cdr compilation-directory-matcher))))) 664 (mapcar (lambda (item)
665 665 (if (symbolp item)
666 ;; Compiler warning/error lines. 666 (setq item (cdr (assq item
667 (mapcar 667 compilation-error-regexp-alist-alist))))
668 (lambda (item) 668 (let ((file (nth 1 item))
669 (if (symbolp item) 669 (line (nth 2 item))
670 (setq item (cdr (assq item 670 (col (nth 3 item))
671 compilation-error-regexp-alist-alist)))) 671 (type (nth 4 item))
672 (let ((file (nth 1 item)) 672 end-line end-col fmt)
673 (line (nth 2 item)) 673 (if (consp file) (setq fmt (cdr file) file (car file)))
674 (col (nth 3 item)) 674 (if (consp line) (setq end-line (cdr line) line (car line)))
675 (type (nth 4 item)) 675 (if (consp col) (setq end-col (cdr col) col (car col)))
676 end-line end-col fmt) 676
677 (if (consp file) (setq fmt (cdr file) file (car file))) 677 `(,(nth 0 item)
678 (if (consp line) (setq end-line (cdr line) line (car line))) 678
679 (if (consp col) (setq end-col (cdr col) col (car col))) 679 ,@(when (integerp file)
680 680 `((,file ,(if (consp type)
681 (if (symbolp line) 681 `(compilation-face ',type)
682 ;; The old compile.el had here an undocumented hook that 682 (aref [compilation-info-face
683 ;; allowed `line' to be a function that computed the actual 683 compilation-warning-face
684 ;; error location. Let's do our best. 684 compilation-error-face]
685 `(,(car item) 685 (or type 2))))))
686 (0 (compilation-compat-error-properties 686
687 (funcall ',line (list* (match-string ,file) 687 ,@(when line
688 default-directory 688 `((,line compilation-line-face nil t)))
689 ',(nthcdr 4 item)) 689 ,@(when end-line
690 ,(if col `(match-string ,col))))) 690 `((,end-line compilation-line-face nil t)))
691 (,file compilation-error-face t)) 691
692 692 ,@(when col
693 `(,(nth 0 item) 693 `((,col compilation-column-face nil t)))
694 694 ,@(when end-col
695 ,@(when (integerp file) 695 `((,end-col compilation-column-face nil t)))
696 `((,file ,(if (consp type) 696
697 `(compilation-face ',type) 697 ,@(nthcdr 6 item)
698 (aref [compilation-info-face 698 (,(or (nth 5 item) 0)
699 compilation-warning-face 699 (compilation-error-properties ',file ,line ,end-line
700 compilation-error-face] 700 ,col ,end-col ',(or type 2)
701 (or type 2)))))) 701 ',fmt)
702 702 append)))) ; for compilation-message-face
703 ,@(when line 703 compilation-error-regexp-alist)
704 `((,line compilation-line-face nil t))) 704
705 ,@(when end-line 705 compilation-mode-font-lock-keywords))
706 `((,end-line compilation-line-face nil t)))
707
708 ,@(when col
709 `((,col compilation-column-face nil t)))
710 ,@(when end-col
711 `((,end-col compilation-column-face nil t)))
712
713 ,@(nthcdr 6 item)
714 (,(or (nth 5 item) 0)
715 (compilation-error-properties ',file ,line ,end-line
716 ,col ,end-col ',(or type 2)
717 ',fmt)
718 append))))) ; for compilation-message-face
719 compilation-error-regexp-alist)
720
721 compilation-mode-font-lock-keywords)))
722 706
723 707
724;;;###autoload 708;;;###autoload
@@ -1044,7 +1028,8 @@ info, are considered errors."
1044 :type '(choice (const :tag "Warnings and info" 2) 1028 :type '(choice (const :tag "Warnings and info" 2)
1045 (const :tag "Info" 1) 1029 (const :tag "Info" 1)
1046 (const :tag "None" 0)) 1030 (const :tag "None" 0))
1047 :group 'compilation) 1031 :group 'compilation
1032 :version "21.4")
1048 1033
1049(defcustom compilation-skip-visited nil 1034(defcustom compilation-skip-visited nil
1050 "*Compilation motion commands skip visited messages if this is t. 1035 "*Compilation motion commands skip visited messages if this is t.
@@ -1052,7 +1037,8 @@ Visited messages are ones for which the file, line and column have been jumped
1052to from the current content in the current compilation buffer, even if it was 1037to from the current content in the current compilation buffer, even if it was
1053from a different message." 1038from a different message."
1054 :type 'boolean 1039 :type 'boolean
1055 :group 'compilation) 1040 :group 'compilation
1041 :version "21.4")
1056 1042
1057;;;###autoload 1043;;;###autoload
1058(defun compilation-mode () 1044(defun compilation-mode ()
@@ -1129,10 +1115,6 @@ The global commands next/previous/first-error/goto-error use this.")
1129 (make-local-variable 'compilation-current-error) 1115 (make-local-variable 'compilation-current-error)
1130 (make-local-variable 'compilation-error-screen-columns) 1116 (make-local-variable 'compilation-error-screen-columns)
1131 (setq compilation-last-buffer (current-buffer)) 1117 (setq compilation-last-buffer (current-buffer))
1132 (if (and minor font-lock-defaults)
1133 (font-lock-add-keywords nil (compilation-mode-font-lock-keywords))
1134 (set (make-local-variable 'font-lock-defaults)
1135 '(compilation-mode-font-lock-keywords t)))
1136 (set (make-local-variable 'font-lock-extra-managed-props) 1118 (set (make-local-variable 'font-lock-extra-managed-props)
1137 '(directory message help-echo mouse-face debug)) 1119 '(directory message help-echo mouse-face debug))
1138 (set (make-local-variable 'compilation-locs) 1120 (set (make-local-variable 'compilation-locs)
@@ -1141,12 +1123,19 @@ The global commands next/previous/first-error/goto-error use this.")
1141 ;; jit-lock might fontify some things too late. 1123 ;; jit-lock might fontify some things too late.
1142 (set (make-local-variable 'font-lock-support-mode) nil) 1124 (set (make-local-variable 'font-lock-support-mode) nil)
1143 (set (make-local-variable 'font-lock-maximum-size) nil) 1125 (set (make-local-variable 'font-lock-maximum-size) nil)
1144 (if minor 1126 (let ((fld font-lock-defaults))
1145 (if font-lock-mode 1127 (if (and minor fld)
1146 (font-lock-fontify-buffer) 1128 (font-lock-add-keywords nil (compilation-mode-font-lock-keywords))
1147 (turn-on-font-lock)) 1129 (setq font-lock-defaults '(compilation-mode-font-lock-keywords t)))
1148 ;; maybe defer font-lock till after derived mode is set up 1130 (if minor
1149 (run-mode-hooks 'compilation-turn-on-font-lock))) 1131 (if font-lock-mode
1132 (if fld
1133 (font-lock-fontify-buffer)
1134 (font-lock-change-mode)
1135 (turn-on-font-lock))
1136 (turn-on-font-lock))
1137 ;; maybe defer font-lock till after derived mode is set up
1138 (run-mode-hooks 'compilation-turn-on-font-lock))))
1150 1139
1151;;;###autoload 1140;;;###autoload
1152(define-minor-mode compilation-shell-minor-mode 1141(define-minor-mode compilation-shell-minor-mode
@@ -1486,7 +1475,8 @@ This operates on the output from the \\[compile] command."
1486(defcustom compilation-context-lines next-screen-context-lines 1475(defcustom compilation-context-lines next-screen-context-lines
1487 "*Display this many lines of leading context before message." 1476 "*Display this many lines of leading context before message."
1488 :type 'integer 1477 :type 'integer
1489 :group 'compilation) 1478 :group 'compilation
1479 :version "21.4")
1490 1480
1491(defsubst compilation-set-window (w mk) 1481(defsubst compilation-set-window (w mk)
1492 ;; Align the compilation output window W with marker MK near top. 1482 ;; Align the compilation output window W with marker MK near top.