Description: use Debian's sensible-editor instead of trying to guess the editor
 the original bug that triggered this change was that quilt doesn't honour $VISUAL
Bug-Debian: http://bugs.debian.org/509076
Forwarded: not-needed
Author: Ryan Niebur <ryanryan52@gmail.com>

---
 quilt/edit.in   |    4 +---
 quilt/header.in |    4 +---
 quilt/mail.in   |    4 +---
 test/edit.test  |    1 +
 4 files changed, 4 insertions(+), 9 deletions(-)

Index: b/quilt/edit.in
===================================================================
--- a/quilt/edit.in
+++ b/quilt/edit.in
@@ -6,8 +6,6 @@
 #
 #  See the COPYING and AUTHORS files for more details.
 
-: ${EDITOR:=vi}
-
 # Read in library functions
 if [ "$(type -t patch_file_name)" != function ]
 then
@@ -65,7 +63,7 @@
 then
 	exit $status
 fi
-LANG=$ORIGINAL_LANG $EDITOR "${@/#/$SUBDIR}"
+LANG=$ORIGINAL_LANG sensible-editor "${@/#/$SUBDIR}"
 status=$?
 for file in "$@"
 do
Index: b/quilt/header.in
===================================================================
--- a/quilt/header.in
+++ b/quilt/header.in
@@ -17,8 +17,6 @@
 	. $QUILT_DIR/scripts/patchfns
 fi
 
-: ${EDITOR:=vi}
-
 usage()
 {
 	printf $"Usage: quilt header [-a|-r|-e] [--backup] [--strip-diffstat] [--strip-trailing-whitespace] [patch]\n"
@@ -151,7 +149,7 @@
 
 	if [ -n "$opt_edit" ]
 	then
-		LANG=$ORIGINAL_LANG $EDITOR "$tmp" || exit 1
+		LANG=$ORIGINAL_LANG sensible-editor "$tmp" || exit 1
 	fi
 
 	maybe_strip_diffstat < $tmp \
Index: b/quilt/mail.in
===================================================================
--- a/quilt/mail.in
+++ b/quilt/mail.in
@@ -6,8 +6,6 @@
 #
 #  See the COPYING and AUTHORS files for more details.
 
-: ${EDITOR:=vi}
-
 # Read in library functions
 if [ "$(type -t patch_file_name)" != function ]
 then
@@ -541,7 +539,7 @@
 
 if [ -z "$opt_message" ]
 then
-	if ! LANG=$ORIGINAL_LANG $EDITOR $introduction
+	if ! LANG=$ORIGINAL_LANG sensible-editor $introduction
 	then
 		rm -f $introduction
 		exit 1
Index: b/test/edit.test
===================================================================
--- a/test/edit.test
+++ b/test/edit.test
@@ -6,6 +6,7 @@
 < sed -e 's:foo:bar:' $1 > $1.new
 < mv $1.new $1
 $ chmod +x editor
+$ unset VISUAL
 $ export EDITOR=%{PWD}/editor
 
 $ quilt new patch
