From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22347 invoked by alias); 20 Apr 2018 18:30:34 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: List-Unsubscribe: X-Seq: 23357 Received: (qmail 25827 invoked by uid 1010); 20 Apr 2018 18:30:33 -0000 X-Qmail-Scanner-Diagnostics: from mta01.eastlink.ca 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(24.224.136.30):SA:0(-2.6/5.0):. Processed in 1.368478 secs); 20 Apr 2018 18:30:33 -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=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: rayandrews@eastlink.ca X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | MIME-version: 1.0 Content-transfer-encoding: 8BIT Content-type: text/plain; charset=utf-8; format=flowed X-Authority-Analysis: v=2.3 cv=dfKuI0fe c=1 sm=1 tr=0 a=RnRVsdTsRxS/hkU0yKjOWA==:117 a=RnRVsdTsRxS/hkU0yKjOWA==:17 a=IkcTkHD0fZMA:10 a=lN4XhjNuC2U7NUVT1wAA:9 a=QEXdDO2ut3YA:10 X-EL-IP-NOAUTH: 24.207.101.9 To: Zsh Users From: Ray Andrews Subject: parse vs. runtime errors Message-id: Date: Fri, 20 Apr 2018 11:00:26 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 Content-language: en-CA How come: [ .... ]] is only caught as an error at runtime?  The error kills anything remaining on the same line, but subsequent linesexecute as normal.  I find most errors kill the entire parse, but there are some few that survive parse but throw the error at runtime.  Why is that?  It's a bit annoying that the runtime error can be buried in output and so not be noticed, and it seems like it would have to be an error at parse too.  Either way, can I ask zsh to always make any error stop everything and make itself known?  I'll often do something like: $ . func-file; func arg1 arg2 ... and if 'func-file' has some bug in the contained source of 'func ()', the older version of 'func' just runs anway and one does not see the error messageif the output scrolls off the screen.  True, one might not be so lazy and source the file, then run the command, but still it would be nice if there was some way of making zsh always stop whatever it is doing when any code error shows up.