From 293082867800add063072dbfcdd65458ae1fcb28 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Wed, 5 Apr 2006 10:26:30 +0000 Subject: 22394, 22043: execute-as-is style for MIME suffixes --- Functions/MIME/zsh-mime-handler | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'Functions') diff --git a/Functions/MIME/zsh-mime-handler b/Functions/MIME/zsh-mime-handler index b8c6b6925..ab0c27fb0 100644 --- a/Functions/MIME/zsh-mime-handler +++ b/Functions/MIME/zsh-mime-handler @@ -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]}" -- cgit 1.4.1