From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 7bcc56da for ; Thu, 26 Sep 2019 19:50:30 +0000 (UTC) Received: (qmail 7526 invoked by alias); 26 Sep 2019 19:50:25 -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: List-Unsubscribe: X-Seq: 44778 Received: (qmail 15826 invoked by uid 1010); 26 Sep 2019 19:50:25 -0000 X-Qmail-Scanner-Diagnostics: from mail-lf1-f50.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.101.2/25580. spamassassin: 3.4.2. Clear:RC:0(209.85.167.50):SA:0(-1.9/5.0):. Processed in 1.48511 secs); 26 Sep 2019 19:50:25 -0000 X-Envelope-From: schaefer@brasslantern.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.167.50 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=t36s7vOG6DXPnZUOCF7sgwf2Wd7HVFVDI125ZMWHQi4=; b=sgylOS1tWb+Jmf4d8MJyX0E1IAxMQ08ycJ2+mj2DTpzE3RoUL+BvgFImzVzsBZglFc O9fo/3ktBIftES7jsoybgfNL4XpTj844lIXTnDksRI/pKRrJ/v87f+1OUQ6jX1ifRmwo Y0ageCBpnnckJ7KjiP5imDV2ZDoM2VEo16uUvNyz6c+m1xc8xGzI9AfjVXvZP1pug16Q Xcf/tOg06FaoNgR7wFaGPYd7mmScktR8Bwv0/CYkjSAEEL8TF/RiVQYenQn+n7kFNp2e yA0hAfH5+zFE4pmyfvPyo0kvlbDMbBwHQ3YnCjIE80KZ8Pb2R3EYlWz0OrclRmNXbnJK i1Aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=t36s7vOG6DXPnZUOCF7sgwf2Wd7HVFVDI125ZMWHQi4=; b=nBlyCXEYNoBaKRZN5Pzq1CpZL4uqPfcyKPulbpyQSkOCKtS94NEA75NBJwWyuddEDJ ntrzpjrwnnBmQ4xmh4yYkv0s4K2dQmPGPB+TnRh4BaMsp6Vn0EzrQxi+qMAkAv6NaV2d cPgsnzD7uUt6Ihchxdinzr3gXMNcIDhqN9mZYWWV4P/wD+n4/+q2u5Id6J8qPeP1Ttyl EZfTxng3p/MZOjDbMfVPOKpkDIuE162qW3s8m52SYyYJBBrUXXU9SI108V53oXes6Nuc kG4ZeKV+mUPeYRTUQAUsChkyCtAVU5CSWFCXqtzlIcCKCI5bl9nyyPe08+jsy7r+xh8B 5Ygw== X-Gm-Message-State: APjAAAVsRO6aITkpmx983tJFhnQr4bVm018qpV6GgEk4JCthC2OhCb52 AllSyNnHAnhMRrmB4EKKGl/USHyOuHj/YiHClTogeC3oW4c= X-Google-Smtp-Source: APXvYqwzGZ+dL9DHH/jZ4KAhZP1EDvZOfV47jbfTm4jWMZkKYZjtb6CFGMEcgl+fDsRSAhzu2ofJvBBTOqYPO5Ad2Ww= X-Received: by 2002:a19:f111:: with SMTP id p17mr153926lfh.187.1569527389050; Thu, 26 Sep 2019 12:49:49 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Bart Schaefer Date: Thu, 26 Sep 2019 12:49:37 -0700 Message-ID: Subject: Re: print_exit_value unset in an scheduled function, yet still active To: Sebastian Gniazdowski Cc: Zsh hackers list Content-Type: text/plain; charset="UTF-8" On Thu, Sep 26, 2019 at 12:23 PM Sebastian Gniazdowski wrote: > > Hello, > func() { print $options[printexitvalue] $options[shglob]; false } > setopt printexitvalue; sched +0 func > > > So the printexitvalue is unset inside the scheduled function, yet it's > still being active (outside?). I'm not sure which part you think is wrong here. Even if, inside the function, printexitvalue is not active, the function itself returns nonzero here, because "false" is the last statement; so that exit value will be printed even though the exit value of "false" is not. If the question instead is "why did printexitvalue become unset inside the function": It's always turned off on entry to a function, so that only the exit value of the function itself will later be printed, exactly as happened here.