From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29558 invoked by alias); 23 Feb 2012 16:45:55 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 30264 Received: (qmail 25439 invoked from network); 23 Feb 2012 16:45:54 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <120223084529.ZM11820@torch.brasslantern.com> Date: Thu, 23 Feb 2012 08:45:29 -0800 In-reply-to: <20120223110123.18448510@pwslap01u.europe.root.pri> Comments: In reply to Peter Stephenson "emulate & xtrace" (Feb 23, 11:01am) References: <20120223110123.18448510@pwslap01u.europe.root.pri> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: "Zsh Hackers' List" Subject: Re: emulate & xtrace MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Feb 23, 11:01am, Peter Stephenson wrote: } } I'm thinking (post 4.3.17) of trying to make the "emulate" command leave } on the "xtrace" option if running inside a function and the nearest } enclosing function has "functions -t" set. Before I look at this, can } anybody see if this is a bad idea? (Obviously "unsetopt xtrace" still } does what you expect). I'd almost be inclined to leave xtrace alone regardess of functions -t but I don't see any harm in doing it the way you've described. Note that emulate already leaves xtrace unchanged without the -R option: torch% setopt xtrace; emulate zsh -c 'print $options[xtrace]' +Src/zsh:9> emulate zsh -c 'print $options[xtrace]' +(eval):1> print on on torch% setopt xtrace; emulate -R zsh -c 'print $options[xtrace]' +Src/zsh:8> emulate -R zsh -c 'print $options[xtrace]' off There may be a few of other options that might get similar treatment, e.g., DEBUG_BEFORE_CMD and EVAL_LINENO (which is out of alpha order in zsh.h, by the way), HUP and RCS, possibly ERR_EXIT and ERR_RETURN. Are there good reasons to reset those even with "emulate -R"? (It's a bit tougher with those last two.)