From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16004 invoked by alias); 28 Sep 2016 18:49:06 -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: 39483 Received: (qmail 17501 invoked from network); 28 Sep 2016 18:49:06 -0000 X-Qmail-Scanner-Diagnostics: from mail-pf0-f175.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.192.175):SA:0(0.0/5.0):. Processed in 0.744506 secs); 28 Sep 2016 18:49:06 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: schaefer@brasslantern.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at brasslantern.com does not designate permitted sender hosts) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=DqSgT6eWBUDl5f8kEY6Zcnb9pk6ezCujJFqsvkTBsHs=; b=HoCn/w1ZAlizuIf8ufJtgYzaRasA2ku3DRRQ2knXR+xQ1OpxJIO3+ju5oVSbDSdgIM ZZhHYEjlEDNGZ5o5Vmo4Gdp/b/hS1artXlVruc0CNEN7o7ZCtXa0Je92DpaQa2eqfDsE uQm9uhy8SEC+gZGisr5nTDXwrerpU9MJ2ERpTSLB5r/+f+DMMa+vCJY/1LhODE4nVlDY hdlkreW3BWKBtKX7vb2jN8uy0JoBMYcAdKobZ/LZ79Rhg5z3Ym2zwMvFbLr6B+Uii7Mk qLcUCs5fyBwdKMO/jtpRpOYpSFBGwetHBy/HSfMw9Os7kPIo6GYYQ6+7lb7sNtKfSHxF 0HfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version; bh=DqSgT6eWBUDl5f8kEY6Zcnb9pk6ezCujJFqsvkTBsHs=; b=lyGmLOeXsxuQKy0BgNSgxg+Nh7ABzRT+MJBEG+mnMD54JSe0y5qX7RCiPgx7SeiJ5q jJQMl+VUFlpf8cW9Pv1gHTqEYO2EW+wJYLCO7Vle0uTVPID+PrbnOE/QX0xPJhAY2ro1 gHuHm/izZsTVYFBchWBxMKHb8Mftuc9W2q8z8i1slxQdkgIWOGYrzTXKtLDez6UP2gxL Db1ukGp4DYEaukieB0MpBD7ZkpptXeYA4xhVOdufwmZmQB5LLye+mq1HM52y+1rtUhrg B4Ons0a4N9r9b8gZbrkQUY5XOvw6UX/n/WUufyOzawq+vSuhX4n9+Csp17AdEzVR69Wc fLSg== X-Gm-Message-State: AE9vXwMb2+g8tNV1vlOaNGbQ162qIj2zPTnwraZaf++ZmGTsk8iIBz3OdGNOCfo3ra+2gg== X-Received: by 10.98.131.193 with SMTP id h184mr58916659pfe.92.1475088541430; Wed, 28 Sep 2016 11:49:01 -0700 (PDT) From: Bart Schaefer Message-Id: <160928114917.ZM32186@torch.brasslantern.com> Date: Wed, 28 Sep 2016 11:49:17 -0700 In-Reply-To: <20160928102417.GA2729@fujitsu.shahaf.local2> Comments: In reply to Daniel Shahaf "Re: PATCH: [for consideration] TMPSUFFIX" (Sep 28, 10:24am) References: <160925155112.ZM23899@torch.brasslantern.com> <20160926072546.GA28316@fujitsu.shahaf.local2> <160926091922.ZM26758@torch.brasslantern.com> <20160927070039.GA20798@fujitsu.shahaf.local2> <160927122050.ZM13394@torch.brasslantern.com> <20160928102417.GA2729@fujitsu.shahaf.local2> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: _dispatch (was Re: PATCH: [for consideration] TMPSUFFIX) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Sep 28, 10:24am, Daniel Shahaf wrote: } Subject: Re: PATCH: [for consideration] TMPSUFFIX } } Bart Schaefer wrote on Tue, Sep 27, 2016 at 12:20:50 -0700: } > there was not that too much code was aborted, rather that because of a } > surrounding use of "eval" not *enough* code was aborted; a scripting } > error. } } What can we do to cause enough code to be aborted in that case? Perhaps } something like the following: } } + { } + eval "$comp" && ret=0 } + } always { } + if (( TRY_BLOCK_ERROR )); then } + ... throw the exception ... } + fi } + } Sadly, that won't do it either -- TRY_BLOCK_ERROR is not set: [[[ torch% comp=': ${:}' torch% { eval "$comp" && print OK } always { print $TRY_BLOCK_ERROR } zsh: unrecognized modifier 0 torch% print $? 1 torch% comp=': *(#q)(#q)' torch% { eval "$comp" && echo OK } always { print $TRY_BLOCK_ERROR } zsh: unknown file attribute: # 0 ]]] The eval captures everything and turns it into nonzero exit status. The eval is there (and in two other places in _dispatch) because one can pass a command line as the first argument of compadd: compdef 'compadd *' f There might be another way to permit that without eval'ing, but it would be convoluted.