[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: sdiff UI enhancement
From: |
Paul Eggert |
Subject: |
Re: sdiff UI enhancement |
Date: |
Wed, 06 Jun 2007 16:42:06 -0700 |
User-agent: |
Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) |
Chuck Swiger <address@hidden> writes:
> A second reason is that when sdiff shows the two-column display, most
> people would count these columns as "1" and "2", not "1" and "9". [1]
Good point, thanks. I installed this:
2007-06-06 Paul Eggert <address@hidden>
* NEWS: Mention new sdiff aliases 1 and 2 for l and r.
* doc/diff.texi (Merge Commands): Likewise.
* src/sdiff.c (give_help): Give help for them.
(edit): Support them.
Index: NEWS
===================================================================
RCS file: /cvsroot/diffutils/diffutils/NEWS,v
retrieving revision 1.25
diff -u -p -r1.25 NEWS
--- NEWS 5 Sep 2006 23:02:32 -0000 1.25
+++ NEWS 6 Jun 2007 23:40:12 -0000
@@ -14,6 +14,8 @@ User-visible changes since 2.8.7 (in "ve
"Utility Syntax Guidelines" in the Minutes of the January 2005
Meeting <http://www.opengroup.org/austin/docs/austin_239.html>.
+* sdiff now understands '1' and '2' as synonyms for 'l' and 'r'.
+
Version 2.8.7 contains no user-visible changes.
User-visible changes in version 2.8.6:
Index: doc/diff.texi
===================================================================
RCS file: /cvsroot/diffutils/diffutils/doc/diff.texi,v
retrieving revision 1.30
diff -u -p -r1.30 diff.texi
--- doc/diff.texi 12 Apr 2007 00:15:15 -0000 1.30
+++ doc/diff.texi 6 Jun 2007 23:40:12 -0000
@@ -2466,18 +2466,22 @@ Like @samp{eb}, except precede each vers
shows what file and lines the version came from.
@item el
address@hidden e1
Edit a copy of the left version, then copy the result to the output.
@item er
address@hidden e2
Edit a copy of the right version, then copy the result to the output.
@item l
address@hidden 1
Copy the left version to the output.
@item q
Quit.
@item r
address@hidden 2
Copy the right version to the output.
@item s
Index: src/sdiff.c
===================================================================
RCS file: /cvsroot/diffutils/diffutils/src/sdiff.c,v
retrieving revision 1.47
diff -u -p -r1.47 sdiff.c
--- src/sdiff.c 4 Apr 2007 22:08:14 -0000 1.47
+++ src/sdiff.c 6 Jun 2007 23:40:12 -0000
@@ -864,11 +864,11 @@ give_help (void)
fprintf (stderr, "%s", _("\
ed:\tEdit then use both versions, each decorated with a header.\n\
eb:\tEdit then use both versions.\n\
-el:\tEdit then use the left version.\n\
-er:\tEdit then use the right version.\n\
-e:\tEdit a new version.\n\
-l:\tUse the left version.\n\
-r:\tUse the right version.\n\
+el or e1:\tEdit then use the left version.\n\
+er or e2:\tEdit then use the right version.\n\
+e:\tDiscard both versions then edit a new one.\n\
+l or 1:\tUse the left version.\n\
+r or 2:\tUse the right version.\n\
s:\tSilently include common lines.\n\
v:\tVerbosely include common lines.\n\
q:\tQuit.\n\
@@ -923,7 +923,8 @@ edit (struct line_filter *left, char con
cmd0 = skip_white ();
switch (cmd0)
{
- case 'l': case 'r': case 's': case 'v': case 'q':
+ case '1': case '2': case 'l': case 'r':
+ case 's': case 'v': case 'q':
if (skip_white () != '\n')
{
give_help ();
@@ -937,7 +938,7 @@ edit (struct line_filter *left, char con
cmd1 = skip_white ();
switch (cmd1)
{
- case 'b': case 'd': case 'l': case 'r':
+ case '1': case '2': case 'b': case 'd': case 'l': case 'r':
if (skip_white () != '\n')
{
give_help ();
@@ -975,11 +976,11 @@ edit (struct line_filter *left, char con
switch (cmd0)
{
- case 'l':
+ case '1': case 'l':
lf_copy (left, llen, outfile);
lf_skip (right, rlen);
return true;
- case 'r':
+ case '2': case 'r':
lf_copy (right, rlen, outfile);
lf_skip (left, llen);
return true;
@@ -1020,7 +1021,7 @@ edit (struct line_filter *left, char con
(long int) (lline + llen - 1));
}
/* Fall through. */
- case 'b': case 'l':
+ case '1': case 'b': case 'l':
lf_copy (left, llen, tmp);
break;
@@ -1042,7 +1043,7 @@ edit (struct line_filter *left, char con
(long int) (rline + rlen - 1));
}
/* Fall through. */
- case 'b': case 'r':
+ case '2': case 'b': case 'r':
lf_copy (right, rlen, tmp);
break;
Re: sdiff UI enhancement, Paul Eggert, 2007/06/06