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-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham
	autolearn_force=no version=3.4.0
Date: Wed, 13 Jan 2016 01:01:47 +0000
From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: _history-complete-older problems with $(
Message-ID: <20160113010147.GA4699@tarsus.local2>
References: <CAKc7PVCnEX1rEhNqhtx7spyUVKCWukz4Tzkqr27-OV9+4hVciQ@mail.gmail.com>
 <CAKc7PVDVR=B8SWX+gSiNvtODWZ-25LtDz7jXVDH8BtrcxMnjXQ@mail.gmail.com>
 <160111161501.ZM5305@torch.brasslantern.com>
 <CAKc7PVBCEM=46YmgmhPR==Rq+pSfY+hgr8bcOMLV=zLFm6THBg@mail.gmail.com>
 <160112113928.ZM9065@torch.brasslantern.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <160112113928.ZM9065@torch.brasslantern.com>
User-Agent: Mutt/1.5.23 (2014-03-12)
X-Seq: zsh-workers 37594

Bart Schaefer wrote on Tue, Jan 12, 2016 at 11:39:28 -0800:
> On Jan 12,  2:09pm, Sebastian Gniazdowski wrote:
> } Why second comadd, and
> } what does "${(@)${(@)found#$PREFIX}%$SUFFIX}" do?
> 
> Suppose you have "$(" on the line, and the completion is $((1+2)).  The
> $found array will contain "$((1+2))" (and possibly other elements).  In
> the setup to at the beginning of _widen_for_history, PREFIX="$(" was
> assigned (that $left[-1]).  So now we need to remove "$(" from the
> values in $found to get the actual string to insert to finish the word,
> i.e., "(1+2))".  Similarly we would need to remove $SUFFIX (taken from
> $right) from the end of the values if there were one.
> 

That seems to always behave as though COMPLETE_IN_WORD is set,
regardless of the value of the option.

