(mh_whatnow): consult VISUAL and EDITOR environment variables for the default editor
Showing
1 changed file
with
7 additions
and
1 deletions
... | @@ -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); | ... | ... |
-
Please register or sign in to post a comment