From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dan Nicolaescu Newsgroups: gmane.emacs.devel Subject: use faces on the mode-line for compile.el Date: Sat, 23 Feb 2008 15:59:14 -0800 Message-ID: <200802232359.m1NNxFpa025055@sallyv1.ics.uci.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1203811302 8264 80.91.229.12 (24 Feb 2008 00:01:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 24 Feb 2008 00:01:42 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Feb 24 01:02:07 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JT4Ji-0003t5-Dy for ged-emacs-devel@m.gmane.org; Sun, 24 Feb 2008 01:02:06 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JT4JC-0003XF-Lq for ged-emacs-devel@m.gmane.org; Sat, 23 Feb 2008 19:01:34 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JT4J7-0003X7-Qt for emacs-devel@gnu.org; Sat, 23 Feb 2008 19:01:29 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JT4J6-0003Ws-AC for emacs-devel@gnu.org; Sat, 23 Feb 2008 19:01:28 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JT4J6-0003Wo-4a for emacs-devel@gnu.org; Sat, 23 Feb 2008 19:01:28 -0500 Original-Received: from sallyv1.ics.uci.edu ([128.195.1.109]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA1:24) (Exim 4.60) (envelope-from ) id 1JT4J5-0006gG-NS for emacs-devel@gnu.org; Sat, 23 Feb 2008 19:01:27 -0500 X-ICS-MailScanner-Watermark: 1204415956.68447@9mUzbdu1VEVLYSzrtEeE/Q Original-Received: from mothra.ics.uci.edu (mothra.ics.uci.edu [128.195.6.93]) by sallyv1.ics.uci.edu (8.13.7+Sun/8.13.7) with ESMTP id m1NNxFpa025055 for ; Sat, 23 Feb 2008 15:59:15 -0800 (PST) Original-Lines: 79 X-ICS-MailScanner: Found to be clean X-ICS-MailScanner-SpamCheck: not spam, SpamAssassin (score=-1.44, required 5, autolearn=disabled, ALL_TRUSTED -1.44) X-ICS-MailScanner-From: dann@mothra.ics.uci.edu X-detected-kernel: by monty-python.gnu.org: Solaris 10 (beta) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:90184 Archived-At: I posted this 2 years ago, but that was during the pretest, so let's look at this again. If the mode-line for the compilation buffer would be a bit more visible it would be easier to see if a compilation is still running (which is handy if you have compilations that take a long time and don't want to spend too much time checking if it's done). Also if the compilation fails it's nice to be able to see it faster. It can be seen with just the peripheral vision, or from farther away from the screen. A simple patch can accomplish the above. It uses font-lock-warning-face which is designed to be highly visible. IMO this is a very nice feature to have, and simple to implement... Thoughts? *** compile.el 04 Apr 2006 09:50:37 -0700 1.394 --- compile.el 19 Apr 2006 22:54:58 -0700 *************** *** 1060,1066 **** (start-process-shell-command (downcase mode-name) outbuf command)))) ;; Make the buffer's mode line show process state. ! (setq mode-line-process '(":%s")) (set-process-sentinel proc 'compilation-sentinel) (set-process-filter proc 'compilation-filter) (set-marker (process-mark proc) (point) outbuf) --- 1060,1066 ---- (start-process-shell-command (downcase mode-name) outbuf command)))) ;; Make the buffer's mode line show process state. ! (setq mode-line-process (list (propertize ":%s" 'face 'font-lock-warning-face))) (set-process-sentinel proc 'compilation-sentinel) (set-process-filter proc 'compilation-filter) (set-marker (process-mark proc) (point) outbuf) *************** *** 1074,1080 **** ;; No asynchronous processes available. (message "Executing `%s'..." command) ;; Fake modeline display as if `start-process' were run. ! (setq mode-line-process ":run") (force-mode-line-update) (sit-for 0) ; Force redisplay (let* ((buffer-read-only nil) ; call-process needs to modify outbuf --- 1074,1080 ---- ;; No asynchronous processes available. (message "Executing `%s'..." command) ;; Fake modeline display as if `start-process' were run. ! (setq mode-line-process (propertize ":run" 'face 'font-lock-warning-face)) (force-mode-line-update) (sit-for 0) ; Force redisplay (let* ((buffer-read-only nil) ; call-process needs to modify outbuf *************** *** 1403,1409 **** ;; 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))) ;; Force mode line redisplay soon. (force-mode-line-update) (if (and opoint (< opoint omax)) --- 1403,1415 ---- ;; 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 ! (concat (format ":%s " process-status) ! (format (if (> exit-status 0) ! (propertize "[%s]" 'face 'font-lock-warning-face) ! "[%s]") ! (cdr status)))) ! (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))