From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.devel Subject: Re: Need message-fn arg back in ert-run-tests-interactively Date: Tue, 5 Sep 2023 15:43:57 -0700 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27457"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Lidell Mats To: rswgnu@gmail.com, emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Sep 06 00:45:21 2023 Return-path: Envelope-to: ged-emacs-devel@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 1qdenQ-0006xH-EX for ged-emacs-devel@m.gmane-mx.org; Wed, 06 Sep 2023 00:45:20 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qdemE-0003NX-Jk; Tue, 05 Sep 2023 18:44:06 -0400 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 1qdemA-0003Mu-E8 for emacs-devel@gnu.org; Tue, 05 Sep 2023 18:44:02 -0400 Original-Received: from mail-lf1-x12f.google.com ([2a00:1450:4864:20::12f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qdem8-000719-2I; Tue, 05 Sep 2023 18:44:02 -0400 Original-Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-500c7796d8eso4862569e87.1; Tue, 05 Sep 2023 15:43:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693953838; x=1694558638; darn=gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=Vc6BOW8V1tB7vxF2vPTukUGiGtrfr6MlIi4vrp4ywN8=; b=EJ8n2hLv8qznHd2ahsWC/jwkgpAow9OulJscWRbg/r1WS2LvILnx11ZMe9+Em953eN gNY7+0vTDE7aE6UHy2bc+iR2R3ZfDOIv5LDctIedqVSMW3KzsBipuNmFZYjQ+uGvsSjG Qzh3x7gr+oI5MGdioFbeiCiB1O3jLCEH3KdB4uSYVWEP+9JjNcJ/mGVhQXVkuPL/tj7X piMrAZfOcXiUS3Zueq6QAh8cHMdxxiaE92RD50gJyNoGC7W5/R4UxLX8KB55ZEoN+Fxw fjAOTt5L+oP69O3NNpRs1CxE/jRmEKAOl6YssK7D+DBbBH549SyPFnEonjjurIXcCQpy 0vgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693953838; x=1694558638; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Vc6BOW8V1tB7vxF2vPTukUGiGtrfr6MlIi4vrp4ywN8=; b=HNSFTZAR8P1fSXZiK/YFVHm39WTngsIyS9AegZxxJBcPGXqv8Su5pgJNa0fpS8PPTC tZVWNFVDz4gdv64I5fMj9zyczY9rBHzR5m/kUxDeVbZ/X4YZdzKaJdEVjPnVy9ERCZOr Uol8z0gWssafm6pD1cOJK6wpxAFX9JGCHK/xS21OIdAeRBIzZdOylEW77P4t3rgFDb39 erd301ankx7OXXhOC7rhPAF5KQt1aQxM+R4UuAvWs18Wyk6fZnQ2MeGphdFtI/Y0uzi8 qhc6gTad/FrIexyQYdkOEaZwqitkOG/7b/+W4nI+kXhJfIbat3WfOznsxb9JEGo4lULW 5joQ== X-Gm-Message-State: AOJu0Yzrf7aMW8o/pk5J5iwynjAm6AF9v2iX9b7lMSxLVEcuCyIBCb9Z PKKfrVVTL5ZH9/DL3q4hJrv6a7WE2tfxDk9SH8MyCJu4mCk= X-Google-Smtp-Source: AGHT+IGBWA9G2IhQsRuNBoiVIIRNq1l4VjDfhpM8BEvc91tFhTcTdbVCzLmvstrZX01EdZCcM+nO5nkYnWzvlEZlNCA= X-Received: by 2002:ac2:4e8d:0:b0:500:b53f:fbc2 with SMTP id o13-20020ac24e8d000000b00500b53ffbc2mr762834lfr.26.1693953838075; Tue, 05 Sep 2023 15:43:58 -0700 (PDT) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Tue, 5 Sep 2023 15:43:57 -0700 In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::12f; envelope-from=stefankangas@gmail.com; helo=mail-lf1-x12f.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-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:310157 Archived-At: Robert Weiner writes: > In ert.el of Emacs 27.1, we have a simple ability to override the 'message' > function when running ert tests interactively by setting the message-fn > argument here: > > ;; Should OUTPUT-BUFFER-NAME and MESSAGE-FN really be arguments here? > ;; They are needed only for our automated self-tests at the moment. > ;; Or should there be some other mechanism? > ;;;###autoload > (defun ert-run-tests-interactively (selector > &optional output-buffer-name message-fn) > > But in recent Emacs versions this function takes only the selector > argument, with no clear way of how to override messaging behavior so that a > message from a test case (rather than ert itself) can remain in the > minibuffer after a test case finishes: > > (defun ert-run-tests-interactively (selector) > "Run the tests specified by SELECTOR and display the results in a buffer. > > SELECTOR works as described in `ert-select-tests'." > > This would be very useful behavior to have back. Is there any simple way > to do it now or can you add it back in? You can use something like this: (cl-letf (((symbol-function 'message) (lambda (format-string &rest args) ...))) (ert-run-tests-interactively t)) This should work on both new and old versions of Emacs.