Grimley Evans.
else if (a->type == TYPETEXT)
{
/* On text, default to editor */
- mutt_edit_file ((!Editor || mutt_strcmp ("builtin", Editor) == 0) ?
- NONULL(Visual) : NONULL(Editor), newfile);
+ mutt_edit_file (NONULL (Editor), newfile);
}
else
{
if (op == OP_COMPOSE_EDIT_HEADERS ||
(op == OP_COMPOSE_EDIT_MESSAGE && option (OPTEDITHDRS)))
{
- mutt_edit_headers ((!Editor || mutt_strcmp ("builtin", Editor) == 0) ? NONULL(Visual) : NONULL(Editor),
- msg->content->filename, msg, fcc, fcclen);
+ mutt_edit_headers (NONULL (Editor), msg->content->filename, msg,
+ fcc, fcclen);
}
else
{
case OP_COMPOSE_EDIT_FILE:
CHECK_COUNT;
- mutt_edit_file ((!Editor || mutt_strcmp ("builtin", Editor) == 0) ? NONULL(Visual) : NONULL(Editor),
- idx[menu->current]->content->filename);
+ mutt_edit_file (NONULL(Editor), idx[menu->current]->content->filename);
mutt_update_encoding (idx[menu->current]->content);
menu->redraw = REDRAW_CURRENT | REDRAW_STATUS;
break;
.SH ENVIRONMENT
.PP
.IP "EDITOR"
-Editor to invoke when composing a message.
+Specifies the editor to use if VISUAL is unset.
.IP "EMAIL"
The user's e-mail address.
.IP "HOME"
.IP "REPLYTO"
Default Reply-To address.
.IP "VISUAL"
-Editor to invoke when the ~v command is given in the builtin editor.
+Specifies the editor to use when composing messages.
.SH FILES
.PP
.IP "~/.muttrc or ~/.mutt/muttrc"
if (stat (tmp, &sb) == 0)
mtime = sb.st_mtime;
- mutt_edit_file ((!Editor || mutt_strcmp ("builtin", Editor) == 0) ?
- NONULL(Visual) : NONULL(Editor), tmp);
+ mutt_edit_file (NONULL(Editor), tmp);
if ((rc = stat (tmp, &sb)) == -1)
{
}
Tempdir = safe_strdup ((p = getenv ("TMPDIR")) ? p : "/tmp");
- Editor = safe_strdup ((p = getenv ("EDITOR")) ? p : "vi");
- Visual = safe_strdup ((p = getenv ("VISUAL")) ? p : Editor);
+
+ p = getenv ("VISUAL");
+ if (!p)
+ {
+ p = getenv ("EDITOR");
+ if (!p)
+ p = "vi";
+ }
+ Editor = safe_strdup (p);
+ Visual = safe_strdup (p);
if ((p = getenv ("REPLYTO")) != NULL)
{
/*
** .pp
** This variable specifies which editor is used by mutt.
- ** It defaults to the value of the EDITOR or VISUAL environment
- ** variable, or to the string "vi".
+ ** It defaults to the value of the VISUAL, or EDITOR, environment
+ ** variable, or to the string "vi" if neither of those are set.
*/
{ "encode_from", DT_BOOL, R_NONE, OPTENCODEFROM, 0 },
/*