[comp.emacs] Mode line customization in GNU-emacs

tjo@cadillac.UUCP (Tom Ostrand) (05/29/87)

 Can anyone tell me how to arbitrarily rewrite the mode line for a 
 GNU-macs window?  Or at least, what are the most extensive changes
 that can be made to the mode line?  All I can find in the manual is 
 control over the inverse-video.

 Thanks, 
   
Tom Ostrand
Siemens Research Labs.
Princeton, NJ
{astrovax | ihnp4 | princeton}!siemens!tjo
(609)-734-6569

nz@hotlg.UUCP (06/02/87)

In article <419@jaguar.cadillac.UUCP> tjo@siemens.UUCP writes:
 > 
 >  Can anyone tell me how to arbitrarily rewrite the mode line for a 
 >  GNU-macs window?  Or at least, what are the most extensive changes
 >  that can be made to the mode line?  
 >  Thanks, 
 >    
 > Tom Ostrand

You can completely reconfigure the mode line in just about
any version of GNU Emacs.  Versions 17 and earlier use a printf-like
format string for mode line control, and you set the Elisp variable
named "mode-line-format" to a string value.  In version 18, the mode
line may be configured by setting up an list structure of strings,
variables, cons-cells, and other stuff, then assigning that structure
to the variable named "mode-line-format".  It is somewhat backward-
compatible with the old string format.

The default value of mode-line-format (in 18.36) is:

  ("--%1*%1*-"
   mode-line-buffer-identification "   " global-mode-string
   "   %[(" mode-name minor-mode-alist
   "%n" mode-line-process ")%]----"
   (-3 . "%p") "-%-")

Another value I like to use is:

  ("--%*%*-" "Emacs " (-10 . global-mode-string)
   " " "(%[" mode-name minor-mode-alist "%n" mode-line-process
   "%])   %b: " (-16 . "%f") "  ---" (-3 . "%p") "-%-")

This one looks a little like the old default format that our DEC-20's
Emacs used to provide.

For more information, see the documentation for the "mode-line-format"
variable.  If your help character is control-H, do 

	C-h v mode-line-format RETURN

Hope this is helpful.
-- 
...nz  (Neal Ziring  @  ATT-BL Holmdel, x2354, 3H-437)
	"You can fit an infinite number of wires into this junction box,
	but we usually don't go that far in practice."
					London Electric Co. Worker, 1880s