summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2006-05-20 10:43:48 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2006-05-20 10:43:48 +0000
commit8b47e90eab5bb17bf0d57aa0fdae925d9c8a3441 (patch)
tree5d799f8d80a7458101b70137be53620024938002
parent81df3b518fbf75717b4013126e200ee0c256e244 (diff)
downloadmailutils-8b47e90eab5bb17bf0d57aa0fdae925d9c8a3441.tar.gz
mailutils-8b47e90eab5bb17bf0d57aa0fdae925d9c8a3441.tar.bz2
(mh_whatnow): consult VISUAL and EDITOR environment variables for the default editor
-rw-r--r--mh/mh_whatnow.c8
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);

Return to:

Send suggestions and report system problems to the System administrator.