From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24176 invoked from network); 18 Jan 2005 08:06:15 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 18 Jan 2005 08:06:15 -0000 Received: (qmail 4376 invoked from network); 18 Jan 2005 07:53:38 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 18 Jan 2005 07:53:38 -0000 Received: (qmail 14808 invoked by alias); 18 Jan 2005 02:10:32 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 8390 Received: (qmail 14789 invoked from network); 18 Jan 2005 02:10:31 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 18 Jan 2005 02:10:30 -0000 Received: (qmail 34843 invoked from network); 18 Jan 2005 02:10:30 -0000 Received: from ms-smtp-04.texas.rr.com (24.93.47.43) by a.mx.sunsite.dk with SMTP; 18 Jan 2005 02:10:26 -0000 Received: from amdxp.kalama.no-ip.org (cs666888-186.austin.rr.com [66.68.88.186]) by ms-smtp-04.texas.rr.com (8.12.10/8.12.7) with ESMTP id j0I2ALJ5020475; Mon, 17 Jan 2005 20:10:21 -0600 (CST) Received: from [10.0.1.100] (mothership.kalama.no-ip.org [10.0.1.100]) by amdxp.kalama.no-ip.org (Postfix) with ESMTP id 38EE15BF; Mon, 17 Jan 2005 20:10:21 -0600 (CST) In-Reply-To: References: <5F375244-DBDD-11D8-8A54-000D93502E64@h8.dion.ne.jp> Mime-Version: 1.0 (Apple Message framework v619) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <17D2B452-68F6-11D9-B3B9-000A95D2C79E@kalama.no-ip.org> Content-Transfer-Encoding: 7bit Cc: Motoi Washida Reply-To: zsh-users@sunsite.dk From: lists Subject: Re: Completion functions for Mac OS X Date: Mon, 17 Jan 2005 20:10:15 -0600 To: zsh-users@sunsite.dk X-Mailer: Apple Mail (2.619) X-Virus-Scanned: Symantec AntiVirus Scan Engine X-Spam-Checker-Version: SpamAssassin 3.0.2 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, score=-2.4 required=6.0 tests=AWL,BAYES_00 autolearn=ham version=3.0.2 X-Spam-Hits: -2.4 Hi Motoi, Thanks so much for the quick fix! I wanted to test on a few different systems before replying. On Jan 16, 2005, at 10:08 AM, Motoi Washida wrote: > > >> defaults read /Applications/TextEdit.app/Contents/Info >> >> will normally display the contents of >> /Applications/TextEdit.app/Contents/Info.plist > Heh. I didn't know that. Is this a hidden feature? I can't find any > documents about that. Hmm, I'm not sure where I got the idea of using defaults(1) to read xml files. I don't know if this is openly documented anywhere. > Here is a patch to complete plist files. It seems to work great on OS 10.3.7 with zsh 4.2.3. It doesn't work on the same machine with zsh 4.1.1 (which comes with OS 10.3), but that's probably ok since one wouldn't get the Darwin completions unless they installed zsh 4.2.3 anyway. How does one get this patch submitted? Through PWS? Thanks, Ryan > > -- > Motoi Washida > > Index: Completion/Darwin/Command/_defaults > =================================================================== > RCS file: /cvsroot/zsh/zsh/Completion/Darwin/Command/_defaults,v > retrieving revision 1.1 > diff -d -u -r1.1 _defaults > --- Completion/Darwin/Command/_defaults 23 Jul 2004 13:38:12 -0000 1.1 > +++ Completion/Darwin/Command/_defaults 16 Jan 2005 15:43:35 -0000 > @@ -1,12 +1,16 @@ > #compdef defaults > > _defaults_domains(){ > - local str="$(_call_program domains defaults domains 2>/dev/null)" > - local expl > - local -a list > - list=( ${(s/, /)str} -g -globalDomain ) > - _wanted domains expl 'defaults database domain' \ > - compadd -M 'r:|.=* r:|=*' -a list > + if [[ "`eval echo $PREFIX`" != [/~]* ]]; then > + local str="$(_call_program domains defaults domains 2>/dev/null)" > + local expl > + local -a list > + list=( ${(s/, /)str} -g -globalDomain ) > + _wanted domains expl 'defaults database domain' \ > + compadd -M 'r:|.=* r:|=*' -a list > + else > + _files -g '*.plist(e:"reply=\${REPLY%.plist}":)' > + fi > } > > _defaults_keys(){ >