From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4143 invoked from network); 7 Aug 2008 10:15:23 -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.6 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; 7 Aug 2008 10:15:23 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 9115 invoked from network); 7 Aug 2008 10:15:15 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 7 Aug 2008 10:15:15 -0000 Received: (qmail 18350 invoked by alias); 7 Aug 2008 10:15:11 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 25416 Received: (qmail 18340 invoked from network); 7 Aug 2008 10:15:10 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 7 Aug 2008 10:15:10 -0000 Received: from cluster-d.mailcontrol.com (cluster-d.mailcontrol.com [217.69.20.190]) by bifrost.dotsrc.org (Postfix) with ESMTPS id 14D358056E06 for ; Thu, 7 Aug 2008 12:15:07 +0200 (CEST) Received: from cameurexb01.EUROPE.ROOT.PRI ([193.128.72.68]) by rly43d.srv.mailcontrol.com (MailControl) with ESMTP id m77AEbim013463 for ; Thu, 7 Aug 2008 11:15:05 +0100 Received: from news01 ([10.103.143.38]) by cameurexb01.EUROPE.ROOT.PRI with Microsoft SMTPSVC(6.0.3790.3959); Thu, 7 Aug 2008 11:14:38 +0100 Date: Thu, 7 Aug 2008 11:14:38 +0100 From: Peter Stephenson To: Zsh hackers list Subject: Re: DEBUG_CMD_LINE (Was Re: PATCH: skip command from debug trap) Message-ID: <20080807111438.59126ef3@news01> In-Reply-To: <20080807093139.GA6839@sc.homeunix.net> References: <6cd6de210808061419q2a81856cv62969490069e8f3e@mail.gmail.com> <20080807095441.3058605d@news01> <20080807093139.GA6839@sc.homeunix.net> Organization: CSR X-Mailer: Claws Mail 3.5.0 (GTK+ 2.12.8; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 07 Aug 2008 10:14:38.0666 (UTC) FILETIME=[6653DAA0:01C8F876] X-Scanned-By: MailControl A-08-50-03 (www.mailcontrol.com) on 10.68.0.153 X-Virus-Scanned: ClamAV 0.92.1/7969/Thu Aug 7 11:12:24 2008 on bifrost X-Virus-Status: Clean On Thu, 7 Aug 2008 10:31:40 +0100 Stephane Chazelas wrote: > On Thu, Aug 07, 2008 at 09:54:41AM +0100, Peter Stephenson wrote: > [...] > > It would be possible with a bit of fiddling to get the DEBUG trap to happen > > at the level of elements of a sublist, i.e. commands separated by && and > > ||, but I'm not sure if that's worth it. Beyond that you run into the > > hideous complexity of pipelines and I don't think it can be pushed that far > > down. > [...] > > But see how PS4 is expanded for every command: > $ zsh -o PROMPT_SUBST -c 'PS4="\$(od -vAn -N2 -x /dev/urandom) " > set -x; : a | : b; : c && : d' > 4542 : a > e866 : b > a7ad : c > 6051 : d Yes, there are printprompt4()'s scattered all over the code. However, PS4 doesn't interact with code execution as debug traps do. > BTW, shouldn't PROMPT_SUBST be enabled by default in sh and ksh > emulation? If they do that, then presumably yes. > Is there a way to run shell code (other than assignments and > arithmetic expansion) upon the expansion of PS4? I thought of > /(e:code:), but in scalar context I couldn't find a way for > globbing to be performed. I don't see how this differs from the stuff in $(...), which is treated as a complete command line. Do you mean you need code to run within the current shell? -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070