* PATCH: _mozilla for firefox
@ 2005-08-15 14:32 Felix Rosencrantz
0 siblings, 0 replies; only message in thread
From: Felix Rosencrantz @ 2005-08-15 14:32 UTC (permalink / raw)
To: Zsh hackers list
[-- Attachment #1: Type: text/plain, Size: 142 bytes --]
This change adds support for firefox in the _mozilla completer. Works
with firefox on linux and Darwin. Only tested with firefox.
-FR.
[-- Attachment #2: firefox_patch.txt --]
[-- Type: text/plain, Size: 3312 bytes --]
Index: Completion/X/Command/_mozilla
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/X/Command/_mozilla,v
retrieving revision 1.6
diff -u -r1.6 _mozilla
--- Completion/X/Command/_mozilla 8 Jun 2005 05:33:48 -0000 1.6
+++ Completion/X/Command/_mozilla 14 Aug 2005 23:11:19 -0000
@@ -1,37 +1,42 @@
-#compdef mozilla mozilla-firefox mozilla-xremote-client
+#compdef mozilla mozilla-firefox mozilla-xremote-client firefox
local curcontext="$curcontext" state line expl ret=1 suf
typeset -A opt_args
local popts="-installer -CreateProfile -P -ProfileWizard -ProfileManager -SelectProfile"
+local -a mozopts
if [[ $service = *remote* ]]; then
state=remote
else
- _x_arguments -C \
+ if [[ $service != *firefox* ]]; then
+ mozopts=(
+ "($popts)-installer[start with 4.x migration window]"
+ "($popts)-CreateProfile:profile"
+ "($popts)-ProfileWizard[start with profile wizard]"
+ "($popts)-SelectProfile[start with profile selection dialog]"
+ '-splash[enable splash screen]'
+ '-chat[start with IRC client]'
+ '-news[start with news]'
+ '-venkman[start with JavaScript debugger]'
+ '-terminal[start with command line terminal]'
+ '-mail[start with mail]'
+ '-compose[start with messenger compose]:URL:_urls'
+ )
+ fi
+ _x_arguments -C $mozopts \
'-height[height of startup window]:height' \
'(-)'{-h,-help}'[show usage message]' \
- "($popts)-installer[start with 4.x migration window]" \
'-width[width of startup window]:width' \
'(-)'{-v,-version}'[show the version number and build date]' \
- "($popts)-CreateProfile:profile" \
- "($popts)-P[start with profile]:profile:compadd ~/.mozilla/*/*.slt(\:h\:t)" \
- "($popts)-ProfileWizard[start with profile wizard]" \
+ "($popts)-P[start with profile]:profile:->profile" \
"($popts)-ProfileManager[start with profile manager]" \
- "($popts)-SelectProfile[start with profile selection dialog]" \
'-UILocale:locale' \
'-contentLocale:locale' \
'-remote[execute a command in an existing Mozilla]:remote command:->remote' \
- '-splash[enable splash screen]' \
- '-chat[start with IRC client]' \
- '-news[start with news]' \
'-jsconsole[start with JavaScript Console]' \
- '-venkman[start with JavaScript debugger]' \
- '-terminal[start with command line terminal]' \
'-edit[start with editor]:URL:_urls' \
'-chrome[load the specified chrome]:URL:_urls' \
- '-mail[start with mail]' \
- '-compose[start with messenger compose]:URL:_urls' \
'*:location:->urls' && ret=0
fi
@@ -104,4 +109,26 @@
fi
fi
+if [[ $state == "profile" ]]; then
+ if [[ $service == *firefox* ]]; then
+ local -a profiles text profiledir
+ case "$OSTYPE" in
+ darwin*) profiledir=~/"Library/Application Support/Firefox" ;;
+ *) profiledir=~/.mozilla/firefox/ ;;
+ esac
+ profiles=(${(f)"$(< ${profiledir}/profiles.ini)"})
+ profiles=(${(M)${profiles}:#(\[Profile|(Path|Name)=)*})
+ text=${(F)profiles}
+ profiles=(${(f)text//(#b)\[Profile([0-9]##)\]
+Name=([^
+]##|)
+Path=([^
+]##|)/$match[2]})
+ profiles=(${profiles%:})
+ compadd $profiles
+ else
+ compadd ~/.mozilla/*/*.slt(\:h\:t)
+ fi
+fi
+
return ret
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-08-15 14:32 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-15 14:32 PATCH: _mozilla for firefox Felix Rosencrantz
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).