Here is an improved patch.

>From 24aa5ce087ae33c89768c183ca0df08e246acff4 Mon Sep 17 00:00:00 2001
From: Jari Aalto <jari.aa...@cante.net>
Date: Wed, 11 Jan 2012 11:52:56 +0200
Subject: [PATCH] gl-setup: Debian policy (11.4. Editors and pagers). Use
 sensible-editor
Organization: Private
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit


Signed-off-by: Jari Aalto <jari.aa...@cante.net>
---
 src/gl-setup |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/src/gl-setup b/src/gl-setup
index 3a6c04b..954e6d2 100755
--- a/src/gl-setup
+++ b/src/gl-setup
@@ -84,7 +84,17 @@ else
         printf "The default settings in the "rc" file ($GL_RC) are fine for most\n"
         printf "people but if you wish to make any changes, you can do so now.\n\nhit enter..."
         read i
-        ${EDITOR:-vi} $GL_RC
+
+	if [ "$EDITOR" ]; then
+	     $EDITOR "$GL_RC"
+	elif [ -x /usr/bin/sensible-editor ]; then # Debian support
+	    /usr/bin/sensible-editor "$GL_RC"
+	elif [ -x /usr/bin/nano ]; then # Debian support
+	    /usr/bin/nano "$GL_RC"
+	else
+	    vi "$GL_RC"
+	fi
+
     fi
 fi
 
-- 
1.7.7.3

Reply via email to