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 ...@@ -550,7 +550,13 @@ int
550 mh_whatnow (struct mh_whatnow_env *wh, int initial_edit) 550 mh_whatnow (struct mh_whatnow_env *wh, int initial_edit)
551 { 551 {
552 if (!wh->editor) 552 if (!wh->editor)
553 wh->editor = mh_global_profile_get ("Editor", "prompter"); 553 {
554 char *p;
555 wh->editor = mh_global_profile_get ("Editor",
556 (p = getenv ("VISUAL")) ?
557 p : (p = (getenv ("EDITOR"))) ?
558 p : "prompter");
559 }
554 560
555 if (initial_edit) 561 if (initial_edit)
556 mh_spawnp (wh->editor, wh->file); 562 mh_spawnp (wh->editor, wh->file);
......