[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Quilt-dev] quilt-specific $EDITOR
From: |
Jean Delvare |
Subject: |
[Quilt-dev] quilt-specific $EDITOR |
Date: |
Mon, 5 Sep 2005 23:13:21 +0200 |
Hi all,
Users may want to use a different $EDITOR for quilt and for other tasks.
The quilt "mail" and "header" commands already support that, you just
have to add an "EDITOR=foo" line in ~/.quiltrc. However I was surprised
to notice that it doesn't work with the command that would need it the
most: "edit". The reason is that quilt/edit doesn't source patchfns like
all other functions do, and the reading of ~/.quiltrc happens there.
Thus, I would propose that we now source patchfns in edit.
Index: quilt/edit.in
===================================================================
RCS file: /cvsroot/quilt/quilt/quilt/edit.in,v
retrieving revision 1.7
diff -u -r1.7 edit.in
--- quilt/edit.in 24 Aug 2005 14:54:16 -0000 1.7
+++ quilt/edit.in 5 Sep 2005 21:05:40 -0000
@@ -8,6 +8,17 @@
: ${EDITOR:=vi}
+# Read in library functions
+if [ "$(type -t patch_file_name)" != function ]
+then
+ if ! [ -r @SCRIPTS@/patchfns ]
+ then
+ echo "Cannot read library @SCRIPTS@/patchfns" >&2
+ exit 1
+ fi
+ . @SCRIPTS@/patchfns
+fi
+
usage()
{
printf $"Usage: quilt edit file ...\n"
We could probably go with something faster, as we only need to source
~/.quiltrc and not the whole patchfns. However, it would duplicate some
code and increase the maintenance cost for a speed benefit that is
hardly measurable, so I don't think it's worth the additional effort.
And we are likely to need some of the patchfns functions in the edit
functions in the future anyway.
When setting EDITOR in ~/.quiltrc works as it should, we will certainly
want to document it properly.
Thanks,
--
Jean Delvare
- [Quilt-dev] quilt-specific $EDITOR,
Jean Delvare <=