From unknown Mon Jun 16 23:56:20 2025 X-Loop: help-debbugs@gnu.org Subject: bug#72952: 30.0.90; Want way to break out of Eshell for loop Resent-From: Sean Whitton Original-Sender: "Debbugs-submit" Resent-CC: jporterbugs@gmail.com, bug-gnu-emacs@gnu.org Resent-Date: Mon, 02 Sep 2024 09:04:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 72952 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 72952@debbugs.gnu.org Cc: jporterbugs@gmail.com X-Debbugs-Original-To: bug-gnu-emacs@gnu.org X-Debbugs-Original-Xcc: jporterbugs@gmail.com Received: via spool by submit@debbugs.gnu.org id=B.172526780531510 (code B ref -1); Mon, 02 Sep 2024 09:04:01 +0000 Received: (at submit) by debbugs.gnu.org; 2 Sep 2024 09:03:25 +0000 Received: from localhost ([127.0.0.1]:43904 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sl2y4-0008C8-Th for submit@debbugs.gnu.org; Mon, 02 Sep 2024 05:03:25 -0400 Received: from lists.gnu.org ([209.51.188.17]:58598) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sl2y1-0008B7-PO for submit@debbugs.gnu.org; Mon, 02 Sep 2024 05:03:22 -0400 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 1sl2Ot-0000qd-OU for bug-gnu-emacs@gnu.org; Mon, 02 Sep 2024 04:27:03 -0400 Received: from sendmail.purelymail.com ([34.202.193.197]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sl2Or-0002u9-P0 for bug-gnu-emacs@gnu.org; Mon, 02 Sep 2024 04:27:03 -0400 DKIM-Signature: a=rsa-sha256; b=bbuzAfNklWz5v6ymFOKziegISySBZCyQ9Ea6JpjXIe+67KBZDuXIsAI/5B24J6AAdYqxBBp3ZVMrVeEoC7kiQLKXwLVofot5KGSUGtpVFzVx3tpA9IKg3czusAZBqrpUoETQ8P/oO8styn5FRjvt8ERsDCWWEub0l+Py+mXPcwYubKmGteitCqwruXkDBHHp+wDBlu4LTK9X11sd38BwmXOIaJlRnGNtugWY06wukes9O27b45MZlKvDnadlxZICJxckahX0ZETRHylB7LaggOX16n5ZWC6hfpTrdRrEtzbhaLNQ3q0GDwgZl6KdogPlXfve1bO5/D4uFnGz8VV3fg==; s=purelymail3; d=spwhitton.name; v=1; bh=u8mjs/L6VNpacaqxnhdftffv+BeElyfxE7Nub5DcnNg=; h=Received:Received:From:To:Subject:Date; DKIM-Signature: a=rsa-sha256; b=Eow1Yx/7j3EgE8/vsbQZUMaIPDr056VJf2SV1lg3MufOZNnJL1uDGu/vl2BYLQVM4bnL0Oi1dnTFBPqIyFmi8GAttl7DwV1IcWvnPMEPYigXIWsu4BbUQ3HfWQ7jGd2bzecAC8JU7l9laT1B6vWxy7UWwsag1AkQraBrjLZ9pfrLlhCNysiGZo+TU3E6FJVE7HYL9ZE1YMuklC7lSxwhRRmWRihToC4nIw1uVvDm09EXa2oqDlPccyhX8gLJYwDeyHKOEq0S8irGcRftWoxGp7wl04Cuh6cyORpRLi3zSTsZtSynvOuEhoie/YEH/bTmeESE14tT5Zpdj+cvhHtcBA==; s=purelymail3; d=purelymail.com; v=1; bh=u8mjs/L6VNpacaqxnhdftffv+BeElyfxE7Nub5DcnNg=; h=Feedback-ID:Received:Received:From:To:Subject:Date; Feedback-ID: 20115:3760:null:purelymail X-Pm-Original-To: bug-gnu-emacs@gnu.org Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id 2127947491 for (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Mon, 02 Sep 2024 08:26:56 +0000 (UTC) Received: by zephyr.silentflame.com (Postfix, from userid 1000) id 1F57C9427D5; Mon, 2 Sep 2024 09:26:55 +0100 (BST) From: Sean Whitton Date: Mon, 02 Sep 2024 09:26:55 +0100 Message-ID: <87ikve7968.fsf@zephyr.silentflame.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=34.202.193.197; envelope-from=spwhitton@spwhitton.name; helo=sendmail.purelymail.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) X-debbugs-cc: jporterbugs@gmail.com I am trying to run a series of tests like this: % for test in tests/tests/tagupl* { tests/using-intree $test } I want the command to give up as soon as one of the tests fails. But I don't think there is any way to break out of the loop? In POSIX sh, you could use 'break'. Thanks. -- Sean Whitton From unknown Mon Jun 16 23:56:20 2025 X-Loop: help-debbugs@gnu.org Subject: bug#72952: 30.0.90; Want way to break out of Eshell for loop Resent-From: Jim Porter Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 09 Sep 2024 01:02:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72952 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Sean Whitton , 72952@debbugs.gnu.org Received: via spool by 72952-submit@debbugs.gnu.org id=B72952.172584366130758 (code B ref 72952); Mon, 09 Sep 2024 01:02:01 +0000 Received: (at 72952) by debbugs.gnu.org; 9 Sep 2024 01:01:01 +0000 Received: from localhost ([127.0.0.1]:60337 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1snSm5-0007zy-7G for submit@debbugs.gnu.org; Sun, 08 Sep 2024 21:01:01 -0400 Received: from mail-pl1-f171.google.com ([209.85.214.171]:59783) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1snSm3-0007zW-Gi for 72952@debbugs.gnu.org; Sun, 08 Sep 2024 21:00:59 -0400 Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-201d5af11a4so38458185ad.3 for <72952@debbugs.gnu.org>; Sun, 08 Sep 2024 18:00:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725843590; x=1726448390; darn=debbugs.gnu.org; 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=8G07Sfp6SDKOhjjWXjyHpifaWcAJ7aZ+O2PiqO1fr7U=; b=Mz3445xtkMhFWIwCi3pbFisfq0VKMhyDEM3yTuyszc4Ia82iB+4i68nFnPOD2iuvTj nCnR6L9TB6/snoSXwx+UAMZqxGHgdonyWll9Feomy9FUSxt0yt/LN/8RQxxrVvBsld4U SItBR95m9PTfOdYovXqNhnghFRK71V9Vd3ZyGSCpgZ8E1C477+7XY7JaFOFe4YWLERfv Hd142+jSklieuo0zguBJVSwotNhafwUKZov+LVJzzq4HMHF+N7InL4I/xwQD/+zS7JrC nWS+ps5PkTfEUtyXMXtIJH8FOmxS7bcSU+S7O4KYygbSVtoMb88a6bjAkUCJHWRV58VB pDQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725843590; x=1726448390; 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=8G07Sfp6SDKOhjjWXjyHpifaWcAJ7aZ+O2PiqO1fr7U=; b=SmjuTQxHu3PSRL8wGPfKq2bvGJTQCLNgrXpnPlCbt/J1TJVI0j73TpXdToVu5D3nFz E8TW7KV3pjnF9RUrWXwUgOriDhKeW0BruMI/6SaFL+LA/pgrcukLPe6LsrUYGDrhCvys e/FRxueFUIX66n+3BAbNxiv1ohXkaRK41w9TE08WfE1zjOg9xcLsBX/GpscjumjxDB5p ++7ZbUpFCcduIkqIE7/nq5t9hwgrzq6LPa+X85BSWAg/QQ1p+4ou0sk5iBVcjPyBlHTO oXSYLU4SC/xrGR8xEFgu44jEy9lJnnPxhqh/HPcOzfnOPthpmYu3OeU7LUlz5EgQj11S 99PA== X-Forwarded-Encrypted: i=1; AJvYcCWW0TE6W6fsc/APq8H40dppHVRIPG/yyGLMr8eWI2ukX5fA5Eo3Tv7r/E3d0ZgwHAJbbP0QzQ==@debbugs.gnu.org X-Gm-Message-State: AOJu0YzlHmh5LmXFp7eGAAD1wpeNAMoZHJaiUMbVEsodAoQEx/Ck28FV u33vVojmS5+N/Xz/agDT2l3ixF6HHj5Ef+EOIKf8tvQO/gM9/3c1 X-Google-Smtp-Source: AGHT+IGk1Lpe6pAGbFpHrNGlQWlICCPb+n5+KijS+3VoFzCxgtumOOTlm2OR8eHPXYZttLYoGsdHrA== X-Received: by 2002:a17:902:ce0b:b0:202:51ca:9823 with SMTP id d9443c01a7336-206f05f62f3mr179113415ad.46.1725843590469; Sun, 08 Sep 2024 17:59:50 -0700 (PDT) Received: from [192.168.1.2] (syn-023-240-098-037.res.spectrum.com. [23.240.98.37]) by smtp.googlemail.com with ESMTPSA id d9443c01a7336-20710f1d4c6sm24213435ad.187.2024.09.08.17.59.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 08 Sep 2024 17:59:50 -0700 (PDT) Message-ID: Date: Sun, 8 Sep 2024 17:59:49 -0700 MIME-Version: 1.0 Content-Language: en-US References: <87ikve7968.fsf@zephyr.silentflame.com> From: Jim Porter In-Reply-To: <87ikve7968.fsf@zephyr.silentflame.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 9/2/2024 1:26 AM, Sean Whitton wrote: > X-debbugs-cc: jporterbugs@gmail.com > > I am trying to run a series of tests like this: > > % for test in tests/tests/tagupl* { tests/using-intree $test } > > I want the command to give up as soon as one of the tests fails. But I > don't think there is any way to break out of the loop? In POSIX sh, you > could use 'break'. I actually have a patch sitting in my pile of branches that does this, but it needs a fair bit more work to get right. The main thing it needs is to keep 'break' from bubbling up too far (e.g. if you run an Eshell script from inside a loop, 'break' at the top level of the script shouldn't break out of the parent loop). Another way to do something like this would be to embrace the Lispy-ness of Eshell and add a command-form for 'throw' and 'catch'. Something like: catch my-tag { for i in *.el { do-stuff if something-or-other { throw my-tag } } } Or even support both 'throw'/'catch' *and* 'break'... From unknown Mon Jun 16 23:56:20 2025 X-Loop: help-debbugs@gnu.org Subject: bug#72952: 30.0.90; Want way to break out of Eshell for loop Resent-From: Sean Whitton Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 12 Sep 2024 10:05:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72952 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Jim Porter Cc: 72952@debbugs.gnu.org Received: via spool by 72952-submit@debbugs.gnu.org id=B72952.172613546729338 (code B ref 72952); Thu, 12 Sep 2024 10:05:01 +0000 Received: (at 72952) by debbugs.gnu.org; 12 Sep 2024 10:04:27 +0000 Received: from localhost ([127.0.0.1]:40175 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1soggc-0007d8-Oo for submit@debbugs.gnu.org; Thu, 12 Sep 2024 06:04:27 -0400 Received: from sendmail.purelymail.com ([34.202.193.197]:36620) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1soggZ-0007cp-Vq for 72952@debbugs.gnu.org; Thu, 12 Sep 2024 06:04:25 -0400 DKIM-Signature: a=rsa-sha256; b=aRwG9nsfhcxOyH+PCXfau4ONEOvSl4EGbc9aBaTmAoJY0tu++aHr5BBoSPbEJD0zeS2wFlihkXUTeT/We40ZAvEIyabhGLnksEn7MY31vBELIfK7m0j+aXZ5AbBOwutjo/vKnUWAe6LLvvzpWrIUqojsWSrrCaaf8yO3YsKLfkDZEU+LMHiiVv7jPz3f3QBaY4jM/xE1M0ht4aOXz8UgrmEg8P9EAjLz1IvpJbP78x1BKGfvqcs+uEBFPWo68yUyw8dIO43tthrKQ2XXYBiJ7cLl1oyIIfWBgSggg42hKpii2fw5ZDB1I6JtApF25kGTKYPI6Jj0ac4xZRBgUlEyYA==; s=purelymail2; d=spwhitton.name; v=1; bh=bgd2uiIx8m/TEXvqpc4i6j35+ix8MqcPnSPaJq4Q43M=; h=Received:Received:From:To:Subject:Date; DKIM-Signature: a=rsa-sha256; b=jRLZjPuvfvVCQNfujnTJkqpPv2JbiVufxbkjWMjCCGC/lJfyeqdGR8edfPXy+onnJTtEAbxcMW4oxy6KuLP1Kkhe2sWu1qshFHSdu1PiEXUnutSC0CvlFN0FE3O/aDgtgaMbRFkBzn448YUlts94ZwNg9XXOBdOIKcwu0pCf/a7f3sUUjSPLVPmut5hD+Kl2aPv1Z9L2XTCMB3SK0g0UtioesuC6iUpwvMJPK3+RiqkZDmUDZYNV0I3KMyCBQr/NEgn0RU371YmO5coOxSMiwIO0jFqv4u68aD/4EYtyyuYkQ8iSnfnx6ZEZlDy2LMPPi3ASrmFTFb5NWWox5fV2Dw==; s=purelymail2; d=purelymail.com; v=1; bh=bgd2uiIx8m/TEXvqpc4i6j35+ix8MqcPnSPaJq4Q43M=; h=Feedback-ID:Received:Received:From:To:Subject:Date; Feedback-ID: 20115:3760:null:purelymail X-Pm-Original-To: 72952@debbugs.gnu.org Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id -941126212; (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Thu, 12 Sep 2024 10:04:07 +0000 (UTC) Received: by zephyr.silentflame.com (Postfix, from userid 1000) id 5D37D949EB9; Thu, 12 Sep 2024 11:04:06 +0100 (BST) From: Sean Whitton In-Reply-To: (Jim Porter's message of "Sun, 8 Sep 2024 17:59:49 -0700") References: <87ikve7968.fsf@zephyr.silentflame.com> Date: Thu, 12 Sep 2024 11:04:06 +0100 Message-ID: <87zfodp4rt.fsf@zephyr.silentflame.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, On Sun 08 Sep 2024 at 05:59pm -07, Jim Porter wrote: > On 9/2/2024 1:26 AM, Sean Whitton wrote: >> X-debbugs-cc: jporterbugs@gmail.com >> I am trying to run a series of tests like this: >> % for test in tests/tests/tagupl* { tests/using-intree $test } >> I want the command to give up as soon as one of the tests fails. But I >> don't think there is any way to break out of the loop? In POSIX sh, you >> could use 'break'. > > I actually have a patch sitting in my pile of branches that does this, but it > needs a fair bit more work to get right. The main thing it needs is to keep > 'break' from bubbling up too far (e.g. if you run an Eshell script from inside > a loop, 'break' at the top level of the script shouldn't break out of the > parent loop). > > Another way to do something like this would be to embrace the Lispy-ness of > Eshell and add a command-form for 'throw' and 'catch'. Something like: > > catch my-tag { > for i in *.el { > do-stuff > if something-or-other { throw my-tag } > } > } > > Or even support both 'throw'/'catch' *and* 'break'... Heh. throw/catch seems like overkill to me but supporting both would be cool! -- Sean Whitton