From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: M Jared Finder Newsgroups: gmane.emacs.devel Subject: Re: Customizing the mode line Date: Sat, 31 Oct 2009 10:46:23 -0700 Message-ID: References: <83skd1dta0.fsf@gnu.org> <837huberca.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1257011228 31610 80.91.229.12 (31 Oct 2009 17:47:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 31 Oct 2009 17:47:08 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Oct 31 18:47:02 2009 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 1N4I2W-0000eh-Vl for ged-emacs-devel@m.gmane.org; Sat, 31 Oct 2009 18:47:01 +0100 Original-Received: from localhost ([127.0.0.1]:34844 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N4I2W-00020B-8T for ged-emacs-devel@m.gmane.org; Sat, 31 Oct 2009 13:47:00 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N4I2Q-0001zy-C4 for emacs-devel@gnu.org; Sat, 31 Oct 2009 13:46:54 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N4I2M-0001zW-QE for emacs-devel@gnu.org; Sat, 31 Oct 2009 13:46:54 -0400 Original-Received: from [199.232.76.173] (port=38836 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N4I2M-0001zT-Jq for emacs-devel@gnu.org; Sat, 31 Oct 2009 13:46:50 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:38899) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1N4I2M-0002Ud-1S for emacs-devel@gnu.org; Sat, 31 Oct 2009 13:46:50 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.50) id 1N4I2I-0000ag-Pt for emacs-devel@gnu.org; Sat, 31 Oct 2009 18:46:46 +0100 Original-Received: from c-98-248-42-158.hsd1.ca.comcast.net ([98.248.42.158]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 31 Oct 2009 18:46:46 +0100 Original-Received: from jared by c-98-248-42-158.hsd1.ca.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 31 Oct 2009 18:46:46 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 92 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: c-98-248-42-158.hsd1.ca.comcast.net User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090707) In-Reply-To: <837huberca.fsf@gnu.org> X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) 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:116520 Archived-At: Eli Zaretskii wrote: >> From: Richard Stallman >> CC: emacs-devel@gnu.org >> Date: Sat, 31 Oct 2009 07:07:44 -0400 >> >> I don't think that a better UI for customizing the mode line is a >> really important place to improve. Customizing it is not that hard to >> do. > > ??? Really? Then please describe how to do that. What user options > are available for that, and what values one should give them for the > following use-cases: The first two are easy. > . Show only the major mode, not the minor modes. (setq minor-mode-alist nil) or customize mode-line-modes > . Remove the percent/All/Top/Bot part. Remove the first two entries of mode-line-position > . Display the load-average and the Mail notification between the line > number and the major/minor mode indicator. Reordering the mode line is much harder (and would be greatly appreciated by me). I think if you cleaned up mode-line-format so that it only included VARIABLES, then this would be clear as day. Right now mode-line-format's default value is big and scary (note, from Emacs22): ("%e" #("-" 0 1 (help-echo "mouse-1: select (drag to resize), mouse-2 = C-x 1, mouse-3 = C-x 0")) mode-line-mule-info mode-line-modified mode-line-frame-identification mode-line-buffer-identification #(" " 0 3 (help-echo "mouse-1: select (drag to resize), mouse-2 = C-x 1, mouse-3 = C-x 0")) mode-line-position (vc-mode vc-mode) #(" " 0 2 (help-echo "mouse-1: select (drag to resize), mouse-2 = C-x 1, mouse-3 = C-x 0")) mode-line-modes (which-func-mode ("" which-func-format #("--" 0 2 (help-echo "mouse-1: select (drag to resize), mouse-2 = C-x 1, mouse-3 = C-x 0")))) (global-mode-string (#("--" 0 2 (help-echo "mouse-1: select (drag to resize), mouse-2 = C-x 1, mouse-3 = C-x 0")) global-mode-string)) #("-%-" 0 3 (help-echo "mouse-1: select (drag to resize), mouse-2 = C-x 1, mouse-3 = C-x 0"))) You could clean this up to be a lot clearer. Part of it is the pretty printer is doing an awful job, part of it is the explicit propertized strings. Imagine if it was like this: (mode-line-mem-info (:propertize "-" (mode-line-default-props)) mode-line-mule-info mode-line-modified mode-line-frame-identification (:propertize " " (mode-line-default-props)) mode-line-position mode-line-vc-info mode-line-modes mode-line-which-func-info global-mode-string (:propertize "-%-" (mode-line-default-props))) And then you could expose this in Customize as a reorder-able list! In short, I have four proposals: 1. Change mode-line-format to not include ANY explicitly propertized strings. Use :eval and :propertize. 2. Remove condition branching in mode-line-format. Just variables with formatting info should be there, put the branching in those variables. 3. Change the pretty-printer used by C-h v to somehow recognize that mode-line-format should be formatted with a newline after every element. 4. Change the customize option for mode-line-format to display it as a reorderable list, like c-mode-hook. -- MJF