From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28209 invoked from network); 29 Aug 2001 17:31:53 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 29 Aug 2001 17:31:53 -0000 Received: (qmail 15591 invoked by alias); 29 Aug 2001 17:31:33 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 15723 Received: (qmail 15579 invoked from network); 29 Aug 2001 17:31:31 -0000 X-VirusChecked: Checked Sender: kiddleo@pag.logica.co.uk Message-ID: <3B8D26D8.A1598021@yahoo.co.uk> Date: Wed, 29 Aug 2001 18:31:04 +0100 From: Oliver Kiddle X-Mailer: Mozilla 4.76 [en] (X11; U; SunOS 5.7 sun4u) X-Accept-Language: en MIME-Version: 1.0 To: zsh-workers@sunsite.dk Subject: Re: How to complete backquote, etc. using compsys? References: <20010821204255.64C6417403@puel.sfc.wide.ad.jp> <3B84D18C.19BA712@yahoo.co.uk> <1010823180146.ZM25810@candle.brasslantern.com> <3B8B6600.54A33D8E@yahoo.co.uk> <1010828155058.ZM2724@candle.brasslantern.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Bart Schaefer wrote: > > } how can it tell it's in $(...)? > > Hmm, at the moment perhaps it doesn't, but it could look at $LBUFFER to > find out. Parsing $LBUFFER correctly to avoid any quoted $( and matching the closing brackets wouldn't be easy. No doubt, the C code already has this information. As you tried, it won't give it to us with %_ but it'd be better in somewhere like compstate anyway. > The problem is that you end up with too many layers of autoremovable > suffixes. When completing a path name within backticks, you can't > get both the trailing / on a directory name and the trailing backtick. Multiple layers of autoremovable suffixes is clearly one of the things that needs some thought. Possibly all should be added but they would each have separate lists of characters which would result in their removal. Then if a suffix is auto-removed, subsequent suffixes also need removing. When adding matches for completion, it is common (such as with directories in _files or `http://' in _urls that the match only makes up a part of what the function completes (such as `http://' which is clearly only a partical url). So _urls does not add any suffixes it was passed with -S and anything like backquotes should also not be added. The opposite is also simple where a function completes something which can only be the final portion and so any suffixes are added. Auto-removable suffixes are a nice way of handling things which can be final or partial and it can vary as to which is the best assumption hence the need for a better system for defining what it'll do. > } Also, without multios the closing > } bracket of $(<...) should always be completed. > > It would have to be an autoremovable suffix, too; `echo $( a silly example of why. I never knew you could do that. Still, ')' as an autoremovable suffix would be better behaviour than the current situation. Oliver _____________________________________________________________________ This message has been checked for all known viruses by the MessageLabs Virus Scanning Service. For further information visit http://www.messagelabs.com/stats.asp