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,FREEMAIL_FROM,
	T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=mime-version:in-reply-to:references:from:date:message-id:subject:to
         :cc:content-type;
        bh=EpZl8ud/p6E4iQIz3w1NLl3/KUiO7Uy3Mx4BFc8v6Ks=;
        b=cOIqzTJDYmQn2JjHLEsTNtA9W8WlQJi4r3zFv5UgQQn9ablhBBzZyGKiKxTuUWzVVq
         /xvhkb6m82h8vqwEUux0w9yucYSWL8aTINMt6/ceDPgPZQLoi9e4Sz+ukzn493PLmjx6
         +R7OjYKR61Au5uN7GWCcRnsU2LBB+3IVibAGQ8xdgHLtl58/5Sb+w0f7urOdp3D9EUzJ
         DT8GvJ9YP79OUA1JyaizZ69Dl7pQqr0sB8bft1JyK+NuAw2dfmov0leUczPzSeS2U3Y7
         q+em4x4aR8f2SJ9DN3KixsgquDu2uA99dkBUPrUocYDb5zKwVjWNLF7108S6vGI6OYhs
         k4dQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:mime-version:in-reply-to:references:from:date
         :message-id:subject:to:cc:content-type;
        bh=EpZl8ud/p6E4iQIz3w1NLl3/KUiO7Uy3Mx4BFc8v6Ks=;
        b=PnaIKHHTdCPlkcR+IZYT5YY61TdO3eQ2sgzENfLB3YeMEe+bvYUl1Cvu0bOr3wWvkA
         cqLAcgTxI7k5rSpLZc5yEaevPrfyTlywFhwaOXhVb7ozswA/ES/3UGvwu2grIwnPEuJi
         elsFrYOa1lI6UHPmhfCWxrafZPPHJLHhSn1H6BWKrlkqm8c9aW5SbwRQWISenhKxnLMc
         5+Btla4HD+ye5b2Sa3VMJNSUgpfDkr8kWCaq88cEYRAuU5ykl5WF6Uw5EoAROKukJ9KW
         fkmbVwJhb2hWcvG62kWikXFff5qAu0XuPauPLP1R++BD8KkOOiRoYrfTHnY40nMqJ+wa
         wVSw==
X-Gm-Message-State: ALoCoQlD1plSJkCGjZYXgVfI+NbaHL6E47p8Bti6ygen+IS76ZE/+s9KtGtd9VWYKLtsMrUjREv8ezxDClnxL5qcVKmK/MROXA==
X-Received: by 10.112.198.102 with SMTP id jb6mr959542lbc.44.1452771491483;
 Thu, 14 Jan 2016 03:38:11 -0800 (PST)
MIME-Version: 1.0
In-Reply-To: <CAKc7PVByFUCv3hffWHk8DLhwatTqQbisjERi2Gw2BHNuJEsNGg@mail.gmail.com>
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> <20160113010147.GA4699@tarsus.local2>
 <160112180141.ZM9984@torch.brasslantern.com> <CAKc7PVBz1nNueRmEfyz3157kvJjEgHW3wmSXraKM+-9P-i5Atw@mail.gmail.com>
 <160113204847.ZM14158@torch.brasslantern.com> <CAKc7PVByFUCv3hffWHk8DLhwatTqQbisjERi2Gw2BHNuJEsNGg@mail.gmail.com>
From: Sebastian Gniazdowski <sgniazdowski@gmail.com>
Date: Thu, 14 Jan 2016 12:37:52 +0100
Message-ID: <CAKc7PVBX_5KU2rtKUjh+70DoUcVBoVYsiPq4hyfvb5NuVmvQFQ@mail.gmail.com>
Subject: Re: _history-complete-older problems with $(
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: Zsh hackers list <zsh-workers@zsh.org>
Content-Type: text/plain; charset=UTF-8
X-Seq: zsh-workers 37622

Better movie, I tried Tab multiple times with "ls" with no space after
it. I test "ls" and "$(" with and without spaces after them.

https://asciinema.org/a/bhslks3h04x328c72az3ugawz

Best regards,
Sebastian

On 14 January 2016 at 12:30, Sebastian Gniazdowski
<sgniazdowski@gmail.com> wrote:
> On 14 January 2016 at 05:48, Bart Schaefer <schaefer@brasslantern.com> wrote:
>> On Jan 13,  5:40pm, Sebastian Gniazdowski wrote:
>> Ah.  Another wrinkle I overlooked.  You need to store the original
>> values of $PREFIX and $SUFFIX somewhere, e.g.
>>
>>     local origPREFIX=$PREFIX origSUFFIX=$SUFFIX
>>
>> Then, after "compadd -O found" but before trimming PREFIX and SUFFIX
>> off of $found, you need
>>
>>     PREFIX=${PREFIX#$origPREFIX}
>>     SUFFIX=${SUFFIX%$origSUFFIX}
>>
>> This is because compadd will still try to replace the original word
>> prefix ("wid") with whatever you pass to that second compadd, so if
>> there was an original prefix/suffix you must NOT trim those off.  I
>> didn't test my original version with anything other than an empty
>> $PREFIX so didn't think of this.
>>
>> } The same problem is with "ls" about which I wrote to you earlier. So
>> } it seems that the second compadd isn't fully working.
>>
>> When _history returns nonzero, your debugging line
>>
>>     echo >> /tmp/wfhistory
>>
>> is clobbering that with its own zero return, so completion stops even
>> if no matches were found.  Move that last "echo" into the block that
>> is after "always" (right before "unfunction compadd").
>
> Bart the menucomplete option has something to do with all those
> things. I don't have the option set. When I set it it can be observed
> how your code helps or harms $(<Tab> and ls<Tab>
>
> https://asciinema.org/a/1qyjrg38s411m8rbsvmtnfwgl
>
> Best regards,
> Sebastian Gniazdowski

