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

Re: Completion in pwd before subdirecories

On Dec 15, 12:49pm, Oliver Kiddle wrote:
}   zstyle ':completion:*' file-patterns \
}       '*(-/):directories %p(^-/):globbed-files' '*:all-files'
} Unfortunately, that will now break for any completion which specifies a
} glob qualifier such as _chown.

Are you sure about that?

} I've been meaning to go through adding `#q' into all of them

There's code in _files to attempt to merge together any trailing stuff
that looks like glob qualifiers, because _files predates the #q flag.
In fact, I'm suspicious that adding #q might actually break things.

} I'm not quite sure whether the default file-patterns style shouldn't
} use %p(^-/) for globbed-files anyway.

I don't think I understand the question.

Are you suggesting that we should split the existing globbed-files default
into globbed-files and globbed-directories?  I.e., so that instead of the
default ordering of

    globbed-files directories all-files

we'd have

    globbed-files globbed-directories all-directories all-files 

or something like that?

} What if we want to glob directory names from a completion function?

I'm not making the connection between that question and the previous one.

However, nothing stops any completion function from doing something like

    zstyle -m ":completion:${curcontext}:" file-patterns '*' ||
	zstyle ":completion:${curcontext}:" file-patterns \
	    '%p(-/):directories %p(^-/):globbed-files' '*:all-files'

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