From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8990 invoked from network); 18 Feb 2009 17:10:38 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 18 Feb 2009 17:10:38 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 48326 invoked from network); 18 Feb 2009 17:10:32 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 18 Feb 2009 17:10:32 -0000 Received: (qmail 29126 invoked by alias); 18 Feb 2009 17:10:28 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 26579 Received: (qmail 29117 invoked from network); 18 Feb 2009 17:10:28 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 18 Feb 2009 17:10:28 -0000 Received: from cluster-d.mailcontrol.com (cluster-d.mailcontrol.com [85.115.60.190]) by bifrost.dotsrc.org (Postfix) with ESMTPS id 33792802720F for ; Wed, 18 Feb 2009 18:10:24 +0100 (CET) Received: from cameurexb01.EUROPE.ROOT.PRI ([193.128.72.68]) by rly10d.srv.mailcontrol.com (MailControl) with ESMTP id n1IH97eN014086 for ; Wed, 18 Feb 2009 17:10:08 GMT Received: from news01.csr.com ([10.103.143.38]) by cameurexb01.EUROPE.ROOT.PRI with Microsoft SMTPSVC(6.0.3790.3959); Wed, 18 Feb 2009 17:09:13 +0000 Received: from news01.csr.com (localhost.localdomain [127.0.0.1]) by news01.csr.com (8.14.2/8.13.4) with ESMTP id n1IH9D0J019478 for ; Wed, 18 Feb 2009 17:09:13 GMT Received: from csr.com (pws@localhost) by news01.csr.com (8.14.2/8.14.2/Submit) with ESMTP id n1IH9DsQ019474 for ; Wed, 18 Feb 2009 17:09:13 GMT Message-Id: <200902181709.n1IH9DsQ019474@news01.csr.com> X-Authentication-Warning: news01.csr.com: pws owned process doing -bs To: zsh-workers@sunsite.dk Subject: Re: Clarify zshaddhistory doc? In-reply-to: <090218085720.ZM17261@torch.brasslantern.com> References: <090218085720.ZM17261@torch.brasslantern.com> Comments: In-reply-to Bart Schaefer message dated "Wed, 18 Feb 2009 08:57:20 -0800." Date: Wed, 18 Feb 2009 17:09:13 +0000 From: Peter Stephenson X-OriginalArrivalTime: 18 Feb 2009 17:09:13.0584 (UTC) FILETIME=[9F7C5F00:01C991EB] X-Scanned-By: MailControl A_08_51_00 (www.mailcontrol.com) on 10.68.0.120 X-Virus-Scanned: ClamAV 0.92.1/9002/Wed Feb 18 12:16:50 2009 on bifrost X-Virus-Status: Clean Bart Schaefer wrote: > Under the entry for zshaddhistory: > > If any of the hook functions return a non-zero value the history > line will not be saved, although it lingers in the history until > the next line is executed allow you to reuse or edit it > immediately. > > What exactly does this mean? There's no $zshaddhistory_functions array > so "any of the hook functions" is either a typo, or must refer to the > $preexec_functions hooks, which ought to be clearer. There isn't a zshaddhistory_functions array until you add one, then there is. Index: Doc/Zsh/func.yo =================================================================== RCS file: /cvsroot/zsh/zsh/Doc/Zsh/func.yo,v retrieving revision 1.23 diff -u -r1.23 func.yo --- Doc/Zsh/func.yo 5 Sep 2008 09:05:23 -0000 1.23 +++ Doc/Zsh/func.yo 18 Feb 2009 17:07:35 -0000 @@ -189,19 +189,23 @@ sect(Special Functions) Certain functions, if defined, have special meaning to the shell. -In the case of tt(chpwd), tt(periodic), tt(precmd) and tt(preexec) it is -possible to define an array that has the same name with `tt(_functions)' -appended. Any element in such an array is taken as the name of a function -to execute; it is executed in the same context and with the same arguments -as the basic function. For example, if tt($chpwd_functions) is an array -containing the values `tt(mychpwd)', `tt(chpwd_save_dirstack)', then the -shell attempts to execute the functions `tt(chpwd)', `tt(mychpwd)' and +subsect(Hook Functions) +findex(functions, hook) +findex(hook functions) + +For the functions below, it is possible to define an array that has the +same name as the function with `tt(_functions)' appended. Any element in +such an array is taken as the name of a function to execute; it is executed +in the same context and with the same arguments as the basic function. For +example, if tt($chpwd_functions) is an array containing the values +`tt(mychpwd)', `tt(chpwd_save_dirstack)', then the shell attempts to +execute the functions `tt(chpwd)', `tt(mychpwd)' and `tt(chpwd_save_dirstack)', in that order. Any function that does not exist is silently ignored. A function found by this mechanism is referred to -elsewhere as a `hook function'. An error in any function causes -subsequent functions not to be run. Note further that an error -in a tt(precmd) hook causes an immediately following tt(periodic) -function not to run (thought it may run at the next opportunity). +elsewhere as a `hook function'. An error in any function causes subsequent +functions not to be run. Note further that an error in a tt(precmd) hook +causes an immediately following tt(periodic) function not to run (thought +it may run at the next opportunity). startitem() findex(chpwd) @@ -277,6 +281,14 @@ precommand modifier is used before an external command. Also, unlike tt(TRAPEXIT), it is not called when functions exit. ) +enditem() + +subsect(Trap Functions) + +The functions below are treated specially but do not have corresponding +hook arrays. + +startitem() item(tt(TRAP)var(NAL))( cindex(signals, trapping) cindex(trapping signals) -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070