Note: HTML conversion may not be complete.
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 beyond recognition. 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 the Chapter 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'")The Section 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, one uses
(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-\fBnil\fP value, because sometimes values other than t are meaningful (for example, see mhl-formfile, described in the Section Viewing Your Mail). Other variables, such as hooks, involve a little more Emacs Lisp programming expertise.
You can "preview" the effects of these settings by running these commands from within Emacs. To do this, type ESC ESC and you'll be greeted by an Eval: prompt in the minibuffer. Now type in the Lisp expression as you would in ~/.emacs.
NOTE: If you haven't used the minibuffer to run Emacs Lisp code (in contrast to using M-x), you may be told it is a disabled command. In this case, type y so that code will be added to ~/.emacs so that you'll be able to use ESC ESC in the future without being warned.
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, 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. A programming manual does exist; the Emacs Lisp Reference Manual may be available online in the Info system by typing C-h i m Emacs Lisp RET. You can also order a printed manual, which has the desirable side-effect of helping to support the Free Software Foundation which made all this great software available. You can find an order form by running C-h C-d within Emacs, or you can request an order form from email@example.com.
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. All of the variables and their defaults that are documented here are summarized in the mh-e Reference Guide.
[Table of Contents] [Index] [Previous: Customizing mh-e] [Next: Reading Your Mail]
This file is from the third edition of the book MH & xmh: Email for Users & Programmers, ISBN 1-56592-093-7, by Jerry Peek. Copyright © 1991, 1992, 1995 by O'Reilly & Associates, Inc. This file is freely-available; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation. For more information, see the file copying.htm.
Suggestions are welcome: Bill Wohler <firstname.lastname@example.org>