Index: progmodes/compile.el =================================================================== RCS file: /sources/emacs/emacs/lisp/progmodes/compile.el,v retrieving revision 1.439 diff -u -B -w -r1.439 compile.el --- progmodes/compile.el 7 Aug 2007 20:10:14 -0000 1.439 +++ progmodes/compile.el 13 Aug 2007 00:08:38 -0000 @@ -1405,7 +1405,8 @@ (turn-on-font-lock))) (setq font-lock-defaults '(compilation-mode-font-lock-keywords t)) ;; maybe defer font-lock till after derived mode is set up - (run-mode-hooks 'compilation-turn-on-font-lock))) + (when font-lock-mode + (run-mode-hooks 'compilation-turn-on-font-lock)))) ;;;###autoload (define-minor-mode compilation-shell-minor-mode Index: progmodes/grep.el =================================================================== RCS file: /sources/emacs/emacs/lisp/progmodes/grep.el,v retrieving revision 1.76 diff -u -B -w -r1.76 grep.el --- progmodes/grep.el 26 Jul 2007 05:27:27 -0000 1.76 +++ progmodes/grep.el 13 Aug 2007 00:08:38 -0000 @@ -356,7 +356,7 @@ Set up `compilation-exit-message-function' and run `grep-setup-hook'." (unless (or (not grep-highlight-matches) (eq grep-highlight-matches t)) (grep-compute-defaults)) - (when (eq grep-highlight-matches t) + (when (and font-lock-mode (eq grep-highlight-matches t)) ;; Modify `process-environment' locally bound in `compilation-start' (setenv "GREP_OPTIONS" (concat (getenv "GREP_OPTIONS") " --color=always")) ;; for GNU grep 2.5.1