From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21322 invoked by alias); 9 Apr 2018 15:51:46 -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: 23329 Received: (qmail 18013 invoked by uid 1010); 9 Apr 2018 15:51:46 -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(-1.9/5.0):. Processed in 15.172677 secs); 09 Apr 2018 15:51:46 -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=-1.9 required=5.0 tests=BAYES_00,T_SPF_TEMPERROR 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=_qq9nuZFQ_94-7_xGL4A:9 a=QEXdDO2ut3YA:10 X-EL-IP-NOAUTH: 24.207.101.9 Subject: Re: Line numbers and debugging verbosity To: zsh-users@zsh.org References: From: Ray Andrews Message-id: Date: Mon, 9 Apr 2018 08:51:25 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 In-reply-to: Content-language: en-CA On 08/04/18 10:19 PM, Bart Schaefer wrote: > functions -T test1 Not working yet, but I know what to research, so it will work shorty.  Anyway, the idea is not a full debug, just some helpful indication where a message comes from.  I can't stand it when I see some message and have no idea who is sending it to me, thereottabealaw! > warningmsg() { > print -n "${funcfiletrace[1]}: " && magline "$*" > } Marvellous.  Perfect, right out of the box, no need for any alias at all.  Why don't they know about this on the internet?  There's many queries about line numbers, but the answer is always the alias. > Just put a similar test in the definition of "warningmsg" e.g. > > warningmsg() { > (( $dbg )) && > print -nr - "${funcfiletrace[1]}: " && magline "$*" > } > > Now you don't have to modify the function, you just assign dbg=1 or dbg=0. Sure, *once* we're back with functions, it's easy.   Once any need for an alias to capture the line numbers is gone, all problems vanish.  Ironically, last night I figured out how to make it work with aliases too, but the above is vastly better anyway.   It's pleasing to know that the extra strictness of '5.5 has not really robbed me of any functionality, just stopped me from doing things a way that I know perfectly well is bogus.