mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-27 16:50:58 +01:00
25236: zsh-mime-setup -l arguments
This commit is contained in:
parent
6763a3cc55
commit
4f9c07dc05
3 changed files with 20 additions and 3 deletions
|
|
@ -1,3 +1,8 @@
|
||||||
|
2008-06-23 Peter Stephenson <pws@csr.com>
|
||||||
|
|
||||||
|
* 25236: Doc/Zsh/contrib.yo, Functions/MIME/zsh-mime-setup:
|
||||||
|
zsh-mime-setup -l can take suffix arguments.
|
||||||
|
|
||||||
2008-06-21 Peter Stephenson <p.w.stephenson@ntlworld.com>
|
2008-06-21 Peter Stephenson <p.w.stephenson@ntlworld.com>
|
||||||
|
|
||||||
* 25231: Completion/Unix/Type/_path_files: fix approximation
|
* 25231: Completion/Unix/Type/_path_files: fix approximation
|
||||||
|
|
|
||||||
|
|
@ -1504,7 +1504,7 @@ command to an appropriate viewer.
|
||||||
startitem()
|
startitem()
|
||||||
findex(zsh-mime-setup)
|
findex(zsh-mime-setup)
|
||||||
findex(zsh-mime-handler)
|
findex(zsh-mime-handler)
|
||||||
xitem(tt(zsh-mime-setup [-flv]))
|
xitem(tt(zsh-mime-setup) [ tt(-fv) ] [ tt(-l) [ var(suffix ...) ] ])
|
||||||
item(tt(zsh-mime-handler))(
|
item(tt(zsh-mime-handler))(
|
||||||
These two functions use the files tt(~/.mime.types) and tt(/etc/mime.types),
|
These two functions use the files tt(~/.mime.types) and tt(/etc/mime.types),
|
||||||
which associate types and extensions, as well as tt(~/.mailcap) and
|
which associate types and extensions, as well as tt(~/.mailcap) and
|
||||||
|
|
@ -1525,8 +1525,14 @@ Repeated calls to tt(zsh-mime-setup) do not override the existing
|
||||||
mapping between suffixes and executable files unless the option tt(-f)
|
mapping between suffixes and executable files unless the option tt(-f)
|
||||||
is given. Note, however, that this does not override existing suffix
|
is given. Note, however, that this does not override existing suffix
|
||||||
aliases assigned to handlers other than tt(zsh-mime-handler).
|
aliases assigned to handlers other than tt(zsh-mime-handler).
|
||||||
|
|
||||||
Calling tt(zsh-mime-setup) with the option tt(-l) lists the existing
|
Calling tt(zsh-mime-setup) with the option tt(-l) lists the existing
|
||||||
mappings without altering them. Calling tt(zsh-mime-setup) with the option
|
mappings without altering them. Suffixes to list (which may contain
|
||||||
|
pattern characters that should be quoted from immediate interpretation
|
||||||
|
on the command line) may be given as additional arguments, otherwise
|
||||||
|
all suffixes are listed.
|
||||||
|
|
||||||
|
Calling tt(zsh-mime-setup) with the option
|
||||||
tt(-v) causes verbose output to be shown during the setup operation.
|
tt(-v) causes verbose output to be shown during the setup operation.
|
||||||
|
|
||||||
The system respects the tt(mailcap) flags tt(needsterminal) and
|
The system respects the tt(mailcap) flags tt(needsterminal) and
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,13 @@ if [[ -n $o_list ]]; then
|
||||||
# so we don't need to search styles for suffixes that aren't
|
# so we don't need to search styles for suffixes that aren't
|
||||||
# handled. Yet.
|
# handled. Yet.
|
||||||
local list_word
|
local list_word
|
||||||
for suffix in ${(ko)zsh_mime_handlers}; do
|
local -a handlers
|
||||||
|
if (( $# )); then
|
||||||
|
handlers=(${(k)zsh_mime_handlers[(I)${(j.|.)*}]})
|
||||||
|
else
|
||||||
|
handlers=(${(k)zsh_mime_handlers})
|
||||||
|
fi
|
||||||
|
for suffix in ${(o)handlers}; do
|
||||||
zstyle -s ":mime:.$suffix:" handler list_word ||
|
zstyle -s ":mime:.$suffix:" handler list_word ||
|
||||||
list_word=${zsh_mime_handlers[$suffix]}
|
list_word=${zsh_mime_handlers[$suffix]}
|
||||||
print ${(r.10.)suffix}$list_word
|
print ${(r.10.)suffix}$list_word
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue