zsh-users
 help / color / mirror / code / Atom feed
From: martin.ebourne@arcordia.com
To: zsh-users@sunsite.dk
Subject: Getting context sensitive glob expansions using new completion
Date: Fri, 10 Aug 2001 15:11:40 +0100	[thread overview]
Message-ID: <OFA283F88D.853C8B12-ON80256AA4.004C4A5B@uk.jpmorgan.com> (raw)


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 *<tab>
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 *<tab>
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.


             reply	other threads:[~2001-08-10 14:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-10 14:11 martin.ebourne [this message]
2001-08-10 14:40 ` Borsenkow Andrej
2001-08-13 10:31 martin.ebourne

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=OFA283F88D.853C8B12-ON80256AA4.004C4A5B@uk.jpmorgan.com \
    --to=martin.ebourne@arcordia.com \
    --cc=zsh-users@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).