/usr/share/zsh/functions/MIME/zsh-mime-contexts is in zsh-common 5.0.2-3ubuntu6.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | # Helper for zsh-mime-handler.
#
# Pass in a zstyle option, a suffix, which might include multiple parts
# (e.g. pdf.gz), plus remaining zstyle arguments plus arguments to zstyle.
# Try to match the style starting with the longest possible suffix.
local context suffix option
option=$1
shift
suffix=$1
shift
while true; do
context=":mime:.${suffix}:"
zstyle $option $context "$@" && return 0
if [[ $suffix = *.* ]]; then
suffix=${suffix#*.}
else
break
fi
done
return 1
|