[Top][All Lists]

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

Re: diff-yank-handler is evil

From: Kim F. Storm
Subject: Re: diff-yank-handler is evil
Date: 26 Mar 2004 02:45:27 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

Stefan Monnier <address@hidden> writes:

> >> 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.

Yes, that's a great idea, and exactly what a yank-handler should be
ideal for.

> 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.

That seems like the right approach.

Kim F. Storm  http://www.cua.dk

reply via email to

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