From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22851 invoked from network); 10 Aug 2001 14:17:24 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 10 Aug 2001 14:17:24 -0000 Received: (qmail 9452 invoked by alias); 10 Aug 2001 14:17:05 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 4105 Received: (qmail 9422 invoked from network); 10 Aug 2001 14:17:04 -0000 From: martin.ebourne@arcordia.com Expiry-Date: Thu, 8 Nov 2001 -1:-1:-1 +0000 Subject: Getting context sensitive glob expansions using new completion To: zsh-users@sunsite.dk Date: Fri, 10 Aug 2001 15:11:40 +0100 Message-ID: X-MIMETrack: Serialize by Router on LON-ARCMTA-01/ARCORDIA(Release 5.0.3 (Intl)|21 March 2000) at 08/10/2001 03:15:07 PM MIME-Version: 1.0 Content-type: text/plain; charset=us-ascii Hi, I currently use styles including the following: completer :completion:* _expand _complete _ignored _approximate _prefix glob :completion:*:expand:* 1 tag-order :completion:*:expand:* all-expansions expansions original I also have menu completion switched off at all times (apart from _approximate). So then when I type eg. ls * the * is expanded immediately into a full list of files (by _expand, tab being mapped to complete-word). This is what I want for ls. However, in general I would like the * expansion to be the list of things valid at the point rather than always a list of files, which is what I currently get. eg. functions * should expand to a list of functions. So to achieve this I tried the following: To add the list of all expansions I added _all_matches, and to get a list of valid expansions using globbing I added _match. I added _match before _complete because I want globbing to be expanded first, as in: zstyle ':completion:*' completer _all_matches _expand _match _complete _ignored _approximate _prefix In order to prevent _match from affecting anything entered which is not a pattern I did: zstyle ':completion:*' match-original only In order that the all expansions list contains only those generated by globbing I did this: zstyle ':completion:*' avoid-completer _expand _complete _ignored _approximate _prefix And in order to stop expand from getting there first I did this: zstyle ':completion:*:expand:*' glob false Now everything nearly works. I seem to get a list of all expansions when I want it (ie. when a glob pattern is present), containing the matches I want (ie. context dependant). However, I also get the list of individual matches, and it launches into menu completion at the first available opportunity. So I though maybe one of these might help: zstyle ':completion:*:all-matches:*' tag-order all-matches zstyle ':completion:*:match:*' tag-order all-matches But unfortunately neither of them seemed to do anything. (even when I changed it to ':completion:*' and deleted all my other tag-orders.) Any suggestions on how to get the last step of inserting the all-matches list straight way? Thanks, Martin. This e-mail message is CONFIDENTIAL and may contain legally privileged information. If you are not the intended recipient you should not read, copy, distribute, disclose or otherwise use the information in this e-mail. Please also telephone or fax us immediately and delete the message from your system. E-mail may be susceptible to data corruption, interception and unauthorised amendment, and we do not accept liability for any such corruption, interception or amendment or the consequences thereof.