www.delorie.com/gnu/docs/emacs/mh-e_46.html   search  
 
Buy the book!


mh-e

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3. Customizing mh-e

Until now, we've talked about the mh-e commands as they work "out of the box." Of course, it is also possible to reconfigure mh-e to fit the needs of even the most demanding user. The following sections describe all of the customization variables, show the defaults, and make recommendations for customization. The outline of this chapter is identical to that of 2. Using mh-e, to make it easier to find the variables you'd need to modify to affect a particular command.

However, when customizing your mail environment, first try to change what you want in MH, and only change mh-e if changing MH is not possible. That way you will get the same behavior inside and outside GNU Emacs. Note that mh-e does not provide hooks for customizations that can be done in MH; this omission is intentional.

Many string or integer variables are easy enough to modify using Emacs Lisp. Any such modifications should be placed in a file called `.emacs' in your home directory (that is, `~/.emacs'). For example, to modify the variable that controls printing, you could add:

 
(setq mh-lpr-command-format "nenscript -G -r -2 -i'%s'")

3.4.4 Printing Your Mail talks more about this variable.

Variables can also hold Boolean values. In Emacs Lisp, the Boolean values are nil, which means false, and t, which means true. Usually, variables are turned off by setting their value to nil, as in

 
(setq mh-bury-show-buffer nil)

which keeps the MH-Show buffer at the top of the buffer stack. To turn a variable on, you use

 
(setq mh-bury-show-buffer t)

which places the MH-Show buffer at the bottom of the buffer stack. However, the text says to turn on a variable by setting it to a non-nil value, because sometimes values other than t are meaningful (for example, see mhl-formfile, described in 3.1.1 Viewing Your Mail). Other variables, such as hooks, involve a little more Emacs Lisp programming expertise.

You can also "preview" the effects of changing variables before committing the changes to `~/.emacs'. Variables can be changed in the current Emacs session by using M-x set-variable.

In general, commands in this text refer to Emacs Lisp functions. Programs outside of Emacs are specifically called MH commands, shell commands, or Unix commands.

I hope I've included enough examples here to get you well on your way. If you want to explore Emacs Lisp further, a programming manual does exist, (14) and you can look at the code itself for examples. Look in the Emacs Lisp directory on your system (such as `/usr/local/lib/emacs/lisp') and find all the `mh-*.el' files there. When calling mh-e and other Emacs Lisp functions directly from Emacs Lisp code, you'll need to know the correct arguments. Use the online help for this. For example, try C-h f mh-execute-commands RET. If you write your own functions, please do not prefix your symbols (variables and functions) with mh-. This prefix is reserved for the mh-e package. To avoid conflicts with existing mh-e symbols, use a prefix like my- or your initials.

3.1 Reading Your Mail  
3.2 Sending Mail  
3.3 Editing a Draft  
3.4 Moving Your Mail Around  
3.5 Searching Through Messages  


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

  webmaster   donations   bookstore     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003