emacs-devel
[Top][All Lists]
Advanced

[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 2.0.0.22 (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
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





reply via email to

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