Previous: Navigating, Up: Reading Mail

6.9 Miscellaneous Commands and Options

This section contains a few more miscellaneous commands and options.

There are times when you need to edit a message. For example, you may need to fix a broken Content-Type header field. You can do this with the command M (mh-modify). It displays the raw message in an editable buffer. When you are done editing, save and kill the buffer as you would any other.

Commands such as mh-pack-folder prompt to confirm whether to process outstanding moves and deletes or not before continuing. Turning on the option mh-do-not-confirm-flag means that these actions will be performed—which is usually desired but cannot be retracted—without question1.

The option mh-summary-height controls the number of scan lines displayed in the MH-Folder window, including the mode line. The default value of this option is ‘Automatic’ which means that the MH-Folder buffer will maintain the same proportional size if the frame is resized. If you'd prefer a fixed height, then choose the ‘Fixed Size’ option and enter the number of lines you'd like to see.

Normally the buffer for displaying messages is buried at the bottom at the buffer stack. You may wish to disable this feature by turning off the option mh-bury-show-buffer-flag. One advantage of not burying the show buffer is that one can delete the show buffer more easily in an electric buffer list because of its proximity to its associated MH-Folder buffer. Try running M-x electric-buffer-list to see what I mean.

Before we leave this section, I'll include a function that I use as a front end to MH-E2. It toggles between your working window configuration, which may be quite involved—windows filled with source, compilation output, man pages, and other documentation—and your MH-E window configuration. Like the rest of the customization described in this section, simply add the following code to ~/.emacs.

     (defvar my-mh-screen-saved nil
       "Set to non-nil when MH-E window configuration shown.")
     (defvar my-normal-screen nil "Normal window configuration.")
     (defvar my-mh-screen nil "MH-E window configuration.")
     (defun my-mh-rmail (&optional arg)
       "Toggle between MH-E and normal screen configurations.
     With non-nil or prefix argument, inc mailbox as well
     when going into mail."
       (interactive "P")                 ; user callable function, P=prefix arg
       (setq my-mh-screen-saved          ; save state
              ;; Bring up MH-E screen if arg or normal window configuration.
              ;; If arg or +inbox buffer doesn't exist, run mh-rmail.
              ((or arg (null my-mh-screen-saved))
               (setq my-normal-screen (current-window-configuration))
               (if (or arg (null (get-buffer "+inbox")))
                 (set-window-configuration my-mh-screen))
               t)                        ; set my-mh-screen-saved to t
              ;; Otherwise, save MH-E screen and restore normal screen.
               (setq my-mh-screen (current-window-configuration))
               (set-window-configuration my-normal-screen)
               nil))))                   ; set my-mh-screen-saved to nil
     (global-set-key "\C-x\r" 'my-mh-rmail)  ; call with C-x <RET>
     Starting MH-E

If you type an argument (C-u) or if my-mh-screen-saved is nil (meaning a non-MH-E window configuration), the current window configuration is saved, either the ‘+inbox’ buffer is displayed or mh-rmail is run, and the MH-E window configuration is shown. Otherwise, the MH-E window configuration is saved and the original configuration is displayed.


[1] In previous versions of MH-E, this option suppressed the confirmation in mh-kill-folder. Since this kept most users from setting this option, mh-kill-folder was modified in version 6.0 to always ask for confirmation subject to mh-kill-folder-suppress-prompt-hook. See Folders.

[2] Stephen Gildea's favorite binding is (global-set-key "\C-cr" 'mh-rmail).