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

20199: improve MIME handling.

This commit is contained in:
Peter Stephenson 2004-07-26 16:59:53 +00:00
parent 17e576782c
commit 8c9a6b01d1
9 changed files with 175 additions and 7 deletions

View file

@ -82,8 +82,13 @@ if [[ -n $DISPLAY ]]; then
for browser in $xbrowsers; do
if [[ $windows[(I)(#i)$browser] -ne 0 ]]; then
if [[ $browser = konqueror ]]; then
# I'm sure there's documentation for this somewhere...
dcop $(dcop|grep konqueror) default openBrowserWindow $url
# kfmclient is less hairy and better supported than direct
# use of dcop. Run kfmclient --commands
# for more information. Note that as konqueror is a fully
# featured file manager, this will actually do complete
# MIME handling, not just web pages.
kfmclient openURL $url ||
dcop $(dcop|grep konqueror) default openBrowserWindow $url
else
# Mozilla bells and whistles are described at:
# http://www.mozilla.org/unix/remote.html

View file

@ -53,14 +53,30 @@ fi
# to handlers and their flags.
typeset -A suffix_type_map type_handler_map type_flags_map
local -a default_type_files default_cap_files
local -a type_files cap_files array match mbegin mend
local file line type suffix exts elt flags line2
integer ind
default_type_files=(~/.mime.types /etc/mime.types)
default_cap_files=(~/.mailcap /etc/mailcap)
# Customizable list of files to examine.
zstyle -a :mime: mime-types type_files ||
type_files=(~/.mime.types /etc/mime.types)
zstyle -a :mime: mailcap cap_files ||
cap_files=(~/.mailcap /etc/mailcap)
if zstyle -a :mime: mime-types type_files; then
while (( (ind = ${type_files[(I)+]}) > 0 )); do
type_files[$ind]=($default_type_files)
done
else
type_files=($default_type_files)
fi
if zstyle -a :mime: mailcap cap_files; then
while (( (ind = ${cap_files[(I)+]}) > 0 )); do
cap_files[$ind]=($default_cap_files)
done
else
cap_files=($default_cap_files)
fi
{
mime-setup-add-type() {