changeset 92160:a4731dee1c1f

(compilation-start): Specify a face for mode-line-process. (compilation-handle-exit): Specify a face and a tooltip for mode-line-process.
author Dan Nicolaescu <dann@ics.uci.edu>
date Sun, 24 Feb 2008 20:44:24 +0000
parents 9ed7610349d3
children 4be0bf41fa98
files lisp/ChangeLog lisp/progmodes/compile.el
diffstat 2 files changed, 18 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Sun Feb 24 18:53:07 2008 +0000
+++ b/lisp/ChangeLog	Sun Feb 24 20:44:24 2008 +0000
@@ -1,3 +1,10 @@
+2008-02-24  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	* progmodes/compile.el (compilation-start): Specify a face for
+	mode-line-process.
+	(compilation-handle-exit): Specify a face and a tooltip for
+	mode-line-process.
+
 2008-02-24  Stefan Monnier  <monnier@iro.umontreal.ca>
 
 	* hilit-chg.el: Remove spurious * in defcustom docstrings.
--- a/lisp/progmodes/compile.el	Sun Feb 24 18:53:07 2008 +0000
+++ b/lisp/progmodes/compile.el	Sun Feb 24 20:44:24 2008 +0000
@@ -1248,7 +1248,8 @@
 		 (start-file-process-shell-command (downcase mode-name)
 						   outbuf command))))
 	  ;; Make the buffer's mode line show process state.
-	  (setq mode-line-process '(":%s"))
+	  (setq mode-line-process 
+		(list (propertize ":%s" 'face 'compilation-warning)))
 	  (set-process-sentinel proc 'compilation-sentinel)
 	  (set-process-filter proc 'compilation-filter)
 	  ;; Use (point-max) here so that output comes in
@@ -1546,7 +1547,15 @@
     ;; Prevent that message from being recognized as a compilation error.
     (add-text-properties omax (point)
 			 (append '(compilation-handle-exit t) nil))
-    (setq mode-line-process (format ":%s [%s]" process-status (cdr status)))
+    (setq mode-line-process
+	  (let ((out-string (format ":%s [%s]" process-status (cdr status)))
+		(tooltip (buffer-substring-no-properties (1+ omax) (point))))
+	    (propertize
+	     out-string
+	     'help-echo tooltip
+	     'face
+	     (if (> exit-status 0) 'font-lock-warning-face 'compilation-info))))
+    (message (format "exit status: %s %s" exit-status (> 0 exit-status)))
     ;; Force mode line redisplay soon.
     (force-mode-line-update)
     (if (and opoint (< opoint omax))