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

Re: More fun with completion: glob qualifiers ignored for ignored-patterns style?



On Jul 14,  1:33pm, Philippe Troin wrote:
} Subject: More fun with completion: glob qualifiers ignored for ignored-pat
}
} % zstyle ':completion:*:all-files' ignored-patterns '*(/)'

The ignored-patterns style is not checked for the all-files tag, only for
the globbed-files tag in _files and the argument-rest tag in _normal.

However, even if you set it for the correct tag, it still won't work,
because it really is a _pattern_ (as in [[ string = pattern ]]) and not
a filesystem glob.  It can only match the string, not the file type.

} Is that because bare_glob_qual is unset when expanding the pattern?

So, no.

} By the way, the manual says about glob qualifiers:
} 
}    If the option BARE_GLOB_QUAL is set, then a trailing set of parentheses
}    containing no `|' or `(' characters (or `~' if it is special) is taken
}    as a set of glob qualifiers.
} 
} Does that mean that:
} 
}  - if BARE_GLOB_QUAL is set, glob qualifiers are enabled
} 
}  - if BARE_GLOB_QUAL is unset, glob qualifiers are disabled?

In 4.0.x, that's effectively what it means.  BARE_GLOB_QUAL was added in
anticipation of other qualifier syntax that had not been invented yet.

In 4.1.x, it means that if BARE_GLOB_QUAL is set, zsh uses a heuristic to
decide if a trailing parenthesized expression is a glob qualifier, and if
BARE_GLOB_QUAL is NOT set, you have to 'setopt EXTENDED_GLOB' and use an
explicit (#q) to introduce a qualifier.



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