[Top][All Lists]

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

Re: diff-apply-hunk broken

From: Stefan Monnier
Subject: Re: diff-apply-hunk broken
Date: 25 Mar 2004 12:48:53 -0500
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

> Stefan, it appears that your recent patch broke `diff-apply-hunk':


> in a modified CVS file, I do C-x v = (vc-diff) and in the resulting
> *vc-diff* buffer I do C-c C-a (diff-apply-hunk) to reverse the section
> of the diff:

To undo a hunk you should use C-u C-c C-a rather than C-c C-a.
It is true that when C-c C-a finds that the requested direction cannot be
done on the buffer but the reverse can, it tries to reverse the direction
for you, but it's always better to say explicitly what you want.

> Debugger entered--Lisp error: (buffer-read-only #<buffer io.d.~1.204.~>)

The reason why things have changed is that it used to be that C-c C-a
looked for the "dest file" no matter what, whereas now the file to which
the hunk is applied depends on the direction you've chosen (via C-u C-c
C-a).  This way if you `diff a b' it used to be that both C-c C-a and C-u
C-c C-a tried to apply (or reverse) the current hunk on file `b' whereas
now C-c C-a will try to apply the hunk in file `a' and C-u C-c C-a will
try to undo the hunk in file `b'.

In your case, clearly the new behavior is undesirable, so I think we need
to fix VC so that the diff doesn't mention io.d.~1.204.~.


reply via email to

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