emacs-pretest-bug
[Top][All Lists]
Advanced

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

Re: diff-yank-handler is evil


From: Stefan Monnier
Subject: Re: diff-yank-handler is evil
Date: 25 Mar 2004 12:08:05 -0500
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

>> OK, I see that a change to subr.el's yank-handler code broke
>> diff-yank-handler about 90% (and I only use the remaining 10%).
>> 
>> I don't see how to fix it with the new yank-handler behavior, so I'll
>> disable it for now.

> There may be ways to do what you want, or we may need to fix
> yank-handlers.  But you are not very specific here :-(.

Well, the old behavior was to call one yank-handler for the whole yanked
string, whether or not that yank-handler covered the whole string.
Then diff-yank-handler checked to se if the whole string had the
yank-handler and if not it would refrain from doing anything.

The diff-yank-handler was only placed on "diff lines" but not on hunk
headers and other lines, so that cut&paste of a few lines from inside
a hunk resulted in the text being inserted without the leading "-" or "+",
whereas if you cut&pasted a larger chunk that included a hunk header,
the diff would be pasted untouched.  It DWIM'd perfectly.

But the old behavior you fixed was broken so I don't want it back.

With the new behavior of the yank-handler, if I want to reproduce the same
behavior, I think I'll have to put the diff-yank-handler on all the text
and check for the presence of a hunk-header when yanking.


        Stefan




reply via email to

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