.RE
.PP
.BR Editor :
-/usr/bin/vi
+vi
.RS 5
Defines the editor to be used by the commands
.BR comp ,
.BR forw ,
and
.BR repl .
+This profile entry overrides the $VISUAL and $EDITOR environment variables,
+but gets overridden by the $MMHEDITOR environment variabel.
(profile, default: vi)
.RE
.PP
to display message bodies (or message parts) of type text/plain.
This profile entry overrides the $PAGER environment variable, but gets
overridden by the $MMHPAGER environment variable.
+(profile, default: more)
.RE
.PP
.BR Sendmail :
the default shell to run
.RE
.PP
+.B $MMHEDITOR
+.br
+.B $VISUAL
+.br
+.B $EDITOR
+.RS 5
+These variables (in descending priority) define the default editor to use.
+.RE
+.PP
.B $MMHPAGER
.br
.B $PAGER
lkfclose(ib, ctxpath);
}
+ /* Set editor */
+ if (!(cp = getenv("MMHEDITOR")) || !*cp) {
+ if (!(cp = context_find("editor")) || !*cp) {
+ if (!(cp = getenv("VISUAL")) || !*cp) {
+ if (!(cp = getenv("EDITOR")) || !*cp) {
+ cp = defaulteditor;
+ }
+ }
+ }
+ }
+ defaulteditor = cp;
+
/* Set pager */
if (!(cp = getenv("MMHPAGER")) || !*cp) {
if (!(cp = context_find("pager")) || !*cp) {
if ((cp = context_find(cp)) != NULL)
*ed = cp;
}
- } else {
+ } else if (!*ed) {
/* set initial editor */
- if (*ed == NULL && (*ed = context_find("editor")) == NULL)
- *ed = defaulteditor;
+ *ed = defaulteditor;
}
if (altmsg) {
if (nedit) {
unputenv("mheditor");
} else {
- m_putenv("mheditor", ed ? ed : (ed = context_find("editor")) ?
- ed : defaulteditor);
+ m_putenv("mheditor", ed ? ed : defaulteditor);
}
snprintf(buffer, sizeof(buffer), "%d", use);
m_putenv("mhuse", buffer);