[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: yank-match.el -- yank matches for a regexp from kill-ring
From: |
Karl Fogel |
Subject: |
Re: yank-match.el -- yank matches for a regexp from kill-ring |
Date: |
Mon, 03 Mar 2008 20:16:00 -0500 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux) |
Juri Linkov <address@hidden> writes:
> Modifying `yank-pop' in simple.el to take into account the initial
> command `yank-match' has also benefits of using the recent and more
> correct code to do this. For instance, your command uses `delete-region'
> to replace the previously-yanked text, but `yank-pop' has more advanced
> code that calls (funcall (or yank-undo-function 'delete-region) ...)
>
> Also your command uses `insert' to insert the previously-yanked text,
> but `yank-pop' uses `insert-for-yank' to strip text properties from the
> inserted text according to `yank-excluded-properties'. I guess your patch
> was written when there was no such functions in Emacs?
Probably -- the code is a bit over ten years old now.
> I think it would be safer to reuse code in `yank-pop' and just find
> places in it that differ from `yank-match' functionality, like
> `current-kill'. Maybe you could just add a new match-string argument
> to `current-kill' that will rotate the yanking point by N matching
> places?
All these are good ideas, yup. I grok your general message here:
*really* incorporate 'yank-match' into the existing yank code, don't
just stitch it in in the quickest way possible :-). I will make sure
to DTRT. (I wish we were in bzr already, it would make this slightly
easier... But only slightly, not a big deal either way.)
Thanks for the help!
-Karl