diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2006-05-20 10:43:48 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2006-05-20 10:43:48 +0000 |
commit | 8b47e90eab5bb17bf0d57aa0fdae925d9c8a3441 (patch) | |
tree | 5d799f8d80a7458101b70137be53620024938002 /mh/mh_whatnow.c | |
parent | 81df3b518fbf75717b4013126e200ee0c256e244 (diff) | |
download | mailutils-8b47e90eab5bb17bf0d57aa0fdae925d9c8a3441.tar.gz mailutils-8b47e90eab5bb17bf0d57aa0fdae925d9c8a3441.tar.bz2 |
(mh_whatnow): consult VISUAL and EDITOR environment variables for the default editor
Diffstat (limited to 'mh/mh_whatnow.c')
-rw-r--r-- | mh/mh_whatnow.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/mh/mh_whatnow.c b/mh/mh_whatnow.c index 374297b5f..ff6875cea 100644 --- a/mh/mh_whatnow.c +++ b/mh/mh_whatnow.c @@ -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); |