Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: zap/del to char

On Apr 4,  3:03pm, djh wrote:
} I just enabled my zsh to use the emacs like function zap-to-char,
} but it seems like the two zsh functions, (1) zap-to-char and (2)
} delete-to-char are reversed in function.
} To wit: emacs's zap-to-char, is inclusive and deletes the character.

Hrm.  There's a slightly convoluted discussion of this starting here:


The first post apparently mis-states the reality, because the patch
in the second post claims to do what Darel wants (which is the inverse
of what the first post says).

PWS's follow-up, however, makes it clear that zsh has stubbornly kept
the GNU emacs 18.x definition of zap-to-char because, well, we're more
concerned with things always working like they always have than are
the GNU folks, I guess.

}      zle's does not and it should in my opinion

"Twelve dollars?  Why, when I was your age I could get that same shirt
for a nickel!"

}      zle's "delete-to-char", however performs the zap-to-character
}      function right.

zle -A zap-to-char delete-to-char

(Wow, that's a lot easier than the function PWS whipped out in

} So it looks like the definitions got swapped around. 

Yes, by emacs, several years after the ZLE function first copied it.
The question is, are we finally in the mood to copy this particular

Messages sorted by: Reverse Date, Date, Thread, Author