Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm
Precedence: bulk
X-No-Archive: yes
List-Id: Zsh Workers List <zsh-workers.zsh.org>
List-Post: <mailto:zsh-workers@zsh.org>
List-Help: <mailto:zsh-workers-help@zsh.org>
X-Qmail-Scanner-Diagnostics: from out2-smtp.messagingengine.com by f.primenet.com.au (envelope-from <d.s@daniel.shahaf.name>, uid 7791) with qmail-scanner-2.11 
 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1.  
 Clear:RC:0(66.111.4.26):SA:0(0.0/5.0):. 
 Processed in 0.112723 secs); 20 Aug 2016 18:13:02 -0000
X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au
X-Spam-Level: 
X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID
	autolearn=unavailable autolearn_force=no version=3.4.1
X-Envelope-From: d.s@daniel.shahaf.name
X-Qmail-Scanner-Mime-Attachments: |
X-Qmail-Scanner-Zip-Files: |
Received-SPF: none (ns1.primenet.com.au: domain at daniel.shahaf.name does not designate permitted sender hosts)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=
	daniel.shahaf.name; h=content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to:x-sasl-enc
	:x-sasl-enc; s=mesmtp; bh=EdH44BmHu04mOmslT9cGAtzAhLI=; b=1rQMgX
	OOiB6kZxzsany6tytfhWsBuuurX+jM+y9gDeq8sCWtZJuD7yo8oHf2Yv3dMFljyV
	zs7e2CfJrUK20s9HhYANEMYDQ2eQ29zvObY209NIQlFTkoWtr8h/HdO6skwuPd7/
	s/IjEEQewmo5IE1JfBhhsD9uNze4+yjifdxYY=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=
	messagingengine.com; h=content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to:x-sasl-enc
	:x-sasl-enc; s=smtpout; bh=EdH44BmHu04mOmslT9cGAtzAhLI=; b=qJbUi
	3oT6mQxPVf0OWZ/zqkdbcEFCGfGHppCh1XY68HDmB2Iq5w1oaHQH1FimYx+i00V/
	AG4TMROZUxXr/Wz8noC9XIsYQB+QN/fmV/3cfHgx/Vr20GK3fj9d4J/PNsN5k0mh
	282Ta4vF8sPgIPkyzK1APTy3yoFNF46/Sg5krg=
X-Sasl-enc: pBoaA/DGy/uOCQk59+eiSkw+kdvYKOUnXRJ9M6hapmQx 1471716772
Date: Sat, 20 Aug 2016 18:12:45 +0000
From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: zsh-workers@zsh.org
Subject: Re: umount /f/b<TAB> -> /foo/bar
Message-ID: <20160820181245.GA27862@fujitsu.shahaf.local2>
References: <20160819155651.GA9598@fujitsu.shahaf.local2>
 <160819223513.ZM1670@torch.brasslantern.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <160819223513.ZM1670@torch.brasslantern.com>
User-Agent: Mutt/1.5.23 (2014-03-12)
X-Seq: zsh-workers 39081

Bart Schaefer wrote on Fri, Aug 19, 2016 at 22:35:13 -0700:
> On Aug 19,  3:56pm, Daniel Shahaf wrote:
> }
> } +    # This codepath honours any -M matchspec parameters.
> } +    () {
> } +      local -a tmp_buffer
> } +      compadd -A tmp_buffer "$__gopts[@]" -a files
> } +      matches+=( "${(@)tmp_buffer/$canpref/$origpref}" )
> } +    }
> } +  else
> } +    # ### Ideally, this codepath would do what the 'if' above does,
> } +    # ### but telling compadd to pretend the "word on the command line"
> } +    # ### is ${"the word on the command line"/$origpref/$canpref}.
> } +    matches+=(${${(M)files:#$canpref*}/$canpref/$origpref})
> } +  fi
> 
> Perhaps some variation on
> 
>     compadd -M "B:${(b)origpref}=${(b)canpref}" -a files
> 
> ??  Some cases of mount point names containing unusual characters might
> be a little weird.

I couldn't get that to work.  Neither did assigning to words[CURRENT].

I'm tempted to push the patch as is, though, since it adds matchspecs
honouring to one use-case and doesn't break others.

Thanks,

Daniel

