[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Customizing the mode line

From: M Jared Finder
Subject: Re: Customizing the mode line
Date: Sat, 31 Oct 2009 10:46:23 -0700
User-agent: Mozilla-Thunderbird (X11/20090707)

Eli Zaretskii wrote:
From: Richard Stallman <address@hidden>
CC: address@hidden
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

??? 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):

 #("-" 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"))
 (vc-mode vc-mode)
 #("  " 0 2
(help-echo "mouse-1: select (drag to resize), mouse-2 = C-x 1, mouse-3 = C-x 0"))
  ("" which-func-format
   #("--" 0 2
(help-echo "mouse-1: select (drag to resize), mouse-2 = C-x 1, mouse-3 = C-x 0"))))
  (#("--" 0 2
(help-echo "mouse-1: select (drag to resize), mouse-2 = C-x 1, mouse-3 = C-x 0"))
 #("-%-" 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:

 (:propertize "-" (mode-line-default-props))
 (:propertize "    " (mode-line-default-props))
 (: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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]