From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 586 invoked by alias); 7 Dec 2014 20:54:24 -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: 33920 Received: (qmail 22228 invoked from network); 7 Dec 2014 20:54:22 -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 X-CMAE-Score: 0 X-CMAE-Analysis: v=2.1 cv=MJ3XQ3dg c=1 sm=1 tr=0 a=FT8er97JFeGWzr5TCOCO5w==:117 a=kj9zAlcOel0A:10 a=q2GGsy2AAAAA:8 a=oR5dmqMzAAAA:8 a=-9mUelKeXuEA:10 a=A92cGCtB03wA:10 a=dOUx3M7nWdZHBe-45FIA:9 a=CjuIK1q_8ugA:10 From: Bart Schaefer Message-id: <141207125423.ZM23655@torch.brasslantern.com> Date: Sun, 07 Dec 2014 12:54:23 -0800 In-reply-to: <20141207202002.29def040@pws-pc.ntlworld.com> Comments: In reply to Peter Stephenson "Re: Interrupting globs (Re: Something rotten in tar completion)" (Dec 7, 8:20pm) References: <141207103419.ZM22731@torch.brasslantern.com> <201412071859.sB7Ix5Xq005917@pws-pc.ntlworld.com> <20141207202002.29def040@pws-pc.ntlworld.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org (Zsh hackers list) Subject: Re: Interrupting globs (Re: Something rotten in tar completion) MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Dec 7, 8:20pm, Peter Stephenson wrote: } } +vinde(TRY_BLOCK_INTERRUPT) } +item(tt(TRY_BLOCK_INTERRUPT) )( } +This variable works in a similar way to tt(TRY_BLOCK_ERROR), but } +represents the status of an interrupt from the keyboard typically } +by the user typing tt(^C). If set to 0, any such interrupt will } +be reset; otherwise, the interrupt is propagated after the tt(always) } +block. I worry a little about describing it like this. It's an INT signal, but whether it came "from the keyboard" is not really known. If you move the word "typically" to before the word "from", the description becomes more accurate. It might also be worth mentioning that if an interrupt happens DURING the always-block, then the always block will stop and THAT interrupt is also propagated. This all could lead to code like this: { : Dammit, stop interrupting me } always { () { integer queued_signal=0 () { setopt localoptions localtraps TRAPINT() { (( ++queued_signal )) return 0 } while interrupts are impossible do something important done } if (( queued_signal )) then TRY_BLOCK_INTERRUPT=1 # Does this work? fi } }