zsh-users
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <okiddle@yahoo.co.uk>
To: Zsh-users List <zsh-users@sunsite.dk>
Subject: Re: Case-insensitive completion
Date: Tue, 16 Sep 2003 12:09:17 +0200	[thread overview]
Message-ID: <10378.1063706957@gmcs3.local> (raw)
In-Reply-To: <1030914185817.ZM27558@candle.brasslantern.com>

Bart wrote:

> This is a start at it:
> 
> -------
> zstyle ':completion:*:ci-globbed-files' matcher 'm:{a-z}={A-Z}'
> zstyle ':completion:*' file-patterns \
>   '(#I)%p:globbed-files %p:ci-globbed-files' '*:all-files'
> zstyle ':completion:*' group-order globbed-files ci-globbed-files all-files
> zstyle ':completion:*' group-name ''
> -------
> 
> The difficulties are:
> 
> - It may work differently when completing in default context than when
>   completing after a command such as "ls" that has its own completion
>   function defined.  E.g., "ls" somehow ignores the globbed-files group
>   and goes directly to ci-globbed-files, I don't know why.

Problem is related to nested tag loops and the old problem of ordering
of options passed down versus those determined further down.

In this case, all matches are going into an argument-rest group thanks
to _arguments and the more specific group names get ignored. I can't
see a way round it using styles because you can't avoid the -default-
group.

Not easy to solve more generally either. Long term we probably need to
keep track of the whole chain of tags used along the way.

> - It's quite difficult to express the concept "only files that match
>   case-insensitively, not those that match case-sensitively."  Thus the
>   ci-globbed-files group is a superset of globbed-files and you get a
>   redundant listing.

This is a bit unfortunate. Matching control probably needs a way to
specify that only matches which needed the rule should be matched.
Handling ordering for pure menu completion users is simply something
which was never particularly considered.

> - file-patterns are not tried after the first one that has the pattern
>   '*:...' which is why the (#I) is thrown in on globbed-files, to force
>   attempting both globbed-files and ci-globbed-files even if the match
>   pattern substituted by %p is '*'.

Yuk. Could you see if there was a good reason for that? If it is just
for efficency it should perhaps be removed. Will fall down with other
styles like ignored-patterns and ignore-line.

> Also note that there was at least one dev release where %p was not
> handled properly.  I don't recall whether 4.0.7 has that bug.  I tried
> the above only with the current CVS incarnation of 4.1.1-dev-1.

I think that bug is in 4.0.7 which is quite bad really.

Oliver


  parent reply	other threads:[~2003-09-16 10:07 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-14 10:30 Jesper Holmberg
2003-09-14 18:58 ` Bart Schaefer
2003-09-15 19:08   ` Jesper Holmberg
2003-09-16 17:03     ` Bart Schaefer
2003-09-17  7:30       ` Oliver Kiddle
2003-09-17 14:36         ` Bart Schaefer
2003-09-16 10:09   ` Oliver Kiddle [this message]
2003-09-16 11:59     ` Peter Stephenson
2003-09-16 12:17       ` Oliver Kiddle
2003-09-16 12:22         ` Jesper Holmberg
2003-09-17  7:40 ` Oliver Kiddle
2003-09-17 14:43   ` Bart Schaefer
2003-09-17 15:15     ` Oliver Kiddle
2003-09-18 10:26       ` Jesper Holmberg

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=10378.1063706957@gmcs3.local \
    --to=okiddle@yahoo.co.uk \
    --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).