zsh-workers
 help / color / mirror / code / Atom feed
From: Stephane Chazelas <Stephane_Chazelas@yahoo.fr>
To: Peter Stephenson <pws@csr.com>
Cc: Zsh hackers list <zsh-workers@sunsite.dk>
Subject: Re: PATCH: skip command from debug trap
Date: Tue, 5 Aug 2008 16:50:29 +0100	[thread overview]
Message-ID: <20080805155029.GA5170@sc.homeunix.net> (raw)
In-Reply-To: <27237.1217946438@csr.com>

On Tue, Aug 05, 2008 at 03:27:18PM +0100, Peter Stephenson wrote:
> I believe this is the fairly simple code needed to skip a command from a
> debug trap.
> 
> The only difficult bit is the way of triggering it, since it's long
> established that any non-zero number returned from a trap causes the
> enclosing function to return.  I was inclined to pick a negative number,
> but Rocky wants that for something else.  So how about 255, which is
> fairly special?
[...]

How about a special variable containing the code to be run
available from the trap and that can be set to something else
within the trap.

Or how about using some form of exception raising?

Also, I don't know if it's been mentionned before, put to have a
DEBUG trap before every command, it seems that we should be able
to use PS4 with set -x, though there may not be any easy way
_not_ to start a subshell:

PS4='$(debug_function)'

-- 
Stéphane


  reply	other threads:[~2008-08-05 15:51 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-05 14:27 Peter Stephenson
2008-08-05 15:50 ` Stephane Chazelas [this message]
2008-08-05 23:47 ` Rocky Bernstein
2008-08-06  9:47   ` Peter Stephenson
2008-08-06 14:22     ` Bart Schaefer
2008-08-06 14:30       ` Rocky Bernstein
2008-08-06 14:59       ` Stephane Chazelas
2008-08-06 15:34         ` Peter Stephenson
2008-08-06 17:00     ` Rocky Bernstein
2008-08-06 17:54       ` Peter Stephenson
2008-08-06 19:09         ` Rocky Bernstein
2008-08-06 19:49           ` Peter Stephenson
2008-08-07  1:00             ` Bart Schaefer
2008-08-07 10:11               ` Peter Stephenson
2008-08-07 14:52                 ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080805155029.GA5170@sc.homeunix.net \
    --to=stephane_chazelas@yahoo.fr \
    --cc=pws@csr.com \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).