From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20639 invoked by alias); 30 Aug 2014 19:38:59 -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: 33068 Received: (qmail 2515 invoked from network); 30 Aug 2014 19:38:57 -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 From: Bart Schaefer Message-id: <140830123853.ZM11804@torch.brasslantern.com> Date: Sat, 30 Aug 2014 12:38:53 -0700 In-reply-to: <20140826174029.6478ee3a@pwslap01u.europe.root.pri> Comments: In reply to Peter Stephenson "Function for examining structure of calls in debug output" (Aug 26, 5:40pm) References: <20140826174029.6478ee3a@pwslap01u.europe.root.pri> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: "Zsh Hackers' List" Subject: Re: Function for examining structure of calls in debug output MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Hi, back from a few days on the road ... On Aug 26, 5:40pm, Peter Stephenson wrote: } } You'll notice it's already confused because the return from _dispatch } goes to _complete instead of _normal, since there are no further } non-trivial commands in _normal, and searching back up the stack for the } return function would mean there was no hope of it grokking recursive } structures. I'm not sure how much effort I can be bothered to put into } this. A better solution might be for a prompt escape that tracks the } nesting level (which is trivial apart from picking a new letter). I see you already implemented the latter idea. An alternate / additional idea would be to have xtrace output a "return N" expression any time a function returns, whenever there is no explicit return statement in the source. The line number could be that of the closing curly brace, or perhaps some flag value such as -1.