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.1 (2015-04-28) 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.1
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=mime-version:in-reply-to:references:date:message-id:subject:from:to
         :cc;
        bh=7irYd/68pSpM2m5DMjT8f46qfg3tprf11jzhOWRBxIg=;
        b=iHfbs1kpl2h5gqOMM6BtX2XqHY1c4uq64Xjim8jOe1Sx/zAxVnudvGsAYQf+DECS+M
         ODTHioxhV7G5teFJHWY4bj1IxBiLW/RX+K3crXlZv+GuI/lcXb7iaoA/Pu0qTtHfq9Hs
         wkh0nECQODGu7mj88Uo/XmaeQG68gizoH0N+SILKCXWGwsWw3+zyZtGXSRumPIYtdf1/
         dIumlYDgKrQwPwL4l3JwH5Yogh0wbLbo+f30tZfAlaZssoe6VEhR5OI5+JEclU/XAijL
         fPrwuXL2fBLtoNLm18B5wPb1pMGuax2v27732T+eI3GPwFmSgIQEJDx2pXY3AWVXfegI
         hTCQ==
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:date
         :message-id:subject:from:to:cc;
        bh=7irYd/68pSpM2m5DMjT8f46qfg3tprf11jzhOWRBxIg=;
        b=C4/QmGXeK5R8fA11Ol5o1Kbu7A0IwMpHVgnMKuCjvOquRd87d+09DSHpIG0nD+nbzw
         Z+eYi8hX6a2NgVJJ8dzB5WxvWujVF2I4OTkiNKp53rTeDf++fU73frUBI6eLz0RXeBKB
         C/PCwLbWwUiHv1iM0XCsSfwRuofiM7mYWf2X+zZRq+1s4dTCNdPG9hqnsQqTKZ+K5wxq
         i7G0/yoxRQRtK02nofN3pdvB5VkfyoS7DBwI47Wx0G9AkKTaHonBfs5i8VepVa0iYvyQ
         tw6dYf+83BvgIRvOeTd4OCxsyxHX/XQ0GDmpT/Cker1YWtbQQT0+v47WXlSqqRSaHHoG
         awaw==
X-Gm-Message-State: AD7BkJKOk+mqVL2W4GWtmgKyEWW1BExoZbGA9zlNDJku8CCiT5TbAmnkOh4sivjNFcTtJvvxuC7dPKvWSQWZSQ==
MIME-Version: 1.0
X-Received: by 10.55.79.5 with SMTP id d5mr42173158qkb.30.1457523663500; Wed,
 09 Mar 2016 03:41:03 -0800 (PST)
In-Reply-To: <CAHYJk3SbxtRxh6N0WtVfgSf0urCkYyqGG0foEHT72g93E-_hfQ@mail.gmail.com>
References: <20160226175937.GA22547@lorien.comfychair.org>
	<160226114511.ZM17604@torch.brasslantern.com>
	<8456.1456706752@thecus.kiddle.eu>
	<160306094154.ZM20831@torch.brasslantern.com>
	<CAHYJk3R-gr5C2LTJeXKaW7oUfs49pdPKkj=y3-XCv2dMT7rbcA@mail.gmail.com>
	<CAHYJk3SbxtRxh6N0WtVfgSf0urCkYyqGG0foEHT72g93E-_hfQ@mail.gmail.com>
Date: Wed, 9 Mar 2016 12:41:03 +0100
Message-ID: <CAHYJk3R8TJLbSQYqAAJyvYjMZvgy2+W8qkGO9DLyEQmXOGppNQ@mail.gmail.com>
Subject: Re: reverse-menu-complete re-starting completion on 5.2?
From: Mikael Magnusson <mikachu@gmail.com>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: Zsh workers <zsh-workers@zsh.org>
Content-Type: text/plain; charset=UTF-8
X-Seq: zsh-workers 38119

On Wed, Mar 9, 2016 at 12:12 PM, Mikael Magnusson <mikachu@gmail.com> wrote:
> On Mon, Mar 7, 2016 at 3:05 AM, Mikael Magnusson <mikachu@gmail.com> wrote:
>> On Sun, Mar 6, 2016 at 6:41 PM, Bart Schaefer <schaefer@brasslantern.com> wrote:
>>> Meant to respond to this a while ago ...
>>>
>>> On Feb 29,  1:45am, Oliver Kiddle wrote:
>>> }
>>> } Even before that commit I can reproduce a variant of the problem by
>>> } starting menu completion with reverse-menu-complete and then switching
>>> } to a forwards menu complete.
>>>
>>> Not surprising, really.
>>>
>>> } [...] I'm really not sure why we need to be so
>>> } strict about the completion widget matching the last completion widget.
>>>
>>> The only reason I can think of is in case menu completion is invoked from
>>> within a user-defined widget, or otherwise entered by a different widget
>>> than simple forward/reverse menu completion.  In that instance the user is
>>> presumably not continuing with the menu in progress but instead wants to
>>> start over.  I.e. similar to tests of $LASTWIDGET in Functions/Zle/*.
>>>
>>> } anyone foresee any problem with just relaxing the condition (see patch).
>>>
>>> Maybe we'd need another flag action for "zle -f" to continue/interrupt a
>>> menu in progress, but probably it will work as expected more often with
>>> the patch than without.  I suggest you push and we'll find out if a need
>>> for a flag arises.
>>
>> I can tell you I quite often complete a directory name using normal
>> completion, and then press ctrl-n to complete files inside by latest
>> modification date. If this continued cycling directories instead, it
>> would be quite inconvenient. But yeah, push and we'll see what happens
>> to that.
>
> Well, this use-case did indeed break with this commit.

While I'm sure everyone would be happy to reimplement this keybind
based on my vague description, here is the relevant setup:

zstyle ':completion:most-recent-file:*' match-original both
zstyle ':completion:most-recent-file:*' file-sort modification
zstyle ':completion:most-recent-file:*' file-patterns '*:all\ files'
zstyle ':completion:most-recent-file:*' hidden all
zstyle ':completion:most-recent-file:*' completer _files
zle -C most-recent-file menu-complete _generic

bindkey "^N"      most-recent-file

I would like ^N after TAB to start completion over (even if this was
originally a ^N completion), but TAB after ^N to continue the same
completion. This is how it worked before the commit. I'm fine with
replacing _generic with something else either custom in my rc or if we
distribute a new helper function.

-- 
Mikael Magnusson

