[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Permit user to select keys when using sdiff merge
From: |
Chuck Swiger |
Subject: |
Re: [PATCH] Permit user to select keys when using sdiff merge |
Date: |
Mon, 27 Sep 2004 13:15:55 -0400 |
On Sep 22, 2004, at 2:11 AM, Paul Eggert wrote:
Thanks for explaining it.
Sure, sorry for the delay in responding.
How about if we just hardcode the "1" and "2" keys as alternatives to
the existing "l" and "r" keys? That would be simpler than adding a
new option.
Hardcoding "1" and "2" would suit my personal preferences just fine.
It would involve removing the getenv() call from the proposed patch,
which is simple to do.
However, the person who made the initial feature request wanted
different keys. I think a solution that lets the user select their
preferred keys is better than hardcoding any individual preferences,
but I suppose that's up to Tom Lord or whoever is maintaining diffutils
and is willing to commit such a change.
-----
Perhaps I should backtrack a little, and add some thoughts. Good
patches are short, fix problems or add functionality cleanly, and
include documentation. Changing which keystrokes are used for sdiff at
compile time is trivial: it only takes about 10 lines. Letting sdiff
choose which keys to use at runtime is harder since it requires
changing a switch statement to a set of if/thens, since one cannot test
against a variable via switch.
Once I actually got into the code, I discovered that the code for
handling user commands during a merge is a little flakey and didn't
seem to be documented anywhere-- it would complain rather than accept
words like "quit" or "help". I happen to think that accepting 'q' but
not "quit" is silly, so the change I proposed handles such cases more
reasonably than the original code. [IMHO]
It also makes the proposed patch longer than I would like.
--
-Chuck