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: 29.0.50; Eshell: The behavior of conditionals depends on whitespace Date: Sat, 26 Nov 2022 10:42:42 -0800 Message-ID: <8fec9d79-4118-eaa5-b762-c57f11f41aef@gmail.com> References: 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="6224"; 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 19:43:18 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 1oz090-0001Sa-6G for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 26 Nov 2022 19:43:18 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oz08p-0000T7-CP; Sat, 26 Nov 2022 13:43:07 -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 1oz08n-0000St-U7 for bug-gnu-emacs@gnu.org; Sat, 26 Nov 2022 13:43:05 -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 1oz08n-0007VY-AL for bug-gnu-emacs@gnu.org; Sat, 26 Nov 2022 13:43:05 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oz08k-0003bj-6Y for bug-gnu-emacs@gnu.org; Sat, 26 Nov 2022 13:43: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 18:43: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.166948817113858 (code B ref 59612); Sat, 26 Nov 2022 18:43:02 +0000 Original-Received: (at 59612) by debbugs.gnu.org; 26 Nov 2022 18:42:51 +0000 Original-Received: from localhost ([127.0.0.1]:41417 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oz08Z-0003bS-Bw for submit@debbugs.gnu.org; Sat, 26 Nov 2022 13:42:51 -0500 Original-Received: from mail-pj1-f51.google.com ([209.85.216.51]:54147) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oz08V-0003bM-Po for 59612@debbugs.gnu.org; Sat, 26 Nov 2022 13:42:49 -0500 Original-Received: by mail-pj1-f51.google.com with SMTP id t17so6096093pjo.3 for <59612@debbugs.gnu.org>; Sat, 26 Nov 2022 10:42:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=T1iZLMW7mABnG+cfxSNkOprgLpb8/aDN7x2yxFS54Nk=; b=DCaaZSHYeT7lFDx2ySUxhq5syfXbA884NQoOFb3sB33wLUmQWCS1dFoyehUYke/e94 3C5XEpPgGOx4AagCQPWGjMteyGfisrfei6vljqrzLxV/I2RKiMGs1SIpms1Lj+eaQNoI URl1wCknlCXoujp2dtzdPDY9ygl3nIixbHWwLEJmXPNPqJhPms7+Ri9s7EA3fKaiL/15 1axfbX0tJSFqGvjCQIRTmc/mhWrl+PXGMYppcyHMd024E2eLhebW+CkXPZoBaQ6slDvR /xXZJHGF1nzw1twntRh0LXjBNXgz9xkfaau5JBw4NOYRtcry1TUBceqx24p8XQyby2EV esKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=T1iZLMW7mABnG+cfxSNkOprgLpb8/aDN7x2yxFS54Nk=; b=E4e8sXENRsz6HbcmbddQ7SS5FI0EqDzLHq6q00DWI+ItqsYEIUi/iMIsnPKEhjetnG cXDfFYr65IOnnDosnRr5QGov0Ws3pofRbJuKZrFNajDGUi1AscVopwyD01HqdV0goEe4 lOpyu2Njax17u52xEm/EDNffJmV5WqYLUz/x+I4kqnTph8CjKbSP/3BC0Abns4Hix8k2 E/BjjduFwqoeI6EihSe8AISPpyhUgarE6u1qbej6Yl7MzOwUz8FwcO63bxMnDgspWYSl 8yjj03tx3DcH/v4FYuzSs10t7kZuYTSM28gkLS+IdL/rroE/we8DRebw8ElLclI49zFy PPMg== X-Gm-Message-State: ANoB5pkEDgc6bPyJhC0BF+uQQVnLGLf1MBVHiS10RR6U58liviMIp7p0 oel1OrDPMp0CLYMt+ZzbUTc= X-Google-Smtp-Source: AA0mqf66OsDa6DPbhauf2s3C7JBT95e9xOT/JlpMuhXWeAoJ97ZbbwkDFQbSCT6jUcaD8l1zROCtuA== X-Received: by 2002:a17:902:7d89:b0:189:325:3f72 with SMTP id a9-20020a1709027d8900b0018903253f72mr38237405plm.156.1669488162019; Sat, 26 Nov 2022 10:42:42 -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 ne12-20020a17090b374c00b00218d55b33d9sm7014075pjb.8.2022.11.26.10.42.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 26 Nov 2022 10:42:41 -0800 (PST) Content-Language: en-US In-Reply-To: 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:249125 Archived-At: On 11/26/2022 7:52 AM, Milan Zimmermann wrote: > # Result: > #  "It is 3" > #  "It is NOT 3" > # > > if { = 3 3 } { >    echo "It is 3" > } > { >    echo "It is NOT 3" > } According to Eshell's logic, I think this is correct (though inconvenient). Because Eshell treats a newline as the end of a command whenever possible, it just sees these as two separate commands. > # BUT we get the same incorrect result if we place the whole if > expression into {} > { >   if { = 4 4 } { >      echo "It is 4" >   } >   { >      echo "It is NOT 4" >   } > } This is really the same as the above: {...} allows multiple commands, so it sees this as two separate commands nested inside the {}. Ultimately, I think this is closer to a feature request: adding an "else" token would disambiguate this: if { = 2 2 } { echo "good" } else { echo "bad" } Actually making this work in Eshell's internals might be painful though... I do also see a potential bug. I'd expect this to work, but it doesn't: if { = 2 2 } \ { echo "good" } \ { echo "bad" }