Closed okamsn closed 7 months ago
Why do meow-replace
and the other commands strip a trailing new line from the replacement? I copied that, but I don't understand why it's needed.
Well, the meow-replace
is designed to replace the selected text with the head of kill-ring. So here is a breaking change?
The command meow-replace-pop
isn't meant to replace meow-replace
. It is meant to run run after it. For example, I use meow-replace-pop
as the fallback for meow-replace
in meow-selection-command-fallback
.
Sometimes, I want to replace the region with text that is further into the kill ring. By using meow-replace-pop
as the fallback of meow-replace
, I can keep hitting r
to reach the desired text in the kill ring. It is similar to running yank-pop
after yank
, except that meow-replace-pop
does not cycle the kill ring, so that running meow-replace
later will work as expected.
If the command meow-replace-pop
is run after meow-replace
, which part is the breaking change?
EDIT: I've made the code signal a user error in meow-replace-pop
if the previous command isn't a replacement command. Hopefully that makes what I mean to say clearer.
Got it, thanks for the explanation. Are we ready for the merge?
Yes, I'm happy with it. I thought about using a prefix argument to reverse the cycling direction, but I now think it's easier to just use undo
.
Thanks!
This command, when run after
meow-replace
or itself, replaces the just inserted text with the next item in the kill ring, without rotating the kill ring.meow-replace
.meow--replace-pop-index
andmeow--replace-start-marker
.meow-replace
,meow-replace-save
, andmeow-replace-char
to set the marker before inserting the replacement text.The marker was needed to support
meow-replace-char
, which doesn't use a region. Otherwise, one could use(mark t)
to get the mark's position.