summaryrefslogtreecommitdiff
path: root/quilt/patches/use-sensible-editor
blob: a61c219667e4a8f34553e98565fc12840669db88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
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/cgi-bin/bugreport.cgi?bug=509076
Forwarded: not-needed
Author: Ryan Niebur <ryanryan52@gmail.com>

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

--- 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 @@ if [ $status -ne 0 -a $status -ne 2 ]
 then
 	exit $status
 fi
-LANG=$ORIGINAL_LANG $EDITOR "${@/#/$SUBDIR}"
+LANG=$ORIGINAL_LANG sensible-editor "${@/#/$SUBDIR}"
 status=$?
 for file in "$@"
 do
--- a/quilt/header.in
+++ b/quilt/header.in
@@ -17,8 +17,6 @@ then
 	. $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 @@ else
 
 	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 \
--- 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
@@ -524,7 +522,7 @@ introduction="$(gen_tempfile)"
 
 if [ -z "$opt_message" ]
 then
-	if ! LANG=$ORIGINAL_LANG $EDITOR $introduction
+	if ! LANG=$ORIGINAL_LANG sensible-editor $introduction
 	then
 		rm -f $introduction
 		exit 1
--- a/test/edit.test
+++ b/test/edit.test
@@ -6,6 +6,7 @@ $ cat > editor
 < sed -e 's:foo:bar:' $1 > $1.new
 < mv $1.new $1
 $ chmod +x editor
+$ unset VISUAL
 $ export EDITOR=%{PWD}/editor
 
 $ quilt new patch