case LTK_SENDMAIL:
case LTK_SHELL:
_mutt_expand_path(buf, sizeof(buf), val, 0);
- mlua_regsets(tk, buf);
+ val = buf;
+ /* FALLTHROUGH */
+
+ case LTK_EDITOR:
+ mlua_regsets(tk, val);
return 0;
}
}
/* {{{ madmutt magic properties */
+static void madmutt_init_editor(char *buf, ssize_t len)
+{
+ m_strcpy(buf, len, getenv("VISUAL") ?: getenv("EDITOR") ?: "vi");
+ fprintf("%s\n", buf);
+}
+
static void madmutt_init_shell(char *buf, ssize_t len)
{
struct passwd *pw = getpwuid(getuid());
** Contains the path of the \fTmadmutt_dotlock(1)\fP binary to be used by
** Madmutt.
*/
+ {"editor", madmutt_init_editor, NULL },
+ /*
+ ** .pp
+ ** This variable specifies which editor is used by Madmutt.
+ ** It defaults to the value of the \fT$$$VISUAL\fP, or \fT$$$EDITOR\fP, environment
+ ** variable, or to the string "\fTvi\fP" if neither of those are set.
+ */
{ "sendmail", NULL, SENDMAIL " -oem -oi" },
/*
** .pp