]> git.eshelyaron.com Git - emacs.git/commitdiff
Require CL.
authorStefan Monnier <monnier@iro.umontreal.ca>
Wed, 7 Apr 2004 19:34:11 +0000 (19:34 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Wed, 7 Apr 2004 19:34:11 +0000 (19:34 +0000)
(compilation-mode-font-lock-keywords): Re-install the "line as function" patch.

lisp/progmodes/compile.el

index f53336c409d38b040fad38fc69512936992e3221..e1c64392e755c6f348c336dc1fb1ce8058207fcc 100644 (file)
 ;; These are the value of the `message' text-properties in the compilation
 ;; buffer.
 
-
 ;;; Code:
 
+(eval-when-compile (require 'cl))
+
 (defgroup compilation nil
   "Run compiler as inferior of Emacs, parse error messages."
   :group 'tools
@@ -673,33 +674,45 @@ Faces `compilation-error-face', `compilation-warning-face',
               (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))))))
-
-                ,@(when line
-                    `((,line compilation-line-face nil t)))
-                ,@(when end-line
-                    `((,end-line compilation-line-face nil t)))
-
-                ,@(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
+         
+              (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 (integerp file)
+                      `((,file ,(if (consp type)
+                                    `(compilation-face ',type)
+                                  (aref [compilation-info-face
+                                         compilation-warning-face
+                                         compilation-error-face]
+                                        (or type 2))))))
+
+                  ,@(when line
+                      `((,line compilation-line-face nil t)))
+                  ,@(when end-line
+                      `((,end-line compilation-line-face nil t)))
+
+                  ,@(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))