From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23157 invoked from network); 3 Sep 2004 15:10:27 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 3 Sep 2004 15:10:27 -0000 Received: (qmail 30487 invoked from network); 3 Sep 2004 15:10:22 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 3 Sep 2004 15:10:22 -0000 Received: (qmail 22874 invoked by alias); 3 Sep 2004 15:09:40 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7966 Received: (qmail 22859 invoked from network); 3 Sep 2004 15:09:39 -0000 Received: from unknown (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 3 Sep 2004 15:09:39 -0000 Received: (qmail 29146 invoked from network); 3 Sep 2004 15:08:40 -0000 Received: from mail36.messagelabs.com (193.109.254.211) by a.mx.sunsite.dk with SMTP; 3 Sep 2004 15:08:26 -0000 X-VirusChecked: Checked X-Env-Sender: okiddle@yahoo.co.uk X-Msg-Ref: server-4.tower-36.messagelabs.com!1094224103!9009487 X-StarScan-Version: 5.2.10; banners=-,-,- X-Originating-IP: [158.234.9.163] Received: (qmail 2050 invoked from network); 3 Sep 2004 15:08:23 -0000 Received: from iris.logica.co.uk (158.234.9.163) by server-4.tower-36.messagelabs.com with SMTP; 3 Sep 2004 15:08:23 -0000 Received: from trentino.logica.co.uk ([158.234.142.61]) by iris.logica.co.uk (8.12.3/8.12.3/Debian -4) with ESMTP id i83F8Nf6013015 for ; Fri, 3 Sep 2004 16:08:23 +0100 Received: from trentino.logica.co.uk (localhost [127.0.0.1]) by trentino.logica.co.uk (Postfix) with ESMTP id EF9C1791B004 for ; Fri, 3 Sep 2004 17:08:02 +0200 (CEST) To: zsh-users@sunsite.dk X-VirusChecked: Checked X-StarScan-Version: 5.0.7; banners=.,-,- In-reply-to: From: Oliver Kiddle References: Subject: Re: completion for printf-style format strings Date: Fri, 03 Sep 2004 17:08:02 +0200 Message-ID: <3826.1094224082@trentino.logica.co.uk> X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, hits=0.0 required=6.0 tests=none autolearn=no version=2.63 X-Spam-Hits: 0.0 Felix Rosencrantz wrote: > Does anyone have code to perform completion of printf-style format strings? > > I think it was suggested that it might be possible to do with > _regex_arguments. but not sure if there is an example somewhere or a > utility function. It wouldn't be possible with _regex_arguments. _regex_arguments is only useful when completing a single command-line argument in full. It never uses compset -P/-S to cut the current word down into chunks. You would probably want to use patterns a lot though. Basically you need to remove any literal characters and complete format specifications from the front of the word. Then you can deal with any partially complete format specifications. What might be good is to make it sufficiently general so as to be usable for things like strftime too. Oliver