zsh-users
 help / color / mirror / code / Atom feed
From: Ray Andrews <rayandrews@eastlink.ca>
To: zsh-users@zsh.org
Subject: Re: trap question
Date: Fri, 25 Nov 2022 20:27:21 -0800	[thread overview]
Message-ID: <e51e8991-9fe1-d8f7-9665-750be835de19@eastlink.ca> (raw)
In-Reply-To: <CAH+w=7YQn7Qu6keQgzgT2K5S7QYb_K9wcrctWqYYCkaQv1ym0w@mail.gmail.com>


On 2022-11-25 17:57, Bart Schaefer wrote:
> remain un-expandable within single quotes. Is this an exception or
>> somehow to be viewed as routine?
> You can think of "trap" as a delayed "eval".
Ok, so I can continue to expect that there's no expansions within single 
quotes.  It's sorta intuitive that a trap is a special case.
>
>> BTW, will this trap catch exiting
>> errors or just proper returns?
> Depends on the error.  If you have "setopt err_exit" (or err_return)
> then the trap will be tripped when something returns false,

I have that off by default, sounds like it should be on.  Thing is that 
this is for a function that uses zcurses and if it quits before cleaning 
up after itself ...  it's quite remarkable how many different things 
might go wrong when zcurses still wants to be in charge.  So I'm hoping 
the trap -- which does all the cleanup -- will be sprung after any 
internal error as well as controlled exits.  Mind that's luxurious if it 
can do it, I know how to mop up elsewise.

BTW, speaking of zcurses, I see nothing in the doc, but is there a way 
to list open windows?




  parent reply	other threads:[~2022-11-26  4:28 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-25 18:35 Ray Andrews
2022-11-25 18:57 ` Roman Perepelitsa
2022-11-25 23:25   ` Ray Andrews
2022-11-26  1:57     ` Bart Schaefer
2022-11-26  4:25       ` Philippe Altherr
2022-11-26  4:27       ` Ray Andrews [this message]
2022-11-26  4:49         ` Lawrence Velázquez
2022-11-26  4:50         ` Bart Schaefer
2022-11-26 15:03           ` Ray Andrews
2022-11-26 15:25             ` Roman Perepelitsa
2022-11-27  1:49               ` Ray Andrews

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=e51e8991-9fe1-d8f7-9665-750be835de19@eastlink.ca \
    --to=rayandrews@eastlink.ca \
    --cc=zsh-users@zsh.org \
    /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).