From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7831 invoked by alias); 27 Aug 2015 06:23:02 -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: 36289 Received: (qmail 25927 invoked from network); 27 Aug 2015 06:23:01 -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=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM 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:date:message-id:subject:from:to :cc:content-type; bh=3XLNBjJmezXJxljbjHfE3kYITKkcn4vTKqazXYkT3x8=; b=HSjqShxaxBQD5KZZ4Nftq5dmLbxa5qkcaD81rRcqeRxQQFIjFIY22XShqjwFhu8lvZ 4Zpdp0DgckovfzXo2n12RbusvSwmiK7V2DiroiYKxkP6SuzpaPmK8Euwg+5xVV7jh5zq LXfrsZQpceYGN06S8+otjdJp8R+p7/qsFqlHkxuw+QHmVDRoHIJFG6G7G5WCVrarnTZt nhSHvzCJMwAr0FCkNyo4GcSQnbe3FVR94QWzJY/oMCoB0itrbmzOzxCLLkZF8WwnZWlD wAZPo7yauXh36BEjZTQgN2Ar5tMNE0jElKuQ1A7zZByNhH8zbtWY4Gi77RXXuLwk8ZSN VVEA== MIME-Version: 1.0 X-Received: by 10.55.48.5 with SMTP id w5mr3687257qkw.94.1440656579267; Wed, 26 Aug 2015 23:22:59 -0700 (PDT) In-Reply-To: <150826221413.ZM25355@torch.brasslantern.com> References: <20150826053928.GD19027@tarsus.local2> <150826111808.ZM30185@torch.brasslantern.com> <150826213532.ZM31157@torch.brasslantern.com> <150826214729.ZM12037@torch.brasslantern.com> <150826221413.ZM25355@torch.brasslantern.com> Date: Thu, 27 Aug 2015 08:22:59 +0200 Message-ID: Subject: Re: Completion of prefix redirections is -command- instead of -redirect- From: Mikael Magnusson To: Bart Schaefer Cc: zsh workers Content-Type: text/plain; charset=UTF-8 On Thu, Aug 27, 2015 at 7:14 AM, Bart Schaefer wrote: > On Aug 27, 6:54am, Mikael Magnusson wrote: > } > } < ; gives commands (correct) > > This is better than 5.0.7, which gives files here. > > } foo < ; gives files (wrong-ish) > > Hasn't changed from 5.0.7. > > } ; < gives commands (wrong) > > This has changed, 5.0.7 gets it right. > > } foo=bar; < gives commands (wrong, presumably same case as the above) > > Hasn't changed since 5.0.7. > > } Is there any reason we can't just reset state to 'this is a new > } command' when we see an unquoted solo semicolon? Or is determining > } that this is the case in fact the trouble? > > My recollection of all of this is that it has to do with completing > in the middle of for/while/repeat type constructs, where the ";" may > be followed by "do" after which you have to stay in command position, > or you may be in shortloops syntax, etc. But I don't recall (and > likely never really understood Sven's explanation of) all the details. > > The below seems to make it better, the only case that is still wrong > after this is "foo < ; ". But I haven't more than minimally > checked that completing in e.g. "for" loops still works properly. When I try this patch, I get all my previous cases right except the one you mentioned, but also ; < : completes files instead of commands now (before, it completed commands both with and without the : there, so not more correct in total). However, foo=bar; < : does work, so I can't imagine anyone complaining about this particular case soon. I'll run with both of the patches applied for a while and see if anything more pops out. PS If anyone can get for (a b) { to complete commands, that would be nice too :). (this never worked) -- Mikael Magnusson