From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 451 invoked from network); 1 Dec 2005 09:58:07 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.0 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 1 Dec 2005 09:58:07 -0000 Received: (qmail 51680 invoked from network); 1 Dec 2005 09:57:58 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 1 Dec 2005 09:57:58 -0000 Received: (qmail 11610 invoked by alias); 1 Dec 2005 09:57:50 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9727 Received: (qmail 11600 invoked from network); 1 Dec 2005 09:57:50 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 1 Dec 2005 09:57:50 -0000 Received: (qmail 50489 invoked from network); 1 Dec 2005 09:57:49 -0000 Received: from her-isrv.ionific.com (195.197.252.67) by a.mx.sunsite.dk with SMTP; 1 Dec 2005 09:57:45 -0000 Received: from her-gw.ionific.com ([195.197.252.66] helo=trews52.bothi.fi) by her-isrv.ionific.com with esmtp (Exim 3.35 #1 (Debian)) id 1EhlCC-0003tz-00 for ; Thu, 01 Dec 2005 11:57:44 +0200 Received: from azure by trews52.bothi.fi with local (Exim 3.36 #1 (Debian)) id 1EhlC3-0004QB-00 for ; Thu, 01 Dec 2005 11:57:35 +0200 To: Zsh Users' List Subject: _expand_word_and_keep of 'keeper suite' doesn't work Mail-copies-to: nobody From: Hannu Koivisto Date: Thu, 01 Dec 2005 11:57:25 +0200 Message-ID: <87iru9i1h6.fsf@trews52.bothi.fi> User-Agent: Gnus/5.090014 (Oort Gnus v0.14) Emacs/21.4 (i386-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: Hannu Koivisto 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 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