# HG changeset patch # User Stefan Monnier # Date 1081366451 0 # Node ID bdc00a83ecd1fb17a424df39afcc67a03101b54e # Parent effb507b52584f8df24b892f89e78b2c9be4cde0 Require CL. (compilation-mode-font-lock-keywords): Re-install the "line as function" patch. diff -r effb507b5258 -r bdc00a83ecd1 lisp/progmodes/compile.el --- a/lisp/progmodes/compile.el Wed Apr 07 19:18:42 2004 +0000 +++ b/lisp/progmodes/compile.el Wed Apr 07 19:34:11 2004 +0000 @@ -66,8 +66,9 @@ ;; These are the value of the `message' text-properties in the compilation ;; buffer. +;;; Code: -;;; Code: +(eval-when-compile (require 'cl)) (defgroup compilation nil "Run compiler as inferior of Emacs, parse error messages." @@ -673,33 +674,45 @@ (if (consp file) (setq fmt (cdr file) file (car file))) (if (consp line) (setq end-line (cdr line) line (car line))) (if (consp col) (setq end-col (cdr col) col (car col))) - - `(,(nth 0 item) - - ,@(when (integerp file) - `((,file ,(if (consp type) - `(compilation-face ',type) - (aref [compilation-info-face - compilation-warning-face - compilation-error-face] - (or type 2)))))) + + (if (symbolp line) + ;; The old compile.el had here an undocumented hook that + ;; allowed `line' to be a function that computed the actual + ;; error location. Let's do our best. + `(,(car item) + (0 (compilation-compat-error-properties + (funcall ',line (list* (match-string ,file) + default-directory + ',(nthcdr 4 item)) + ,(if col `(match-string ,col))))) + (,file compilation-error-face t)) + + `(,(nth 0 item) - ,@(when line - `((,line compilation-line-face nil t))) - ,@(when end-line - `((,end-line compilation-line-face nil t))) + ,@(when (integerp file) + `((,file ,(if (consp type) + `(compilation-face ',type) + (aref [compilation-info-face + compilation-warning-face + compilation-error-face] + (or type 2)))))) - ,@(when col - `((,col compilation-column-face nil t))) - ,@(when end-col - `((,end-col compilation-column-face nil t))) + ,@(when line + `((,line compilation-line-face nil t))) + ,@(when end-line + `((,end-line compilation-line-face nil t))) - ,@(nthcdr 6 item) - (,(or (nth 5 item) 0) - (compilation-error-properties ',file ,line ,end-line - ,col ,end-col ',(or type 2) - ',fmt) - append)))) ; for compilation-message-face + ,@(when col + `((,col compilation-column-face nil t))) + ,@(when end-col + `((,end-col compilation-column-face nil t))) + + ,@(nthcdr 6 item) + (,(or (nth 5 item) 0) + (compilation-error-properties ',file ,line ,end-line + ,col ,end-col ',(or type 2) + ',fmt) + append))))) ; for compilation-message-face compilation-error-regexp-alist) compilation-mode-font-lock-keywords))