From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7381 invoked by alias); 21 Sep 2014 19:00:34 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 19125 Received: (qmail 12502 invoked from network); 21 Sep 2014 19:00:21 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, RCVD_NUMERIC_HELO,SPF_HELO_PASS,T_FSL_HELO_BARE_IP_2 autolearn=no version=3.3.2 X-Injected-Via-Gmane: http://gmane.org/ To: zsh-users@zsh.org From: Yuri D'Elia Subject: Re: rsync --progress stops completion Date: Sun, 21 Sep 2014 20:59:56 +0200 Message-ID: References: <2002755.9ryFYYVtTN@note> <5418786F.8030001@thregr.org> <140916175124.ZM5742@torch.brasslantern.com> <54194198.2010607@thregr.org> <140917085133.ZM6725@torch.brasslantern.com> <541AA918.8060503@thregr.org> <140918093602.ZM7963@torch.brasslantern.com> <140918190130.ZM8366@torch.brasslantern.com> <140920112024.ZM29459@torch.brasslantern.com> <140921102006.ZM31805@torch.brasslantern.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 193.106.183.18 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.0 In-Reply-To: <140921102006.ZM31805@torch.brasslantern.com> On 09/21/2014 08:52 PM, Yuri D'Elia wrote: > On 09/21/2014 07:20 PM, Bart Schaefer wrote: >> To permit zstyle customizations it might also be useful to set up the >> "compcontext" parameter and call _complete instead of "_normal -s". >> There aren't any good examples of this except Functions/Misc/nslookup. > > So here's what I got so far: Some obvious typos in the last post. #autoload _complete_fallback_cleanup() { precmd_functions=_complete_fallback_precmd unset _complete_fallback_precmd } _complete_fallback() { if [[ $LASTWIDGET = *complete* || -n $_complete_fallback_precmd ]] then if [[ -z $_complete_fallback_precmd ]] then _complete_fallback_precmd=precmd_functions precmd_functions+=( _complete_fallback_cleanup ) fi [[ $compstate[context] = command && $CURRENT -gt 2 ]] || return 1 words=("$words[1]" "${(@)words[$CURRENT,-1]}") CURRENT=2 local curcontext="${curcontext%:*}:fallback" _compskip=default _complete fi } _complete_fallback "$@"