aboutsummaryrefslogtreecommitdiff
path: root/ctct.in
diff options
context:
space:
mode:
authorEinhard Leichtfuß <alguien@respiranto.de>2019-01-10 08:17:52 +0100
committerEinhard Leichtfuß <alguien@respiranto.de>2019-01-10 08:17:52 +0100
commit9e34fc04c31fa00f97a889be2d41fb43d44deeb0 (patch)
tree5f4a59747a5f32b2d0dc397bc05c7915f8045537 /ctct.in
parent0f8ac72b86937513bf10c3ce21ac445724e9a13a (diff)
Honor $VISUAL
It does now take precedence over $EDITOR when editing files. You probably do not want to edit contact entries with ed.
Diffstat (limited to 'ctct.in')
-rw-r--r--ctct.in7
1 files changed, 5 insertions, 2 deletions
diff --git a/ctct.in b/ctct.in
index d03112f..af880e2 100644
--- a/ctct.in
+++ b/ctct.in
@@ -26,7 +26,7 @@ sysconfdir="@sysconfdir_expanded@"
user_config_file="@default_user_config_file@"
datadir="@default_datadir@"
fallback_editor=("@default_fallback_editor@")
-default_editor=() # none - use $EDITOR
+default_editor=() # none - use $VISUAL / $EDITOR
input_program=("@default_input_program@")
output_program=("@default_output_program@")
visual_program=("@default_visual_program@")
@@ -316,7 +316,10 @@ function edit_contact()
if test -n "${default_editor[*]}"
then
editor=( "${default_editor[@]}" )
- elif test -n "$EDITOR" && which "${EDITOR% *}" >/dev/null 2>&1
+ elif test -n "$VISUAL"
+ then
+ editor=( $VISUAL )
+ elif test -n "$EDITOR"
then
editor=( $EDITOR )
else