From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21846 invoked by alias); 27 Aug 2015 08:42:28 -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: 36290 Received: (qmail 29963 invoked from network); 27 Aug 2015 08:42:27 -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 autolearn=ham autolearn_force=no version=3.4.0 X-AuditID: cbfec7f5-f794b6d000001495-54-55decd6ed362 Date: Thu, 27 Aug 2015 09:42:09 +0100 From: Peter Stephenson To: zsh workers Subject: Re: Completion of prefix redirections is -command- instead of -redirect- Message-id: <20150827094209.4c428b0a@pwslap01u.europe.root.pri> 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> Organization: Samsung Cambridge Solution Centre X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.0; i386-redhat-linux-gnu) MIME-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrKLMWRmVeSWpSXmKPExsVy+t/xy7p5Z++FGrxcZmlxsPkhkwOjx6qD H5gCGKO4bFJSczLLUov07RK4MvpfHmcs+MdZ0XfoLksD43P2LkZODgkBE4nOtY9YIGwxiQv3 1rN1MXJxCAksZZSY8fgvE4Qzg0ni1L8eFghnG6PE/A9n2UBaWARUJXpm7Aaz2QQMJaZums0I YosAxZu//wMbKywQLNH45wPYOl4Be4meTxfA6jkFrCTOXtkPta6BWWLCrf9gCX4BfYmrfz8x QdxkLzHzyhlGiGZBiR+T74ENZRbQkti8rYkVwpaX2LzmLTOILSSgLnHj7m72CYxCs5C0zELS MgtJywJG5lWMoqmlyQXFSem5RnrFibnFpXnpesn5uZsYIYH7dQfj0mNWhxgFOBiVeHglMu6F CrEmlhVX5h5ilOBgVhLh3X8MKMSbklhZlVqUH19UmpNafIhRmoNFSZx35q73IUIC6Yklqdmp qQWpRTBZJg5OqQbGBX67U05pT/KPd2G2nG7h07fox/tFzyLuBiS3MU3dZ373tMS5denqC838 bUoENRb6m6xo1T8Xq5rXJX/sm2Wp5iEnV5nHzI0vD3lXxsapPpHe3ur/4c+SEiPf0BBRrb9X zq0PuS3IqbIjKlpP6bJuah+7Wsl8g9NHfFPjM/PXr0lta0u2O6PEUpyRaKjFXFScCAB0SlCN WAIAAA== On Wed, 26 Aug 2015 22:14:13 -0700 Bart Schaefer wrote: > 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. > > diff --git a/Src/Zle/zle_tricky.c b/Src/Zle/zle_tricky.c > index cb17bde..97bdcc0 100644 > --- a/Src/Zle/zle_tricky.c > +++ b/Src/Zle/zle_tricky.c > @@ -1185,7 +1185,7 @@ get_comp_string(void) > * relatively harmless by itself, it's probably incomplete. > */ > linredir = (inredir && !ins); > - lincmd = !linredir && > + lincmd = !inredir && > ((incmdpos && !ins && !incond) || > (oins == 2 && wordpos == 2) || > (ins == 3 && wordpos == 1) || That certainly ought to be on the right lines. I would vaguely imagine the incond and inredir ought to be doing roughly the same job, so maybe if this works !incond should be pulled out. The oins / ins / wordpos are doing the cleverness with complex commands that no one quite understands, which probably don't apply to either redirections or conditions. (You'd think there was a better way to do this using a state machine of some sort. There's a project for someone.) pws