As the Section Editing the Draft with prompter explained, after the comp, repl, forw, and dist commands create the draft message, they start the prompter editor. And as you saw in the Section on whatnow, typing What now? edit gives you a default editor. The following sections explain how to change these defaults.
You set the default editor with entries in your MH profile. For example, let's say that you have these three entries in your MH profile:
prompter-next: vi vi-next: spell spell-next: viThese tell MH that after you run prompter the default editor is vi, and that after vi the default editor is spell. Finally, after you run spell the default editor is vi again. So when you use comp (which runs prompter for you, unless you've changed that), you can go into vi directly by typing edit (or just e) at the What now? prompt. At the next What now? prompt, the default editor will be spell. Here's a demonstration:
% comp To: someone cc: Subject: something ------- blah blah blah... ^D ------- What now? e ...vi starts... What now? e ...spell puts a list of words on the screen... What now? e ...vi starts... What now? e ...spell checks the just-edited message... What now? sOf course, you don't have to use the default editor. You can use any other editor by typing its name after the edit (e) command.
If you never want comp, repl, forw, and dist to use the prompter editor, put an entry like this in your MH profile:
Editor: whateverwhere whatever is the editor you want -- vi, for example. Then, when you start comp, repl, forw, or dist, it will put you straight into vi. When you save the message and exit the editor (in vi, type ZZ), you'll be at the What now? prompt.
But prompter can be pretty handy for entering header fields when you use comp and dist, for example. To choose different editors for different commands, use their -editor switches.
Let's assume that your default editor is prompter (if you have not added an Editor: entry to your MH profile, as shown above). Then you can set the repl and forw entries in your MH profile to use emacs -- and leave prompter as the other programs' default:
repl: -editor emacs forw: -editor emacsOr, let's say that you want to use vi as the default editor for everything except dist (which really doesn't need a sophisticated editor). Put these two entries in your MH profile:
Editor: vi dist: -editor prompterThe editor script named distprompter is designed to be used with dist.
By the way, if you set vi as the default editor, here's a handy key map command for vi:
map! ^N ^[/: $^[AThe key map sets vi so that typing CTRL-N from text-input mode will move you to the end of the next empty field. (The map starts with an ESCAPE (^[) to go to command mode. Then, it searches for the next empty field -- that is, the next line ending with a colon and a space (/: $^[). The A command resumes text input at the end of this empty field. For more information about vi key maps, see the Nutshell Handbook Learning the vi Editor.)
For example, after you enter a field like To: fred, you can stay in text-input mode, press CTRL-N to move to the end of the next empty field (usually cc:), and be in text-input mode, ready to fill in the next address.
[Table of Contents] [Index] [Previous: Overview: Sending MH Messages] [Next: MH Aliases]
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: Jerry Peek <firstname.lastname@example.org>