bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

sdiff UI enhancement


From: David Malone
Subject: sdiff UI enhancement
Date: Wed, 06 Jun 2007 10:10:29 +0100

I use sdiff a fair bit, as it is used as part of FreeBSD's mergemaster
script. I often notice that when I am merging left and right sections,
I type "r" for left and "l" for right, because "l" is on the right
hand side of the keyboard and "r" is on the left hand side of the
keyboard.

I believe this is a known cognative problem for humans (if I remember
right, it gets a mention in the O'Reilly "Mind Hacks" book). We're
unlikely to be able to patch humans, so I thought it might be good
to add an alias where "1" means left and "2" means right. On all
the keyboards I've seen (including Hebrew keyboards) 1 is on the
left and 2 is on the right.

The following patch adds 1 and 2 as aliases for l and r - would it
be possible to get something like this added to diffutils?

        David.


--- sdiff.c     Wed Jun  6 09:43:49 2007
+++ sdiff.c.patched     Wed Jun  6 09:44:54 2007
@@ -858,6 +858,8 @@
 e:\tEdit a new version.\n\
 l:\tUse the left version.\n\
 r:\tUse the right version.\n\
+1:\tUse the left version.\n\
+2:\tUse the right version.\n\
 s:\tSilently include common lines.\n\
 v:\tVerbosely include common lines.\n\
 q:\tQuit.\n\
@@ -913,7 +915,7 @@
          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 ();
@@ -966,10 +968,12 @@
       switch (cmd0)
        {
        case 'l':
+       case '1':
          lf_copy (left, llen, outfile);
          lf_skip (right, rlen);
          return 1;
        case 'r':
+       case '2':
          lf_copy (right, rlen, outfile);
          lf_skip (left, llen);
          return 1;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]