From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21216 invoked from network); 18 Feb 2005 06:56:39 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 18 Feb 2005 06:56:39 -0000 Received: (qmail 25243 invoked from network); 18 Feb 2005 06:56:34 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 18 Feb 2005 06:56:34 -0000 Received: (qmail 2806 invoked by alias); 18 Feb 2005 06:56:16 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 8522 Received: (qmail 2791 invoked from network); 18 Feb 2005 06:56:15 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 18 Feb 2005 06:56:15 -0000 Received: (qmail 24023 invoked from network); 18 Feb 2005 06:56:15 -0000 Received: from mail3.ecc.u-tokyo.ac.jp (133.11.171.218) by a.mx.sunsite.dk with SMTP; 18 Feb 2005 06:56:10 -0000 Received: from spam001.ecc.u-tokyo.ac.jp (spam001.ecc.u-tokyo.ac.jp [133.11.50.194]) by mail3.ecc.u-tokyo.ac.jp (Postfix) with ESMTP id 63FDE7021F for ; Fri, 18 Feb 2005 15:55:58 +0900 (JST) Received: from [192.168.1.12] ( [222.13.222.114]) by spam001.ecc.u-tokyo.ac.jp (SpamBlock.pst 3.4.25) with ESMTP id <625fad5460dfb26c51c4ddd080945bf5@h8.dion.ne.jp> for ; Fri, 18 Feb 2005 15:55:54 +0900 In-Reply-To: References: Mime-Version: 1.0 (Apple Message framework v619.2) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <625fad5460dfb26c51c4ddd080945bf5@h8.dion.ne.jp> Content-Transfer-Encoding: 7bit Cc: zsh-users@sunsite.dk From: Motoi Washida Subject: Re: Darwin _defaults completion bug Date: Fri, 18 Feb 2005 15:55:53 +0900 To: lists X-Mailer: Apple Mail (2.619.2) X-IP: 222.13.222.114 X-FROM-DOMAIN: h8.dion.ne.jp X-FROM-EMAIL: a66@h8.dion.ne.jp X-Spam-Checker-Version: SpamAssassin 3.0.2 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, score=-2.6 required=6.0 tests=BAYES_00 autolearn=ham version=3.0.2 X-Spam-Hits: -2.6 Hi Ryan, > I think I've found a small bug with your _defaults completion (which > I use all the time). If I type 'defaults read -g' then hit the Tab > key, I see a list of possible completions which are quoted *and* > escaped with a backslash. (...snip...) > ...et cetera, et cetera. The command doesn't work in the escaped + > quoted form. If just the quotes are used, the command works. I've > looked at _defaults but haven't been able to figure out where the > escapes are being inserted. If you get a chance, could you take a > look? Thanks! This occurred because the completion did not handle quoted key name "defaults read" prints. Here is a patch to remove quotes. -- Motoi Washida Index: Completion/Darwin/Command/_defaults =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Darwin/Command/_defaults,v retrieving revision 1.2 diff -d -u -r1.2 _defaults --- Completion/Darwin/Command/_defaults 17 Jan 2005 09:39:21 -0000 1.2 +++ Completion/Darwin/Command/_defaults 18 Feb 2005 06:24:58 -0000 @@ -14,9 +14,10 @@ } _defaults_keys(){ - local ks="$(_call_program keys defaults read "$words[2]" 2>/dev/null | sed '/^ [[:alpha:]"]/ { s/^ //; s/ = .*$//; p;}; d')" + local ks + ks=(${${${${(M)${(f)"$(defaults read "$words[2]" 2>/dev/null)"}:# [^ ]*=*}# }%% = *}:Q}) local expl - _wanted keys expl 'key' compadd ${(f)ks} + _wanted keys expl 'key' compadd "$ks[@]" } _defaults(){