[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: C-x C-v considered harmful
From: |
Drew Adams |
Subject: |
RE: C-x C-v considered harmful |
Date: |
Thu, 2 Jul 2009 08:17:59 -0700 |
Problem statement:
>>>> I often invoke vc-dir in the *shell* buffer,...
>>>> but sometimes type "C-x C-v d RET" instead...
>>>> I haven't let go of the Ctrl key fast enough.
Proposed solutions:
> >> 1. Bind find-alternate-file to something different.
> >> 2. Add a "[Confirm]" step if nonexistent, as for
> >> selecting files or buffers with
> >> confirm-nonexistent-file-or-buffer set to t.
> >> 3. Do not bind find-alternate-file to anything at all.
> >
> > How about:
> > 4. Make find-alternate-file use a yes-or-no-p
> > confirmation prompt if the buffer has no associated file.
> > My guess is that the vast majority of uses of
> > find-alternate-file are replacing one file buffer with
> > another, and that intentionally replacing "special"
> > buffers is very rare.
> >
> > If there are specific modes or buffers for which "replacement"
> > _is_ commonly used, then there could be a variable to tell
> > find-alternate-file not to confirm that buffer (and
> > a user could set the global default value of that variable
> > to turn off all confirmation)
>
> The specific mode that leaps to mind is Dired. I often use C-x C-v in
> Dired buffers to visit a different directory, just as I do in file
> buffers. So how about:
>
> 5. Make find-alternate-file use a yes-or-no-p confirmation
> prompt if the buffer has an associated process. This would
> cover *shell* buffers.
This is like saying that we should change the behavior of `C-x C-f' so that it
asks for confirmation, because if you don't release the Control key fast enough
you get `C-x f', which sets the fill column. Or similarly, for `C-x C-b' or `C-x
C-c' or `C-x C-d' or ... There are tons of key combinations that exhibit the
same "problem".
I disagree with all of the above "solutions". The problem is not the behavior of
`find-alternate-file' or its binding to `C-x C-v'. If there really is a problem,
it is the too-similar binding of `C-x v d'.
`C-x C-v' is much older than `C-x v d', and my guess is that it is still more
widely used. And `C-x v d' has narrower focus, being specific to the context of
change control.
If a particular user has a problem finger-confusing `C-x v d' with `C-x C-v',
then s?he can use a different key for one or the other. End of problem.
If many, many users have the same finger problem, then `C-x v d' should be moved
to a different key for everyone. But please don't change the behavior of
`find-alternate-file' just because some other key can be confused with `C-x
C-v'.
Of the "solutions" mentioned above to the "problem", #5 from Kevin R is
preferable, being the least restrictive on the behavior of
`find-alternate-file'. But there should be no reason to restrict its behavior at
all.
Fix `C-x v d', if you feel you must, but leave `find-alternate-file' alone. It's
been just fine for a third of a century, thank you. It should not be forced to
move or change its behavior just because a newcomer to the neighborhood chooses
a similar phone #.
- C-x C-v considered harmful, Bob Rogers, 2009/07/01
- Re: C-x C-v considered harmful, Miles Bader, 2009/07/01
- Re: C-x C-v considered harmful, Bob Rogers, 2009/07/01
- Re: C-x C-v considered harmful, Kevin Rodgers, 2009/07/02
- RE: C-x C-v considered harmful,
Drew Adams <=
- RE: C-x C-v considered harmful, Bob Rogers, 2009/07/02
- RE: C-x C-v considered harmful, Drew Adams, 2009/07/02
- RE: C-x C-v considered harmful, Bob Rogers, 2009/07/03
- RE: C-x C-v considered harmful, Drew Adams, 2009/07/03
- RE: C-x C-v considered harmful, Bob Rogers, 2009/07/04
- RE: C-x C-v considered harmful, Drew Adams, 2009/07/05
- RE: C-x C-v considered harmful, Bob Rogers, 2009/07/05
- RE: C-x C-v considered harmful, Drew Adams, 2009/07/05
- Re: C-x C-v considered harmful, Johan Bockgård, 2009/07/07
- Re: C-x C-v considered harmful, Richard Stallman, 2009/07/05