From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27862 invoked from network); 19 Mar 2004 16:39:59 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 19 Mar 2004 16:39:59 -0000 Received: (qmail 19349 invoked by alias); 19 Mar 2004 16:39:42 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7200 Received: (qmail 19296 invoked from network); 19 Mar 2004 16:39:42 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 19 Mar 2004 16:39:42 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [62.189.58.19] by sunsite.dk (MessageWall 1.0.8) with SMTP; 19 Mar 2004 16:39:42 -0000 Received: from MAILSWEEPER01.csr.com (mailhost1.csr.com [62.189.183.235]) by lhuumrelay3.lnd.ops.eu.uu.net (8.11.0/8.11.0) with ESMTP id i2JGdgv06113 for ; Fri, 19 Mar 2004 16:39:42 GMT Received: from EXCHANGE02.csr.com (unverified [192.168.137.45]) by MAILSWEEPER01.csr.com (Content Technologies SMTPRS 4.3.12) with ESMTP id for ; Fri, 19 Mar 2004 16:39:19 +0000 Received: from news01.csr.com ([192.168.143.38]) by EXCHANGE02.csr.com with Microsoft SMTPSVC(5.0.2195.6713); Fri, 19 Mar 2004 16:42:02 +0000 Received: from news01.csr.com (localhost.localdomain [127.0.0.1]) by news01.csr.com (Postfix) with ESMTP id 143616E0202 for ; Fri, 19 Mar 2004 16:39:40 +0000 (GMT) Received: from csr.com (pws@localhost) by news01.csr.com (8.12.10/8.12.10/Submit) with ESMTP id i2JGdZjw025436 for ; Fri, 19 Mar 2004 16:39:39 GMT Message-Id: <200403191639.i2JGdZjw025436@news01.csr.com> X-Authentication-Warning: news01.csr.com: pws owned process doing -bs To: zsh-users@sunsite.dk (Zsh users list) Subject: Re: 4.2.0 released In-reply-to: "Bart Schaefer"'s message of "Fri, 19 Mar 2004 15:41:11 GMT." <1040319154111.ZM11525@candle.brasslantern.com> Date: Fri, 19 Mar 2004 16:39:35 +0000 From: Peter Stephenson X-OriginalArrivalTime: 19 Mar 2004 16:42:02.0176 (UTC) FILETIME=[1AC68400:01C40DD1] Bart Schaefer wrote: > Assorted thoughts ... > > On Mar 19, 11:36am, Peter Stephenson wrote: > } > } - Suffix aliases allow the shell to run a command on a file by suffix, > } e.g `alias -s ps=gv' makes `foo.ps' execute `gv foo.ps'. Supplied > } function zsh-mime-setup uses existing mailcap and mime.types files > } to set up suitable aliases. > > Reading that, I wonder ... why did we do this with suffixes? Easy to implement, simple to use, does the basics of what you actually need, quick at run time (no pattern matching), nobody offered to write anything else ... It's still possible to add a generic pattern matcher, if anybody wants to. Since I can't actually imagine using it myself (unlike suffix aliases), I selfishly don't feel like doing it. > Why not be > Unix-like rather than DOS-like: check /etc/magic on any file that the OS > fails to execute, and choose the command based on that? Well, that's even more difficult, but yes, it's perfectly reasonable to add a hook on failure to execute. It could do other things, like check #! lines and see if the path to the executable is wrong and the executable can be found in the path. Warning to anybody doing this: error numbers on failed execution can be a bit tricky. You need to handle ENOENT as well as ENOEXEC (and possibly others). I'm not actually sure what state the shell is in execute(), i.e. whether it could run such a handler as a function or would need to exec it externally. The latter, at least, is pretty simple to add. > } Line editor: > } - recursive editing > > Which is not quite the same as recursively invoking zle, e.g., I think you > still get some sort of warning if you try to run "vared" from inside a > widget function. Yes, it's recursive within the widget system, not at the level of the main execution loop. You have to use a special widget; the editor itself is not reentrant. -- Peter Stephenson Software Engineer CSR Ltd., Science Park, Milton Road, Cambridge, CB4 0WH, UK Tel: +44 (0)1223 692070 ********************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com **********************************************************************