From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19486 invoked from network); 23 Feb 2008 17:35:14 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.4 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 23 Feb 2008 17:35:14 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 60816 invoked from network); 23 Feb 2008 17:35:07 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 23 Feb 2008 17:35:07 -0000 Received: (qmail 28791 invoked by alias); 23 Feb 2008 17:35:00 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 24588 Received: (qmail 28771 invoked from network); 23 Feb 2008 17:34:59 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 23 Feb 2008 17:34:59 -0000 Received: from mtaout01-winn.ispmail.ntl.com (mtaout01-winn.ispmail.ntl.com [81.103.221.47]) by bifrost.dotsrc.org (Postfix) with ESMTP id 8FBE18026E1C for ; Sat, 23 Feb 2008 18:34:51 +0100 (CET) Received: from aamtaout03-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout01-winn.ispmail.ntl.com with ESMTP id <20080223173650.ZNIM16169.mtaout01-winn.ispmail.ntl.com@aamtaout03-winn.ispmail.ntl.com> for ; Sat, 23 Feb 2008 17:36:50 +0000 Received: from pws-pc.ntlworld.com ([81.107.42.63]) by aamtaout03-winn.ispmail.ntl.com with ESMTP id <20080223173912.IWJG26699.aamtaout03-winn.ispmail.ntl.com@pws-pc.ntlworld.com> for ; Sat, 23 Feb 2008 17:39:12 +0000 Received: from pws-pc (pws-pc [127.0.0.1]) by pws-pc.ntlworld.com (8.14.2/8.14.2) with ESMTP id m1NHXAXS003449 for ; Sat, 23 Feb 2008 17:33:10 GMT Message-Id: <200802231733.m1NHXAXS003449@pws-pc.ntlworld.com> From: Peter Stephenson To: zsh-workers@sunsite.dk (Zsh hackers list) Subject: Re: PATCH: completion of glob qualifiers In-Reply-To: Message from Bart Schaefer of "Fri, 22 Feb 2008 22:06:55 PST." <080222220655.ZM31839@torch.brasslantern.com> Date: Sat, 23 Feb 2008 17:33:10 +0000 X-Cloudmark-Analysis: v=1.0 c=1 a=Rw7lO6RaNG4A:15 a=3FTp5y5X6ml6ZCsPBftHHg==:17 a=NLZqzBF-AAAA:8 a=ztdVvhE_TAmAvxJKIwIA:9 a=TEj_HTsRny-fs2gdGXKupUQhm4kA:4 a=_dQi-Dcv4p4A:10 a=fUzIcyR-ki4A:10 X-Virus-Scanned: ClamAV 0.91.2/5947/Sat Feb 23 16:40:48 2008 on bifrost X-Virus-Status: Clean Bart Schaefer wrote: > On Feb 23, 12:04am, Peter Stephenson wrote: > } > } It works OK so far but it does raise various issues about related things > } that might be got to work better. You might run across those. > > Yes, this is pretty cool. I suppose the things that might work better > are e.g. completion of modifiers after !!: and $var: ? Those need adding, but there is actually all sorts of syntax nastiness if you try anything with metacharacters, even in places where they are parsed properly in normal operation. Try "${(", for example. > It'd also be nice if, for example, it would notice that the qualifier > needs to be followed by a numeric value and wouldn't complete another > qualifier the number was present, but that's a nit. It's supposed to do that, and I'm not sure which one wasn't working, although looking again I can see a few places I haven't handled consistently. Index: Completion/Zsh/Type/_globquals =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Zsh/Type/_globquals,v retrieving revision 1.1 diff -u -r1.1 _globquals --- Completion/Zsh/Type/_globquals 23 Feb 2008 00:10:25 -0000 1.1 +++ Completion/Zsh/Type/_globquals 23 Feb 2008 17:33:47 -0000 @@ -56,24 +56,18 @@ (d) # complete/skip device - if [[ -z $PREFIX ]]; then - _message device ID + if ! compset -p '[[:digit:]]##'; then + _message "device ID" return fi - # It's pointless trying to complete the device. - # Simply assume it's done. - compset -p '[[:digit:]]##' ;; (l) # complete/skip link count - if [[ PREFIX = ([-+]|) ]]; then - _message link count + if ! compset -P '([-+]|)[[:digit:]]##'; then + _message "link count" return fi - # It's pointless trying to complete the link count. - # Simply assume it's done. - compset -P '([-+]|)[[:digit:]]##' ;; (u) @@ -162,9 +156,9 @@ # complete/skip range: check for closing bracket if ! compset -P "(-|)[[:digit:]]##(,(-|)[[:digit:]]##|)]"; then if compset -P "(-|)[[:digit:]]##,"; then - _message end of range + _message "end of range" else - _message start of range + _message "start of range" fi return fi @@ -172,7 +166,7 @@ (:) # complete modifiers and don't stop completing them - _history_modifiers + _history_modifiers q return ;; esac Index: Completion/Zsh/Type/_history_modifiers =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Zsh/Type/_history_modifiers,v retrieving revision 1.1 diff -u -r1.1 _history_modifiers --- Completion/Zsh/Type/_history_modifiers 23 Feb 2008 00:10:25 -0000 1.1 +++ Completion/Zsh/Type/_history_modifiers 23 Feb 2008 17:33:47 -0000 @@ -53,9 +53,10 @@ [[ -n $PREFIX ]] && return 1 list=("\::modifier") - [[ $type = g ]] && list+=("):end of qualifiers") + [[ $type = q ]] && list+=("):end of qualifiers") # strictly we want a normal suffix if end of qualifiers _describe -t delimiters "delimiter" list -Q -S '' + return else list=( "s:substitute string" -- Peter Stephenson Web page now at http://homepage.ntlworld.com/p.w.stephenson/