1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-23 04:30:24 +02:00

22394, 22043: execute-as-is style for MIME suffixes

This commit is contained in:
Peter Stephenson 2006-04-05 10:26:30 +00:00
parent fd92cf5686
commit 2930828678
3 changed files with 29 additions and 0 deletions

View file

@ -45,6 +45,22 @@ suffix=$match[1]
context=":mime:.${suffix}:"
local handler flags no_sh no_bg
local -a exec_asis
# Set to a list of patterns which are ignored and executed as they are,
# despite being called for interpretation by the mime handler.
# Defaults to executable files, which ensures that they are executed as
# they are, even if they have a suffix.
zstyle -a $context execute-as-is exec_asis || exec_asis=('*(*)')
local pattern
for pattern in $exec_asis; do
if [[ $1 = ${~pattern} ]]; then
"$@"
return 0
fi
done
zstyle -s $context handler handler ||
handler="${zsh_mime_handlers[$suffix]}"