From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21894 invoked from network); 15 Sep 2000 18:03:00 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 15 Sep 2000 18:03:00 -0000 Received: (qmail 24087 invoked by alias); 15 Sep 2000 18:00:27 -0000 Mailing-List: contact zsh-users-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 3426 Received: (qmail 24072 invoked from network); 15 Sep 2000 18:00:24 -0000 X-Envelope-Sender-Is: Andrej.Borsenkow@mow.siemens.ru (at relayer david.siemens.de) From: "Andrej Borsenkow" To: "E. Jay Berkenbilt" , Subject: RE: glob completion without menu style completion Date: Fri, 15 Sep 2000 22:00:19 +0400 Message-ID: <000101c01f3e$cf699350$21c9ca95@mow.siemens.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) In-Reply-To: <200009151730.NAA30732@soup.ads.apexinc.com> Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 > > (zsh-3.1.9-dev-6) > > If I type > > rmdir TAB > > I get a list of only directories. > > If I setopt glob_complete and do > > rmdir *TAB > > then each subsequent tab cycles through only directories. > > If I don't have setopt glob_complete and I do > > rmdir *TAB > > the * gets replaced with all files in the directory that would be > matched by * if I were to just hit return at that moment. > > Is there a way to get it so that when I type > > rmdir *TAB > > the * gets replaced with all the choices that the completion system > returns at that time (i.e., whatever glob pattern I've typed should be > applied to the completion choices rather than to files)? I don't see > an option to do this. > > This would be so great for commands like cvs add and cvs rm....... > Yes, I can reproduce it. It happens, because by default TAB is bound to expand-or-complete widget that tries expansion if it sees glob pattern *before* it tries completion. So, it seems, that completion system sees input line with already expanded '*' ... I personally consider it a bug, but Sven should answer it when he is back. You are better off if you redefine TAB to simple expand-word like bindkey '^I' expand-word (that is what I have in my .zshrc), and use _match or _expand completers. I personally do not have much experience with _expand, I use _match. Use them as secondary competer; I use zstyle ':completion:*' completer _oldlist _complete _match and I get exactly what you want. In general, _match will try to match possible completions (in this case, directory names) against pattern on command line. It will be used if _complete did not generate any completions, that is, no directory that started with '*' existed :-) In general, it is always good idea to use plain complete-word with new completion system, because then you have much better control over possible interpretation of patterns. -andrej