Mercurial > emacs
comparison lisp/progmodes/compile.el @ 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 | f991f10f15ec |
children | cdf4278cefa8 |
comparison
equal
deleted
inserted
replaced
92159:9ed7610349d3 | 92160:a4731dee1c1f |
---|---|
1246 shell-file-name) | 1246 shell-file-name) |
1247 nil `("-c" ,command)))) | 1247 nil `("-c" ,command)))) |
1248 (start-file-process-shell-command (downcase mode-name) | 1248 (start-file-process-shell-command (downcase mode-name) |
1249 outbuf command)))) | 1249 outbuf command)))) |
1250 ;; Make the buffer's mode line show process state. | 1250 ;; Make the buffer's mode line show process state. |
1251 (setq mode-line-process '(":%s")) | 1251 (setq mode-line-process |
1252 (list (propertize ":%s" 'face 'compilation-warning))) | |
1252 (set-process-sentinel proc 'compilation-sentinel) | 1253 (set-process-sentinel proc 'compilation-sentinel) |
1253 (set-process-filter proc 'compilation-filter) | 1254 (set-process-filter proc 'compilation-filter) |
1254 ;; Use (point-max) here so that output comes in | 1255 ;; Use (point-max) here so that output comes in |
1255 ;; after the initial text, | 1256 ;; after the initial text, |
1256 ;; regardless of where the user sees point. | 1257 ;; regardless of where the user sees point. |
1544 (insert " at " (substring (current-time-string) 0 19)) | 1545 (insert " at " (substring (current-time-string) 0 19)) |
1545 (goto-char (point-max)) | 1546 (goto-char (point-max)) |
1546 ;; Prevent that message from being recognized as a compilation error. | 1547 ;; Prevent that message from being recognized as a compilation error. |
1547 (add-text-properties omax (point) | 1548 (add-text-properties omax (point) |
1548 (append '(compilation-handle-exit t) nil)) | 1549 (append '(compilation-handle-exit t) nil)) |
1549 (setq mode-line-process (format ":%s [%s]" process-status (cdr status))) | 1550 (setq mode-line-process |
1551 (let ((out-string (format ":%s [%s]" process-status (cdr status))) | |
1552 (tooltip (buffer-substring-no-properties (1+ omax) (point)))) | |
1553 (propertize | |
1554 out-string | |
1555 'help-echo tooltip | |
1556 'face | |
1557 (if (> exit-status 0) 'font-lock-warning-face 'compilation-info)))) | |
1558 (message (format "exit status: %s %s" exit-status (> 0 exit-status))) | |
1550 ;; Force mode line redisplay soon. | 1559 ;; Force mode line redisplay soon. |
1551 (force-mode-line-update) | 1560 (force-mode-line-update) |
1552 (if (and opoint (< opoint omax)) | 1561 (if (and opoint (< opoint omax)) |
1553 (goto-char opoint)) | 1562 (goto-char opoint)) |
1554 (with-no-warnings | 1563 (with-no-warnings |