From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jim Porter Newsgroups: gmane.emacs.bugs Subject: bug#59612: Incorrect behavior also with ${CONDITION} Date: Sat, 26 Nov 2022 11:32:10 -0800 Message-ID: References: <860fa3d1-f8e5-68db-b82b-55a6991d10fc@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39518"; mail-complaints-to="usenet@ciao.gmane.io" To: Milan Zimmermann , 59612@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Nov 26 20:33:25 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oz0vV-000A3q-1O for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 26 Nov 2022 20:33:25 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oz0vA-0004aK-Tl; Sat, 26 Nov 2022 14:33:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oz0v9-0004aB-J6 for bug-gnu-emacs@gnu.org; Sat, 26 Nov 2022 14:33:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oz0v9-0006KK-Ar for bug-gnu-emacs@gnu.org; Sat, 26 Nov 2022 14:33:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oz0v8-0006Ml-3k for bug-gnu-emacs@gnu.org; Sat, 26 Nov 2022 14:33:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Jim Porter Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 26 Nov 2022 19:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59612 X-GNU-PR-Package: emacs Original-Received: via spool by 59612-submit@debbugs.gnu.org id=B59612.166949114124460 (code B ref 59612); Sat, 26 Nov 2022 19:33:02 +0000 Original-Received: (at 59612) by debbugs.gnu.org; 26 Nov 2022 19:32:21 +0000 Original-Received: from localhost ([127.0.0.1]:41473 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oz0uS-0006MS-V4 for submit@debbugs.gnu.org; Sat, 26 Nov 2022 14:32:21 -0500 Original-Received: from mail-pj1-f48.google.com ([209.85.216.48]:41935) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oz0uQ-0006MM-Gd for 59612@debbugs.gnu.org; Sat, 26 Nov 2022 14:32:19 -0500 Original-Received: by mail-pj1-f48.google.com with SMTP id w15-20020a17090a380f00b0021873113cb4so6894851pjb.0 for <59612@debbugs.gnu.org>; Sat, 26 Nov 2022 11:32:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:references:to:from :content-language:subject:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=LNo8x+ZHyDx32+/D3fcqIhqvb2gW8ahVjZPDC5MRBIU=; b=Vs2WmdZqX53x5tknOOEGVbBe7DqMPqA+JvDU9fo9xToYuAiO9hHXYhMb37SSiFxj7F j8913t59/zusUiizMqtD8lbntXafyUSowENwyMsMWJI4UqEJTrO9TcZvQiSBHcf2Kpfl WMu2oxQnxeOQs98QmdZ69blXqQPOgQZEeAXC0QHOxXGW0uAPgvSJYiumPpdoXcoATl66 34ha2hC2U5swP4DDgR+34Jkncn9iYqtL1yfbuyS/MIhLzqQ0oDkA0Axw3qO8WTWDfQyZ SXuGKIRSiMBcGeyX6oxezU3OUX94TaAUFLJDRPUzs2gDPnVP2ivz9ZU0vcWQzb7iJP9S ejvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:references:to:from :content-language:subject:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=LNo8x+ZHyDx32+/D3fcqIhqvb2gW8ahVjZPDC5MRBIU=; b=UL0YhmDWeoa7hsYAoeU16o5VysARIDSH16WI3t9rpn6BJRmo11n8BxQtuofCfnGMOE KBu9I5HeFLKefhepwrfBckC/4e9B9wXXPAyAhsWeC6MWd7mDXdDbu1xzRb/Nc5/aoSl4 Vz7ylKTjq6PxcnAcD+RMZBRnR/SF/09EMA2HQ2IfwECx/YRD1x3lZM8hQ5i3uN9eFcej p+1bvEm65jcze9oRxh34FLAcEx8wCiykz+TN6rwyu3oqbypjBS9iVQb5f7+J28FIPGMw /lEpA02EY85gRfRVgIZomaF12T3s0swk6cejA5LwzkfVGUXu2fCeO+DrmdrscNn4JXAX L7UQ== X-Gm-Message-State: ANoB5pk1xQqLyisCaTtJ0YutKWdF8KJAI5NywpXljr8ovTzjfdoChqMM mujMJ/jiuXqvMXVvq98MCYU= X-Google-Smtp-Source: AA0mqf6DM4r3YzItTnS2HVsMeSvI3Qcp400UqUUV9JlaKnW6OqEhIoAEWnnkMbNyZVhAo7vmEubG2Q== X-Received: by 2002:a17:902:ee55:b0:189:72c2:67f5 with SMTP id 21-20020a170902ee5500b0018972c267f5mr5208164plo.134.1669491132717; Sat, 26 Nov 2022 11:32:12 -0800 (PST) Original-Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id x65-20020a623144000000b0057437503580sm5054182pfx.188.2022.11.26.11.32.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 26 Nov 2022 11:32:12 -0800 (PST) Content-Language: en-US In-Reply-To: <860fa3d1-f8e5-68db-b82b-55a6991d10fc@gmail.com> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:249132 Archived-At: On 11/26/2022 10:28 AM, Jim Porter wrote: > On 11/26/2022 8:19 AM, Milan Zimmermann wrote: >> I should add that I realized using {CONDITION} alone is not a >> reasonable thing in my examples, as it uses exist status. >> >> In a real code, one would use  ${CONDITION}. The modified script is >> attached below #####. However, the behavior is still not as expected: > > In this case, they should actually be the same thing. When the command > in question is a Lisp function, a nil result sets the exit status to 2. > This doesn't hold for external commands though; the output and the exit > status are independent of one another. In that case, you'd want to spell > it like so: > >   if {[ 2 -eq 2 ]} { echo "good" } > > So in conclusion, I think it's better to prefer {CONDITION} for 'if' forms. Whoops, disregard this. For Lisp functions, I'm thinking of (CONDITION), not {CONDITION}.