From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15249 invoked from network); 3 Sep 2003 07:53:13 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 3 Sep 2003 07:53:13 -0000 Received: (qmail 9153 invoked by alias); 3 Sep 2003 07:53:08 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 19016 Received: (qmail 9124 invoked from network); 3 Sep 2003 07:53:08 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 3 Sep 2003 07:53:08 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [193.109.254.211] by sunsite.dk (MessageWall 1.0.8) with SMTP; 3 Sep 2003 7:53:7 -0000 X-VirusChecked: Checked X-Env-Sender: okiddle@yahoo.co.uk X-Msg-Ref: server-5.tower-36.messagelabs.com!1062575586!312613 X-StarScan-Version: 5.0.7; banners=-,-,- Received: (qmail 30595 invoked from network); 3 Sep 2003 07:53:06 -0000 Received: from iris.logica.co.uk (158.234.9.163) by server-5.tower-36.messagelabs.com with SMTP; 3 Sep 2003 07:53:06 -0000 Received: from gmcs3.local ([158.234.142.61]) by iris.logica.co.uk (8.12.3/8.12.3/Debian -4) with ESMTP id h837r6HM008051 for ; Wed, 3 Sep 2003 08:53:06 +0100 Received: from gmcs3.local (localhost [127.0.0.1]) by gmcs3.local (8.11.6/8.11.6/SuSE Linux 0.5) with ESMTP id h837t7k30489 for ; Wed, 3 Sep 2003 09:55:07 +0200 X-VirusChecked: Checked X-StarScan-Version: 5.0.7; banners=.,-,- In-reply-to: <20030902211128.69D218513@pwstephenson.fsnet.co.uk> From: Oliver Kiddle References: <20030902211128.69D218513@pwstephenson.fsnet.co.uk> To: zsh-workers@sunsite.dk (Zsh hackers list) Subject: Re: PATCH: suffix aliases Date: Wed, 03 Sep 2003 09:55:07 +0200 Message-ID: <30487.1062575707@gmcs3.local> Peter wrote: > This adds aliases for suffixes, so that after > > alias -s ps=gv > > attempting to run a command called foo.ps will call `gv foo.ps'. > > I could have used `alias .ps=gv' in the way 4DOS did, but as zsh aliases > can be more or less anything it seemed more natural to have a completely > separate table. That makes sense. Used to like that in 4DOS too myself. Was the only piece of shareware I ever registered. > I stuck with suffixes instead of patterns, which would have been less > efficient and more complicated for little extra gain. That's a pity. I have preexec testing for <-> and other combinations like (#b)(<->).(<->) so that I can type numbers to get at MH messages. I then need a few strategic alias 11='nocorrect 11' so that correction doesn't offer me X11 or whatever as a correction. With pattern aliases, back references could disable substituting the word as the last argument which might have other uses such as commands which don't want the file as the last argument (e.g. mozilla -remote). >>From the perspective of handling mime types and easier completion there might be an argument for having both pattern and suffix completion. Suffix completion could actually look for files, perhaps in it's own path array and could allow the suffix to be omitted. So for wine programs you wouldn't need to type the .exe and could put the program directories in a suffix path. > I dutifully added completion to _alias, but it seems that doesn't > understand the difference between aliases with different options, so I There isn't much point: completing existing aliases when defining new ones isn't that useful anyway. Oliver