Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Case-insensitive completion



[redirected to zsh-workers from zsh-users]

On Sep 16, 12:09pm, Oliver Kiddle wrote:
} Subject: Re: Case-insensitive completion
}
} Bart wrote:
} 
} > - 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?

The docs have this example:

     To alter the default behaviour of file completion -- offer files
     matching a pattern and directories on the first attempt, then all
     files -- to offer only matching files on the first attempt, then
     directories, and finally all files:

          zstyle ':completion:*' file-patterns \
              '%p:globbed-files' '*(-/):directories' '*:all-files'

     This works even where there is no special pattern: _files matches
     all files using the pattern `*' at the first step and stops when it
     sees this pattern.  Note also it will never try a pattern more
     than once for a single completion attempt.

} If it is just for efficency it should perhaps be removed.

It appears to be done that way to intentionally short-circuit the process
exactly when %p is '*', so that (in the example above) no redundant group
'directories' is created when both files and directories are already in
the globbed-files group.

The correct behavior (which may be very tough to implement) would seem to
be to check the entire list of tags against the matcher style before the
loop begins, and bail at '*' only if there are no tags left with matchers.



Messages sorted by: Reverse Date, Date, Thread, Author