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

Re: delete-word does not delete the entire word...

Bart Schaefer wrote:
> I almost mentioned the -match functions, but decided not to because the
> manual section for them has no examples of the corresponding styles.

Look in select-word-style, which is the simple interface, not requiring
explicit styles set by the user.  If you'd like the styles there shown
in the manual, too, fine.

> } [ delete-whole-word ] :
> }
> } emulate -L zsh
> } setopt extendedglob
> Why does this need extendedglob?

It probably doesn't, but I turn that on as a matter of course, since
otherwise it's not there when I need it, or I've made it difficult to
turn it on later, etc.  In any case, whenever I use patterns I assume
extended globbing is present even if I don't use it.

> } # Move the cursor and delete the block in one go for the
> } # purpose of yanking.
> } (( CURSOR = pos1 ))
> } BUFFER="${BUFFER[1,pos1]}${BUFFER[pos2,-1]}"
> I'm a little puzzled by that comment.  This is delete-whole-word, not
> kill-whole-word, so there shouldn't be any expectation of yanking ...
> and in fact when I try it I can't yank the word that was deleted.

Yes, I meant `undo' rather than yank.  You should find it undoes in one

> It's clear from kill-word-match that BUFFER edits are not automatically
> propagated to CUTBUFFER.  Which makes sense ...

Indeed, there's a complete separate interface as used in the other
-match functions.  (I should have called this one
delete-whole-word-match for consistency.)

Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK                          Tel: +44 (0)1223 692070

The information transmitted is intended only for the person or
entity to which it is addressed and may contain confidential 
and/or privileged material. 
Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by 
persons or entities other than the intended recipient is 
If you received this in error, please contact the sender and 
delete the material from any computer.

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