From unknown Sun Jun 15 08:42:49 2025 X-Loop: help-debbugs@gnu.org Subject: bug#76531: Alternative to ert-with-temp-file/ert-with-temp-directory Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 24 Feb 2025 20:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 76531 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 76531@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.174042789331370 (code B ref -1); Mon, 24 Feb 2025 20:12:02 +0000 Received: (at submit) by debbugs.gnu.org; 24 Feb 2025 20:11:33 +0000 Received: from localhost ([127.0.0.1]:42862 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tmend-00089t-FJ for submit@debbugs.gnu.org; Mon, 24 Feb 2025 15:11:33 -0500 Received: from lists.gnu.org ([2001:470:142::17]:40076) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tmemZ-00087H-62 for submit@debbugs.gnu.org; Mon, 24 Feb 2025 15:10:27 -0500 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 1tmemT-0007VP-F3 for bug-gnu-emacs@gnu.org; Mon, 24 Feb 2025 15:10:21 -0500 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tmemR-0002cm-Dh for bug-gnu-emacs@gnu.org; Mon, 24 Feb 2025 15:10:21 -0500 Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-5dccaaca646so8467194a12.0 for ; Mon, 24 Feb 2025 12:10:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1740427817; x=1741032617; darn=gnu.org; h=to:subject:message-id:date:mime-version:from:from:to:cc:subject :date:message-id:reply-to; bh=3rSQEJuBaqlxpWE3nzYylGHXpxviZpvpovDfaPe5H4w=; b=Ejqvdh6v44AvTRWG1wWhRwRcvkH+PfteV/HPmReJhlCGXQedPUo8SNsP+2YbLViMe7 36rnv9pjjTIEY65QQY0WjJs22PYun3iyPy5lCkFzDPbDcLx02QIjWEoA1hAcH5DiIkd7 ZFTU7hAB5s74ajBPu/SM/OtT1Ar1u6tWTj8vE9BUlKx3cR45a9J6opOqAaemDGFhVP+L uLtSeXGGhXrGjyrzweLprqBsf5Bth6MHVdijB/5iyFlBL14Yqy+vmXXg9MMYvay1dxV6 oRU0YrU3GVzle1L9jvI8MCTI4JF6IwKDJUfoyTG+F8O6xGvT1qkOIAugQkSbT0aG2hCF t69w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740427817; x=1741032617; h=to:subject:message-id:date:mime-version:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=3rSQEJuBaqlxpWE3nzYylGHXpxviZpvpovDfaPe5H4w=; b=pjre0L0KHO4qhVv3O/2HVvBNFJHqJEgB2DKQtK+RFbLh4qYk6N27rGIRZAkCO2e6O3 o9rffRCIq4KQP1fCngUdecnV7G95KqJHL52xi+khu+fixP9oXm2AzQWheE8Q0SCOgFda hthENlGZQB/hUFxle1CmFFY+taO7QngSRDYi+mKLFFLoO3crLoIpJpN4v75I0cOjfsLT f1ZBhDyMzW1GeQ1O4UDfc14M+gT9jkICOnbKdZdEtDzjNb1fwAmI12OHFZL4B3UeDwtY jdFGrk/l/T9Qzpfa6Jx0r2R53Qs0m7B8HcnfBCcD82rAPolnFRPyUz1Ah0hwfBOAqHSU hqHg== X-Gm-Message-State: AOJu0YwJqls/NmoTl/ZxiEO1w+K/NfvsMyK/qXz3y2p4PcN6jYR3/bS9 Ugm9c9F18T5wGCWP4s/2n8X40t61wrmIzyYCd6QoepjddybR0Z87ZGo5a5be9rOrj+NigW4n615 0CV2SybOeNz8pIMvPBUIhou0D38HRrgv1AX8= X-Gm-Gg: ASbGncvLf4Zg3FJQx5f4R0VivpeoBpQAQABnKJwe1qT5izWIaM6f3IKvslkHqqyPf1P I5KrzgioDgA5GKjhOHcuVaG+g/3EejJKEmAHV7t5A8XnKfpJ30mtS92cDtDUoz0BSN5eNv05TAi XmY+E3ec9RCw== X-Google-Smtp-Source: AGHT+IH36DCQ53+Qlxft96V/5CnhHsmWim72EUrSk4SHJjcnme7e/lRjqnAuNhO0/qS6zKvhlFcjg8zYRkuGd1UP5EY= X-Received: by 2002:a05:6402:51d1:b0:5e0:8a27:cd36 with SMTP id 4fb4d7f45d1cf-5e0a125f6a2mr14783405a12.8.1740427817315; Mon, 24 Feb 2025 12:10:17 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Mon, 24 Feb 2025 20:10:17 +0000 From: Stefan Kangas MIME-Version: 1.0 Date: Mon, 24 Feb 2025 20:10:17 +0000 X-Gm-Features: AWEUYZnkvlpyKv0tH0WE10vFb4-UCYGlXYolvqXa-ig17gSgFVJzLOGpwrCaz3k Message-ID: Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2a00:1450:4864:20::52f; envelope-from=stefankangas@gmail.com; helo=mail-ed1-x52f.google.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.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: -0.0 (/) Severity: wishlist I'm happy that the ert-with-temp-file and ert-with-temp-directory have proven useful enough to now be documented in the ERT manual. However, I've actually not been to happy with them when they are used for more than one file or directory, because it leads to deep and ugly nesting. Before we release Emacs 31 with them, making them in effect non-experimental by documenting them, I would like to replace them with something better. However, before I start writing up the code, do we have any good ideas what a better interface should look like? Consider creating two files and a directory, which currently looks like: (ert-with-temp-file elfile :suffix ".el" (ert-with-temp-file elcfile :suffix ".elc" (ert-with-temp-directory dir :suffix "suf" ...))) The best I could come up with to replace it is this: (ert-with-temp-files ((elfile :suffix ".el") (elcfile :suffix ".elc") (dir :suffix "suf")) ...) Thoughts or better ideas? Thanks!