zsh-users
 help / color / mirror / code / Atom feed
* _expand_word_and_keep of 'keeper suite' doesn't work
@ 2005-12-01  9:57 Hannu Koivisto
  2005-12-01 16:05 ` Bart Schaefer
  0 siblings, 1 reply; 9+ messages in thread
From: Hannu Koivisto @ 2005-12-01  9:57 UTC (permalink / raw)
  To: Zsh Users' List

Greetings,

The version of _expand_word_and_keep below (from the magazine
article) doesn't seem to work in at least 4.2.5.  For some reason
the condition [[ $args[-J] == all-expansions ]] is never true when
and nothing is put to the kept variable.  I have no idea of what that
condition is there for, but just for the heck of it I tried
removing it completely.  Then, ... *.jpg<C-x e> caused *.jpg to be
put to the kept variable.

Any ideas?

_expand_word_and_keep() {
    function compadd() {
        local -A args
        zparseopts -E -A args J:
        if [[ $args[-J] == all-expansions ]]; then
            builtin compadd -A kept "$@"
            kept=( ${(Q)${(z)kept}} )
        fi
        builtin compadd "$@"
    }
    local result
    _main_complete _expand
    result=$?
    unfunction compadd
    return result
}

zle -C _expand_word complete-word _expand_word_and_keep

-- 
Hannu


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2005-12-04  5:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-01  9:57 _expand_word_and_keep of 'keeper suite' doesn't work Hannu Koivisto
2005-12-01 16:05 ` Bart Schaefer
2005-12-01 22:39   ` Hannu Koivisto
2005-12-02 16:57     ` Bart Schaefer
2005-12-02 19:40       ` Hannu Koivisto
2005-12-03  3:44         ` Bart Schaefer
2005-12-03 12:27           ` Hannu Koivisto
2005-12-03 18:20             ` Bart Schaefer
2005-12-04  5:44               ` Joakim Ryden

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).