From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8734 invoked by alias); 14 Jan 2016 11:31:19 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 37621 Received: (qmail 14582 invoked from network); 14 Jan 2016 11:31:19 -0000 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=cbQLq2ZKvCJLEvcmxLbcijnj1goGh43wKnPUWWUost0=; b=j5b3HQzEFVTMig98WDaE61juFhMZQTimbMAqQwHcH1IQ/y5P1GPvYTTHulU8LTA2Od vyYyFn92lKFvOxa6BdMQ/Ax6+oQlMSazyKkA6LaMZyKrI3G28qGPTwlO/laQv+ogR5Ch zHA54b3j0iESczq/EMy9iw9r+dPgBZcSrnSm8ALZQiwRiXEqd3M41cN1qdkNmmDeHF/9 GMFUeJkDyLaaAdzYH2fBuzBx5SJpTMkjkyHkuh1p4D9n+wfKGbAn2xcWsxdTyJrrIQ2L 0T+i9kn8vkUlHJ5UDh1RHVO1y2iq9kdZUvAkvtc26X4hYFdWeRttnNbuCsqZHLPiKbJo B3tg== 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=cbQLq2ZKvCJLEvcmxLbcijnj1goGh43wKnPUWWUost0=; b=J6LxL9bBbVhleu3glv3YlAY51+7/2JTB7i8YOGTgmEzN5DcxTmkHEyhR43S3nI9/Zf ieH4RtBFaBWTKjIQcqiFd7DpfiMsQEF+5l6emvh0c4lIL+doqzg0aZxJJuwKWR+NTgWj 2flOcAi3KiylJA5CxfFIX38GI/mqHp/FN752pZk1gWknszDRFRsqihJ02j5FNKqlXNm/ SUaHHv4U1+dFsqDWb2ZoyIpwCKbED/vl0Z9sDFOGWZEb2KAHi1U7PRfNzx6bOHe+PPqr zYwIYpOQiTkKg53ODjDI9frtQgsJfL9NcQ0o1E8VFwb+Y2CVeciLwTX1fz9978X7yHuN d/7Q== X-Gm-Message-State: ALoCoQnwVi0esWRqSCx2e/HWAwJOZ/7LMaEJdk72vVjRJx4A88nTOvBl8MOroPBxY5BAuek5ezqvVeUthpPfjq4bFUViFChqEw== X-Received: by 10.25.41.193 with SMTP id p184mr964509lfp.150.1452771076845; Thu, 14 Jan 2016 03:31:16 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <160113204847.ZM14158@torch.brasslantern.com> References: <160111161501.ZM5305@torch.brasslantern.com> <160112113928.ZM9065@torch.brasslantern.com> <20160113010147.GA4699@tarsus.local2> <160112180141.ZM9984@torch.brasslantern.com> <160113204847.ZM14158@torch.brasslantern.com> From: Sebastian Gniazdowski Date: Thu, 14 Jan 2016 12:30:57 +0100 Message-ID: Subject: Re: _history-complete-older problems with $( To: Bart Schaefer Cc: Zsh hackers list Content-Type: text/plain; charset=UTF-8 On 14 January 2016 at 05:48, Bart Schaefer 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 $( and ls https://asciinema.org/a/1qyjrg38s411m8rbsvmtnfwgl Best regards, Sebastian Gniazdowski