From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20484 invoked by alias); 22 Sep 2014 06:58:12 -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: 19135 Received: (qmail 2933 invoked from network); 22 Sep 2014 06:58:10 -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.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 From: Bart Schaefer Message-id: <140921235803.ZM1712@torch.brasslantern.com> Date: Sun, 21 Sep 2014 23:58:03 -0700 In-reply-to: Comments: In reply to "Yuri D'Elia" "Re: rsync --progress stops completion" (Sep 22, 12:29am) 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> <140921123854.ZM1299@torch.brasslantern.com> <140921150746.ZM1564@torch.brasslantern.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org Subject: Re: rsync --progress stops completion MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Sep 22, 12:29am, Yuri D'Elia wrote: } } It remains to be seen if this is any better than just using the _files } completer. My guess is that it would generally be, though it might break } too easily for programs that have positional arguments. It's probably going to be really bad for programs that have subcommands (e.g., git) because it's going to throw away the subcommand name. One possibility would be to try repeatedly, throwing away one word at a time, e.g.: while (( --CURRENT > 1 )) do words[CURRENT]=() _complete && return 0 done That preserves as much of the context as possible for each attempt, at the cost of some potential wasted cycles.