Commit 8b47e90e 8b47e90eab5bb17bf0d57aa0fdae925d9c8a3441 by Sergey Poznyakoff

(mh_whatnow): consult VISUAL and EDITOR environment variables for the default editor

1 parent 81df3b51
......@@ -550,7 +550,13 @@ int
mh_whatnow (struct mh_whatnow_env *wh, int initial_edit)
{
if (!wh->editor)
wh->editor = mh_global_profile_get ("Editor", "prompter");
{
char *p;
wh->editor = mh_global_profile_get ("Editor",
(p = getenv ("VISUAL")) ?
p : (p = (getenv ("EDITOR"))) ?
p : "prompter");
}
if (initial_edit)
mh_spawnp (wh->editor, wh->file);
......