From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.devel Subject: Re: M-x compile should tell its status (a little bit better).. Date: Fri, 23 Apr 2004 12:01:55 -0600 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <40895A13.4020300@yahoo.com> References: <24608.217.194.34.123.1082528157.squirrel@wwws.franken.de> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1082744056 10595 80.91.224.253 (23 Apr 2004 18:14:16 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 23 Apr 2004 18:14:16 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Fri Apr 23 20:14:07 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BH5Bf-0003Wg-00 for ; Fri, 23 Apr 2004 20:14:07 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BH5Bf-0002rJ-00 for ; Fri, 23 Apr 2004 20:14:07 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1BH51G-0008Hq-VK for emacs-devel@quimby.gnus.org; Fri, 23 Apr 2004 14:03:22 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1BH50t-0008Fp-7M for emacs-devel@gnu.org; Fri, 23 Apr 2004 14:02:59 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1BH50M-00087P-BJ for emacs-devel@gnu.org; Fri, 23 Apr 2004 14:02:57 -0400 Original-Received: from [80.91.224.249] (helo=main.gmane.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1BH4zi-0007ur-Ln for emacs-devel@gnu.org; Fri, 23 Apr 2004 14:01:46 -0400 Original-Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1BH4zg-0000Fs-00 for ; Fri, 23 Apr 2004 20:01:44 +0200 Original-Received: from 170.207.51.80 ([170.207.51.80]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 23 Apr 2004 20:01:44 +0200 Original-Received: from ihs_4664 by 170.207.51.80 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 23 Apr 2004 20:01:44 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-To: emacs-devel@gnu.org Original-Lines: 44 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 170.207.51.80 User-Agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2 X-Accept-Language: en-us X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:22079 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:22079 Richard Stallman wrote: > Right know when starting compile it shows "Compiling" in the mode line. > When i started several compilations in parallel i found it confusing that > i could not find out if one of them has already finished. Execpt by > switching to that buffer and looking at its mode line... > So how about to change compile to reflect that info in its mode name so > > Could you say more precisely what change you have in mind > in the mode line contents? I think the idea is not to change the mode line, but to change the mode name so that the status is apparent from `M-x list-buffers'. I think the following provides the desired effect, but it's just for illustration: (defvar compilation-mode-name nil) ;; change `after' to `before', to avoid stomping on compilation-handle-exit: (defadvice compilation-sentinel (after mode-name activate) "Set `mode-name' instead of `mode-line-process' to reflect the PROCess status." (let ((buffer (process-buffer (ad-get-arg 0))) (status (process-status (ad-get-arg 0)))) (when (buffer-live-p buffer) (save-excursion (set-buffer buffer) ;; save the original mode name: (unless compilation-mode-name (set (make-local-variable 'compilation-mode-name) mode-name)) ;; construct a mode name from the original plus the status: (setq mode-name (format "%s:%s)" compilation-mode-name status)) ;; remove redundant status from the mode line: (setq mode-line-process nil))))) (defadvice compile-internal (after compilation-sentinel activate) "Call `compilation-sentinel' to set `mode-name'." (compilation-sentinel (get-buffer-process compilation-last-buffer) "started")) -- Kevin Rodgers