GNU bug report logs - #51037
[PATCH] Make `print-level` & `print-length` customizable in ERT batch tests

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: wishlist; Reported by: Michael <sp1ff@HIDDEN>; Keywords: patch; Done: Lars Ingebrigtsen <larsi@HIDDEN>; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 51037 <at> debbugs.gnu.org:


Received: (at 51037) by debbugs.gnu.org; 29 Nov 2021 16:16:54 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 29 11:16:54 2021
Received: from localhost ([127.0.0.1]:39107 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mrjKn-0007kG-GO
	for submit <at> debbugs.gnu.org; Mon, 29 Nov 2021 11:16:53 -0500
Received: from transit01.runbox.com ([91.220.196.211]:58236)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <sp1ff@HIDDEN>) id 1mrjKl-0007dv-JN
 for 51037 <at> debbugs.gnu.org; Mon, 29 Nov 2021 11:16:52 -0500
Received: from mailtransmit03.runbox ([10.9.9.163] helo=aibo.runbox.com)
 by transit01.runbox.com with esmtps (TLS1.2) tls
 TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93)
 (envelope-from <sp1ff@HIDDEN>)
 id 1mrjKe-008tJ4-Pn; Mon, 29 Nov 2021 17:16:44 +0100
Received: from [10.9.9.72] (helo=submission01.runbox)
 by mailtransmit03.runbox with esmtp (Exim 4.86_2)
 (envelope-from <sp1ff@HIDDEN>)
 id 1mrjKd-00073k-PC; Mon, 29 Nov 2021 17:16:43 +0100
Received: by submission01.runbox with esmtpsa [Authenticated ID (942723)]
 (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1)
 id 1mrjKP-0002IR-Fx; Mon, 29 Nov 2021 17:16:29 +0100
References: <86tuhvmtpl.fsf@HIDDEN> <87a6jd5891.fsf@HIDDEN>
 <86mtmykxro.fsf@HIDDEN> <87y26hz24c.fsf@HIDDEN>
 <86bl3blcgm.fsf@HIDDEN> <87wnlya9sj.fsf@HIDDEN>
 <86wnlbmooj.fsf@HIDDEN> <87fsry7qdy.fsf@HIDDEN>
 <87bl2m7q9g.fsf@HIDDEN> <86zgq5kn9y.fsf@HIDDEN>
 <87ilws7d7e.fsf@HIDDEN> <m2r1beeor3.fsf@HIDDEN>
 <87pmqxlsob.fsf@HIDDEN> <86pmqwkw1r.fsf@HIDDEN>
 <m2k0h49e6h.fsf@HIDDEN> <86mtlylqm6.fsf@HIDDEN>
 <m2bl2ea2rz.fsf@HIDDEN> <86h7c4l1wa.fsf@HIDDEN>
 <m2pmqs85fg.fsf@HIDDEN> <868rxdldoo.fsf@HIDDEN>
 <m2h7c1miu4.fsf@HIDDEN>
User-agent: mu4e 1.4.15; emacs 28.0.50
From: Michael <sp1ff@HIDDEN>
To: Filipp Gunbin <fgunbin@HIDDEN>
Subject: Re: bug#51037: [PATCH] Make `print-level` & `print-length`
 customizable in ERT batch tests
In-reply-to: <m2h7c1miu4.fsf@HIDDEN>
Date: Mon, 29 Nov 2021 08:16:25 -0800
Message-ID: <8635nfkkdi.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; format=flowed
X-Spam-Score: -0.1 (/)
X-Debbugs-Envelope-To: 51037
Cc: gazally@HIDDEN, Lars Ingebrigtsen <larsi@HIDDEN>,
 Eli Zaretskii <eliz@HIDDEN>, 51037 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.1 (-)

> On 24/11/2021 08:29 -0800, Michael wrote:
>
>>>> So, we could do either of:
>>>>
>>>>    1. As Filipp suggests, just change the contract for
>>>>    `ert-batch-backtrace-line-length' to: if set to nil, you 
>>>>    get
>>>>    full stack traces, period.
>>>>
>>>>    2. change `cl-print-to-string-with-limit' to respect the
>>>>    existing values of `print-length' & `print-level' when
>>>>    `limit' is nil. Note that the only caller (in Emacs) of 
>>>>    this
>>>>    function is the backtrace package.
>>>>
>>>> I vote for option 2. What say you all?
>>>
>>> I think the right way is 1 (which I already installed) because
>>> then, as
>>> the result of your patch, we get the ability to override
>>> backtrace-line-length with ert-batch-backtrace-line-length, 
>>> and
>>> nothing
>>> more.
>>>
>>> Changing the semantics of backtrace-line-length should be done
>>> (if done)
>>> in a separate issue, IMO.
>>>
>>> Personally, I like that LIMIT in cl-print-to-string-with-limit
>>> is "hard
>>> override".
>>
>> *shrugs* OK... so can we close this issue?
>
> But it's closed already?

So it is-- thanks.

-- 
Michael <sp1ff@HIDDEN>




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51037; Package emacs. Full text available.

Message received at 51037 <at> debbugs.gnu.org:


Received: (at 51037) by debbugs.gnu.org; 24 Nov 2021 19:53:18 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Nov 24 14:53:18 2021
Received: from localhost ([127.0.0.1]:55034 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mpyKU-0007aD-1N
	for submit <at> debbugs.gnu.org; Wed, 24 Nov 2021 14:53:18 -0500
Received: from out1-smtp.messagingengine.com ([66.111.4.25]:57577)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <fgunbin@HIDDEN>) id 1mpyKS-0007Zu-52
 for 51037 <at> debbugs.gnu.org; Wed, 24 Nov 2021 14:53:17 -0500
Received: from compute4.internal (compute4.nyi.internal [10.202.2.44])
 by mailout.nyi.internal (Postfix) with ESMTP id E487D5C010A;
 Wed, 24 Nov 2021 14:53:10 -0500 (EST)
Received: from mailfrontend1 ([10.202.2.162])
 by compute4.internal (MEProxy); Wed, 24 Nov 2021 14:53:10 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h=
 from:to:cc:subject:in-reply-to:references:date:message-id
 :mime-version:content-type; s=fm1; bh=MPXG0+tzenz9GFXARi/mvvoauv
 1SMyt4zLQQyjPUuVM=; b=T7zoEFC9f0zlbfa5mq9huR9w6YTGXZycrwP6gkF/b1
 ATGY7iwGifzsW/Apvr7tQOL56lNcoBP5aNtLcO6wX1k9xKXazF+9OZmmjypso1rb
 LRmJYukcHZAIiMiXkTphxB+B4x/LcJc4MvDG4pd4FsWMmgIQSHaYbx2ka8y9xihJ
 u9+dVR0DGqAw1pTilFvaxvXFAV6Ul+jRFsE7WDhF2bxE7cM7kyEpQaFwPo2QXvvA
 K2Gx8vb74AwLTjEnaHpgF+IbROkL5zZq2KPUchgm9rRXYYzd5AN1QQ7WvnGfgXvA
 E1Q5TMKKkB3mQDYqZ26NZ4d3rebqcdP8EE0XJTK4O0YA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:content-type:date:from:in-reply-to
 :message-id:mime-version:references:subject:to:x-me-proxy
 :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=MPXG0+
 tzenz9GFXARi/mvvoauv1SMyt4zLQQyjPUuVM=; b=kZ7c0WKgO1r5w2NoUZko48
 E/QSg7Ocu4f7OCtJWKPMTbS9UMDvqP00ULp60XEJrOJqLCGTMhagmPetK076s/jZ
 1LKWdlMiMFP1r91N2+QZMxjPaVeO3x/frccXPBxf5SH0irTl9GNOsT4jprZFe46q
 tvu+MmNIOtpjCSedizWTcioUwDqBDw2UQrqG+x03uIzSItSWR9+uqkMws4V1LxhJ
 W8+Ws1g1mdp6gXkK5sn/yg7ivhg+2lXol0mAKb0kR2cjUv4JGdO46U2sUXeVDp1w
 w35Q+3Hb86nztL7h8VExSSt3dFY8GuwShnaQ3sXU/XjH5ISSx3yUX9gVbmFRNOng
 ==
X-ME-Sender: <xms:JpieYUBNdkOIJPECQ-JuVOa5WYsLl2jEXT-1hN9PtLAhD2FVziplKw>
 <xme:JpieYWiAvAG4Jv9cd5BOAwc2Yoj2P4pcbGTLq8tYLxjT5lq9-OBFxNNFUiuz09Mm7
 Gbm12sz0jzmNVKa>
X-ME-Received: <xmr:JpieYXl04J9eQx-zlsKPidbwIQ2qgRiQIEMFn3jnmdhSjCnbaga3B-cQFfEUVoSGJw>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrgeekgddufeduucetufdoteggodetrfdotf
 fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
 uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne
 cujfgurhephffvufgjfhgffffkgggtsehttdertddtredtnecuhfhrohhmpefhihhlihhp
 phcuifhunhgsihhnuceofhhguhhnsghinhesfhgrshhtmhgrihhlrdhfmheqnecuggftrf
 grthhtvghrnhepvdevkeffvdeuvefhuddtjeehkedvueefveettddtveduudfgieffieev
 ieevhfdtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh
 epfhhguhhnsghinhesfhgrshhtmhgrihhlrdhfmh
X-ME-Proxy: <xmx:JpieYay5pU1MEq1nGM4oEfvCftbE-Y_JKy-E_IszGHrucCHmk9komQ>
 <xmx:JpieYZRaNIPSJ5g0po7MZTJf32tFUSDb80H1CaeNGN1d1xywjNqn1g>
 <xmx:JpieYVYlAkDrWb78rKlC8GGHrBfj0rWVWaWZWIRMS62RRXaRtyCH9g>
 <xmx:JpieYbefjUovKeeUIVA3sgw9osj_RhuLKdLxMeQUawrkiagZGyndDA>
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed,
 24 Nov 2021 14:53:09 -0500 (EST)
From: Filipp Gunbin <fgunbin@HIDDEN>
To: Michael <sp1ff@HIDDEN>
Subject: Re: bug#51037: [PATCH] Make `print-level` & `print-length`
 customizable in ERT batch tests
In-Reply-To: <868rxdldoo.fsf@HIDDEN> (Michael's message of "Wed, 24 Nov
 2021 08:29:43 -0800")
References: <86tuhvmtpl.fsf@HIDDEN> <86fst5m48v.fsf@HIDDEN>
 <87a6jd5891.fsf@HIDDEN> <86mtmykxro.fsf@HIDDEN>
 <87y26hz24c.fsf@HIDDEN> <86bl3blcgm.fsf@HIDDEN>
 <87wnlya9sj.fsf@HIDDEN> <86wnlbmooj.fsf@HIDDEN>
 <87fsry7qdy.fsf@HIDDEN> <87bl2m7q9g.fsf@HIDDEN>
 <86zgq5kn9y.fsf@HIDDEN> <87ilws7d7e.fsf@HIDDEN>
 <m2r1beeor3.fsf@HIDDEN> <87pmqxlsob.fsf@HIDDEN>
 <86pmqwkw1r.fsf@HIDDEN> <m2k0h49e6h.fsf@HIDDEN>
 <86mtlylqm6.fsf@HIDDEN> <m2bl2ea2rz.fsf@HIDDEN>
 <86h7c4l1wa.fsf@HIDDEN> <m2pmqs85fg.fsf@HIDDEN>
 <868rxdldoo.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (darwin)
Date: Wed, 24 Nov 2021 22:53:07 +0300
Message-ID: <m2h7c1miu4.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 51037
Cc: gazally@HIDDEN, Lars Ingebrigtsen <larsi@HIDDEN>,
 Eli Zaretskii <eliz@HIDDEN>, 51037 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

On 24/11/2021 08:29 -0800, Michael wrote:

>>> So, we could do either of:
>>>
>>>    1. As Filipp suggests, just change the contract for
>>>    `ert-batch-backtrace-line-length' to: if set to nil, you get
>>>    full stack traces, period.
>>>
>>>    2. change `cl-print-to-string-with-limit' to respect the
>>>    existing values of `print-length' & `print-level' when
>>>    `limit' is nil. Note that the only caller (in Emacs) of this
>>>    function is the backtrace package.
>>>
>>> I vote for option 2. What say you all?
>>
>> I think the right way is 1 (which I already installed) because
>> then, as
>> the result of your patch, we get the ability to override
>> backtrace-line-length with ert-batch-backtrace-line-length, and
>> nothing
>> more.
>>
>> Changing the semantics of backtrace-line-length should be done
>> (if done)
>> in a separate issue, IMO.
>>
>> Personally, I like that LIMIT in cl-print-to-string-with-limit
>> is "hard
>> override".
>
> *shrugs* OK... so can we close this issue?

But it's closed already?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51037; Package emacs. Full text available.

Message received at 51037 <at> debbugs.gnu.org:


Received: (at 51037) by debbugs.gnu.org; 24 Nov 2021 16:30:18 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Nov 24 11:30:18 2021
Received: from localhost ([127.0.0.1]:54787 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mpvA2-0006T8-7y
	for submit <at> debbugs.gnu.org; Wed, 24 Nov 2021 11:30:18 -0500
Received: from transit01.runbox.com ([91.220.196.211]:56410)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <sp1ff@HIDDEN>) id 1mpv9y-0006Sn-GA
 for 51037 <at> debbugs.gnu.org; Wed, 24 Nov 2021 11:30:16 -0500
Received: from mailtransmit03.runbox ([10.9.9.163] helo=aibo.runbox.com)
 by transit01.runbox.com with esmtps (TLS1.2) tls
 TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93)
 (envelope-from <sp1ff@HIDDEN>)
 id 1mpv9r-00EDTA-UN; Wed, 24 Nov 2021 17:30:07 +0100
Received: from [10.9.9.72] (helo=submission01.runbox)
 by mailtransmit03.runbox with esmtp (Exim 4.86_2)
 (envelope-from <sp1ff@HIDDEN>)
 id 1mpv9n-0007ws-Qb; Wed, 24 Nov 2021 17:30:04 +0100
Received: by submission01.runbox with esmtpsa [Authenticated ID (942723)]
 (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1)
 id 1mpv9X-0006Ih-M3; Wed, 24 Nov 2021 17:29:48 +0100
References: <86tuhvmtpl.fsf@HIDDEN> <87r1cp89o4.fsf@HIDDEN>
 <86fst5m48v.fsf@HIDDEN> <87a6jd5891.fsf@HIDDEN>
 <86mtmykxro.fsf@HIDDEN> <87y26hz24c.fsf@HIDDEN>
 <86bl3blcgm.fsf@HIDDEN> <87wnlya9sj.fsf@HIDDEN>
 <86wnlbmooj.fsf@HIDDEN> <87fsry7qdy.fsf@HIDDEN>
 <87bl2m7q9g.fsf@HIDDEN> <86zgq5kn9y.fsf@HIDDEN>
 <87ilws7d7e.fsf@HIDDEN> <m2r1beeor3.fsf@HIDDEN>
 <87pmqxlsob.fsf@HIDDEN> <86pmqwkw1r.fsf@HIDDEN>
 <m2k0h49e6h.fsf@HIDDEN> <86mtlylqm6.fsf@HIDDEN>
 <m2bl2ea2rz.fsf@HIDDEN> <86h7c4l1wa.fsf@HIDDEN>
 <m2pmqs85fg.fsf@HIDDEN>
User-agent: mu4e 1.4.15; emacs 28.0.50
From: Michael <sp1ff@HIDDEN>
To: Filipp Gunbin <fgunbin@HIDDEN>
Subject: Re: bug#51037: [PATCH] Make `print-level` & `print-length`
 customizable in ERT batch tests
In-reply-to: <m2pmqs85fg.fsf@HIDDEN>
Date: Wed, 24 Nov 2021 08:29:43 -0800
Message-ID: <868rxdldoo.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; format=flowed
X-Spam-Score: -0.1 (/)
X-Debbugs-Envelope-To: 51037
Cc: gazally@HIDDEN, Lars Ingebrigtsen <larsi@HIDDEN>,
 Eli Zaretskii <eliz@HIDDEN>, 51037 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.1 (-)


>> So, we could do either of:
>>
>>    1. As Filipp suggests, just change the contract for
>>    `ert-batch-backtrace-line-length' to: if set to nil, you get
>>    full stack traces, period.
>>
>>    2. change `cl-print-to-string-with-limit' to respect the
>>    existing values of `print-length' & `print-level' when
>>    `limit' is nil. Note that the only caller (in Emacs) of this
>>    function is the backtrace package.
>>
>> I vote for option 2. What say you all?
>
> I think the right way is 1 (which I already installed) because 
> then, as
> the result of your patch, we get the ability to override
> backtrace-line-length with ert-batch-backtrace-line-length, and 
> nothing
> more.
>
> Changing the semantics of backtrace-line-length should be done 
> (if done)
> in a separate issue, IMO.
>
> Personally, I like that LIMIT in cl-print-to-string-with-limit 
> is "hard
> override".

*shrugs* OK... so can we close this issue?

-- 
Michael <sp1ff@HIDDEN>




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51037; Package emacs. Full text available.

Message received at 51037 <at> debbugs.gnu.org:


Received: (at 51037) by debbugs.gnu.org; 22 Nov 2021 17:29:54 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 22 12:29:54 2021
Received: from localhost ([127.0.0.1]:48994 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mpD8c-0004gT-Eo
	for submit <at> debbugs.gnu.org; Mon, 22 Nov 2021 12:29:54 -0500
Received: from wout4-smtp.messagingengine.com ([64.147.123.20]:60491)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <fgunbin@HIDDEN>) id 1mpD8Y-0004gD-0k
 for 51037 <at> debbugs.gnu.org; Mon, 22 Nov 2021 12:29:53 -0500
Received: from compute4.internal (compute4.nyi.internal [10.202.2.44])
 by mailout.west.internal (Postfix) with ESMTP id 1118A320046E;
 Mon, 22 Nov 2021 12:29:44 -0500 (EST)
Received: from mailfrontend1 ([10.202.2.162])
 by compute4.internal (MEProxy); Mon, 22 Nov 2021 12:29:44 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h=
 from:to:cc:subject:in-reply-to:references:date:message-id
 :mime-version:content-type; s=fm1; bh=+uxkVE/u9PbJJwpqfu9Ug/Ye9c
 x8htmUmxnhLU+3PbI=; b=Eddk6keSfowPs5nXL24xo83oLyiNA2PmXTCdPg4xp6
 3sIbMGKsBQ+FIgCZy3F5STlvhaovhGLnfz6ZcqBYXEPX3xj5YyJoyBRwBkd3nz1Y
 4N7s0NxtzzHYHb8lJXHS5+km4Zf7I7ksCiFporse3Bkl9jy87mi3VYUnX3RdxKqE
 atGvDFJY1fx37wHS4ECobsAI5cSqqDoT3CUV7Do2rSc4ki58XUZRUlf0vdx3q6es
 PIo7iSdVYTa8S8AacxKugjcklQxJC8PgShkca7e+Opkey7O0bDSM/uC88v1gVjvj
 +aY3skgVlFtyXKPowSceVqRVJ7A8eCHHwPrt1+R0CcTA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:content-type:date:from:in-reply-to
 :message-id:mime-version:references:subject:to:x-me-proxy
 :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=+uxkVE
 /u9PbJJwpqfu9Ug/Ye9cx8htmUmxnhLU+3PbI=; b=FGxBEoh/k6pgyue+j4irOI
 bKAvnpmatxXJPdHYmRW6qSNfD4V4usOKKSxRefsADtRVydOFpuedqclkNyNx7cra
 eDlvL3CC1LkMMdgOz6kwTy0GeI+KT2Mf/EnITAQikYvly4aXMSP4I/P1dXuUbVwf
 QB5lBOdwfddAIZ/6Tnc9wD+GaHywT3+pRqRv/5i6nn6YCbSewqGx2uD5LLoGW4Iv
 euFndfRiAHOQ+k4uCW1A1MtbWoUUsUKhMfR8xZ3gvkhm4XdpD81o38TWJvfj9C5u
 r8HI/5tlFwkr65hbOqO9vqUOpX+/5pKxp8riVXzXxUAE7lySrDfUYRM4gMIy4G6g
 ==
X-ME-Sender: <xms:h9ObYdotcfAUZ08mRwvYEpt3kvmeVk5KX4aw10L-42g0WpeK031kSQ>
 <xme:h9ObYfp9UKj2WAlormSBRiQfz4PVBpnOX6RdWxWf_8O747ME5O2JKwFyUskmLOdsl
 g06A04wjddF7pFf>
X-ME-Received: <xmr:h9ObYaOXTOH_Fab2E2K8S5IdoJ5EHg7vDkSFcSZ9sGIHSav2Uv9tkmktNB3PgYOKiA>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrgeeggddutdefucetufdoteggodetrfdotf
 fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
 uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne
 cujfgurhephffvufgjfhgffffkgggtsehttdertddtredtnecuhfhrohhmpefhihhlihhp
 phcuifhunhgsihhnuceofhhguhhnsghinhesfhgrshhtmhgrihhlrdhfmheqnecuggftrf
 grthhtvghrnhepvdevkeffvdeuvefhuddtjeehkedvueefveettddtveduudfgieffieev
 ieevhfdtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh
 epfhhguhhnsghinhesfhgrshhtmhgrihhlrdhfmh
X-ME-Proxy: <xmx:h9ObYY5uACe6TtA6uWrqzWpOe0tGmC95F3ZVdiP21qN3XWg9lOcmnQ>
 <xmx:h9ObYc5qrknnbwZya3MDCNYnxzsA0bA_H1XSJRqb7yVaMiXPMP8KxA>
 <xmx:h9ObYQgqB64Wqda-64hXNcUGWB5Z9YADu2KxknA0lCme_56U8pixDw>
 <xmx:h9ObYanI19L3eYcEMW0OXED-5j810RkScxK4Pvc6kkLLTKNCm133Mw>
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon,
 22 Nov 2021 12:29:42 -0500 (EST)
From: Filipp Gunbin <fgunbin@HIDDEN>
To: Michael <sp1ff@HIDDEN>
Subject: Re: bug#51037: [PATCH] Make `print-level` & `print-length`
 customizable in ERT batch tests
In-Reply-To: <86h7c4l1wa.fsf@HIDDEN> (Michael's message of "Mon, 22 Nov
 2021 06:07:33 -0800")
References: <86tuhvmtpl.fsf@HIDDEN> <86ily2mjtq.fsf@HIDDEN>
 <87r1cp89o4.fsf@HIDDEN> <86fst5m48v.fsf@HIDDEN>
 <87a6jd5891.fsf@HIDDEN> <86mtmykxro.fsf@HIDDEN>
 <87y26hz24c.fsf@HIDDEN> <86bl3blcgm.fsf@HIDDEN>
 <87wnlya9sj.fsf@HIDDEN> <86wnlbmooj.fsf@HIDDEN>
 <87fsry7qdy.fsf@HIDDEN> <87bl2m7q9g.fsf@HIDDEN>
 <86zgq5kn9y.fsf@HIDDEN> <87ilws7d7e.fsf@HIDDEN>
 <m2r1beeor3.fsf@HIDDEN> <87pmqxlsob.fsf@HIDDEN>
 <86pmqwkw1r.fsf@HIDDEN> <m2k0h49e6h.fsf@HIDDEN>
 <86mtlylqm6.fsf@HIDDEN> <m2bl2ea2rz.fsf@HIDDEN>
 <86h7c4l1wa.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (darwin)
Date: Mon, 22 Nov 2021 20:29:39 +0300
Message-ID: <m2pmqs85fg.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 51037
Cc: gazally@HIDDEN, Lars Ingebrigtsen <larsi@HIDDEN>,
 Eli Zaretskii <eliz@HIDDEN>, 51037 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

On 22/11/2021 06:07 -0800, Michael wrote:

> So, we could do either of:
>
>    1. As Filipp suggests, just change the contract for
>    `ert-batch-backtrace-line-length' to: if set to nil, you get
>    full stack traces, period.
>
>    2. change `cl-print-to-string-with-limit' to respect the
>    existing values of `print-length' & `print-level' when
>    `limit' is nil. Note that the only caller (in Emacs) of this
>    function is the backtrace package.
>
> I vote for option 2. What say you all?

I think the right way is 1 (which I already installed) because then, as
the result of your patch, we get the ability to override
backtrace-line-length with ert-batch-backtrace-line-length, and nothing
more.

Changing the semantics of backtrace-line-length should be done (if done)
in a separate issue, IMO.

Personally, I like that LIMIT in cl-print-to-string-with-limit is "hard
override".

Filipp




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51037; Package emacs. Full text available.

Message received at 51037 <at> debbugs.gnu.org:


Received: (at 51037) by debbugs.gnu.org; 22 Nov 2021 14:08:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 22 09:08:27 2021
Received: from localhost ([127.0.0.1]:47308 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mp9zV-0007I3-UG
	for submit <at> debbugs.gnu.org; Mon, 22 Nov 2021 09:08:27 -0500
Received: from transit01.runbox.com ([91.220.196.211]:48086)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <sp1ff@HIDDEN>) id 1mp9zU-0007Ho-CN
 for 51037 <at> debbugs.gnu.org; Mon, 22 Nov 2021 09:08:16 -0500
Received: from mailtransmit03.runbox ([10.9.9.163] helo=aibo.runbox.com)
 by transit01.runbox.com with esmtps (TLS1.2) tls
 TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93)
 (envelope-from <sp1ff@HIDDEN>)
 id 1mp9zN-008XUr-NX; Mon, 22 Nov 2021 15:08:09 +0100
Received: from [10.9.9.72] (helo=submission01.runbox)
 by mailtransmit03.runbox with esmtp (Exim 4.86_2)
 (envelope-from <sp1ff@HIDDEN>)
 id 1mp9zA-00081L-95; Mon, 22 Nov 2021 15:07:56 +0100
Received: by submission01.runbox with esmtpsa [Authenticated ID (942723)]
 (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1)
 id 1mp9yx-0000qg-5u; Mon, 22 Nov 2021 15:07:43 +0100
References: <86tuhvmtpl.fsf@HIDDEN> <87czogslm4.fsf@HIDDEN>
 <86ily2mjtq.fsf@HIDDEN> <87r1cp89o4.fsf@HIDDEN>
 <86fst5m48v.fsf@HIDDEN> <87a6jd5891.fsf@HIDDEN>
 <86mtmykxro.fsf@HIDDEN> <87y26hz24c.fsf@HIDDEN>
 <86bl3blcgm.fsf@HIDDEN> <87wnlya9sj.fsf@HIDDEN>
 <86wnlbmooj.fsf@HIDDEN> <87fsry7qdy.fsf@HIDDEN>
 <87bl2m7q9g.fsf@HIDDEN> <86zgq5kn9y.fsf@HIDDEN>
 <87ilws7d7e.fsf@HIDDEN> <m2r1beeor3.fsf@HIDDEN>
 <87pmqxlsob.fsf@HIDDEN> <86pmqwkw1r.fsf@HIDDEN>
 <m2k0h49e6h.fsf@HIDDEN> <86mtlylqm6.fsf@HIDDEN>
 <m2bl2ea2rz.fsf@HIDDEN>
User-agent: mu4e 1.4.15; emacs 28.0.50
From: Michael <sp1ff@HIDDEN>
To: Filipp Gunbin <fgunbin@HIDDEN>
Subject: Re: bug#51037: [PATCH] Make `print-level` & `print-length`
 customizable in ERT batch tests
In-reply-to: <m2bl2ea2rz.fsf@HIDDEN>
Date: Mon, 22 Nov 2021 06:07:33 -0800
Message-ID: <86h7c4l1wa.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; format=flowed
X-Spam-Score: -0.1 (/)
X-Debbugs-Envelope-To: 51037
Cc: gazally@HIDDEN, Lars Ingebrigtsen <larsi@HIDDEN>,
 Eli Zaretskii <eliz@HIDDEN>, 51037 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)


Filipp Gunbin <fgunbin@HIDDEN> writes:

> On 20/11/2021 08:49 -0800, Michael wrote:
>
>>> On 19/11/2021 07:24 -0800, Michael wrote:
>>>
>>>> Lars Ingebrigtsen <larsi@HIDDEN> writes:
>>>>
>>>>> Filipp Gunbin <fgunbin@HIDDEN> writes:
>>>>>
>>>>>> The docstring for backtrace-line-length says: "If set to 
>>>>>> nil
>>>>>> or
>>>>>> zero,
>>>>>> backtrace mode will not abbreviate the forms it prints." 
>>>>>> So
>>>>>> the
>>>>>> above
>>>>>> sentence, which I removed, was indeed not true?  (a quick
>>>>>> look over
>>>>>> its usages confirmed that to me, but I'd like someone else 
>>>>>> to
>>>>>> check)
>>>>>
>>>>> I think the intention is that a nil value of
>>>>> backtrace-line-length
>>>>> shouldn't limit the lengths -- but I haven't tested it.
>>>>> Doesn't it
>>>>> work?
>>>>
>>>> Yes, I'm a bit lost, Filipp... what is your concern? And I
>>>> thought I *had* tested that.
>>>
>>> That the docstring contained a sentence which is not true.  A
>>> minor
>>> issue, of course.  I give examples here:
>>> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=51037#117
>>>
>>> (there was also fix of interactive spec of
>>> `ert-run-tests-interactively',
>>> but that's obvious I think)
>>>
>> Hey Filipp,
>>
>> Note that _is_ true, as far as I know, and was intended to be
>> true before my patch, and I verified that it became true with 
>> my
>> patch :) Can you provide a test case that demonstrates it to be
>> not true?
>
> Yes, here 
> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=51037#117, as I
> wrote above..

Oh.... oh, my-- you are on to something here, Filipp. My
apologies for not seeing it sooner. The problem lies in:

    (defun cl-print-to-string-with-limit (print-function value 
    limit)
      ...
      (setq limit (and (natnump limit)
                       (not (zerop limit))
                       limit))
      ;; Since this is used by the debugger when stack space may 
      be
      ;; limited, if you increase print-level here, add more depth 
      in
      ;; call_debugger (bug#31919).
      (let* ((print-length (when limit (min limit 50)))
             (print-level (when limit (min 8 (truncate (log 
             limit)))))


backtrace uses this function to print each frame, and as you can
see, if called with `limit' set to nil, `print-le{vel,ength}`
will *not* keep their current values, they will *also* be set to
`nil`.

So, we could do either of:

    1. As Filipp suggests, just change the contract for
    `ert-batch-backtrace-line-length' to: if set to nil, you get
    full stack traces, period.

    2. change `cl-print-to-string-with-limit' to respect the
    existing values of `print-length' & `print-level' when
    `limit' is nil. Note that the only caller (in Emacs) of this
    function is the backtrace package.

I vote for option 2. What say you all?

-- 
Michael <sp1ff@HIDDEN>




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51037; Package emacs. Full text available.

Message received at 51037 <at> debbugs.gnu.org:


Received: (at 51037) by debbugs.gnu.org; 20 Nov 2021 22:19:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Nov 20 17:19:40 2021
Received: from localhost ([127.0.0.1]:43810 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1moYhw-0004GD-4M
	for submit <at> debbugs.gnu.org; Sat, 20 Nov 2021 17:19:40 -0500
Received: from out1-smtp.messagingengine.com ([66.111.4.25]:33851)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <fgunbin@HIDDEN>) id 1moYhs-0004Fy-GD
 for 51037 <at> debbugs.gnu.org; Sat, 20 Nov 2021 17:19:38 -0500
Received: from compute3.internal (compute3.nyi.internal [10.202.2.43])
 by mailout.nyi.internal (Postfix) with ESMTP id 66D965C00CD;
 Sat, 20 Nov 2021 17:19:31 -0500 (EST)
Received: from mailfrontend1 ([10.202.2.162])
 by compute3.internal (MEProxy); Sat, 20 Nov 2021 17:19:31 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h=
 from:to:cc:subject:in-reply-to:references:date:message-id
 :mime-version:content-type; s=fm1; bh=dT13oeacRFmBrTW6HqXF/OCTfr
 LXWpYECde9Jaa6Xfs=; b=crxPAx9+LgdCjAN+deOFEhHWL+XcGhQnaEwSOdU2Or
 JLh9cjIRZZkaj7rw5qRt5zg4VlTDzNPIkeVb1KQfRGEJWNkWDyGP9rHJXMHLRMLX
 XU0MwMmEfGlTuERt5Rojuj2zAiFCj/kC5eVJA93bhbxlCAcoOjVR2A6/oyvITXBe
 +1lRv+Tl0uuc34ZWM8Q8JF6nSj/CcQ9PQYa6VD6UuwNW5VkBBxojH+BUeNy1acOA
 kdkkeNSdeH2nL2shRMtp2KxEOt0KXU/RDI+lHrKRpV5H+oSnEywsYOVY0ca7c9NC
 OsOoQ2YhpIZoDOgOiM4Ez2Sj1ezlUDuFOQ49JY0mV8XQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:content-type:date:from:in-reply-to
 :message-id:mime-version:references:subject:to:x-me-proxy
 :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=dT13oe
 acRFmBrTW6HqXF/OCTfrLXWpYECde9Jaa6Xfs=; b=kEgmwG1AaUsdRvkC5zXK7X
 PO1jUJI8UuJlxHkFxFQLylAUB+w3eYy54AzPImWPU09Z+EdAc6uFt8rZcq/GfEJp
 3jMKqgyvzB5fFFbDCA3BRT0JGOCrFJp4eCySd22elMZce6VFJlvuPFEiufkt56ub
 oTjhAMkHL77kRWKYV5RvGy57IWl/EFgR0nICPyh2NojoXMf0OemnRr4yFaOf5nkT
 SbSPfLT8b5VVfNgRb4RNUKsOLAhvy8vUVL/bQDgLNLmuFgFzledgyoH1I+T2u1zh
 QvqYrkvfTB/88cuawo+L/csJU/LQmvkYh1uzstilnm7MYu0DlDWXk8ziZcBSXgZw
 ==
X-ME-Sender: <xms:c3SZYW58V-jqKZLhxRhh7-N7PQhETMOsMcxkewP_9CHheZRUGV1DgA>
 <xme:c3SZYf7qaOixyTpXlidl5CJvHy0IV_6DH9T6jfeVWrSdddIPixCAiooXrvVWO3wk6
 Cw2f9yPazwgAbAE>
X-ME-Received: <xmr:c3SZYVeaVBUnLKfPa9TRowkx9vCQwyKi10K8LyRd400AF23gCm7r4JXZ0sCguIjD>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrgedtgdduiedtucetufdoteggodetrfdotf
 fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
 uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne
 cujfgurhephffvufgjfhgffffkgggtsehttdertddtredtnecuhfhrohhmpefhihhlihhp
 phcuifhunhgsihhnuceofhhguhhnsghinhesfhgrshhtmhgrihhlrdhfmheqnecuggftrf
 grthhtvghrnheptdffhefgffejtddvvdehueetheeiheegudeghffgueetgfdvfeeuudfh
 feduveeinecuffhomhgrihhnpehgnhhurdhorhhgnecuvehluhhsthgvrhfuihiivgeptd
 enucfrrghrrghmpehmrghilhhfrhhomhepfhhguhhnsghinhesfhgrshhtmhgrihhlrdhf
 mh
X-ME-Proxy: <xmx:c3SZYTJNxxansifQalfd-0OgtSECF-Vj7QQK3XcEtcDKipI0GSfRrA>
 <xmx:c3SZYaKOkoT0bcz4agg6epwRaOiuYrYON_rNgnHQjV_nw7IJnlXVkw>
 <xmx:c3SZYUzjypg6YlL70lh2Kb1dtRtgYpPwHLuX32VD85BCNVDpnYvANQ>
 <xmx:c3SZYW3m96j4w1DCJih8iNZtmwZh8b2peZlF9_pqNtdjOIjp55eCOQ>
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat,
 20 Nov 2021 17:19:29 -0500 (EST)
From: Filipp Gunbin <fgunbin@HIDDEN>
To: Michael <sp1ff@HIDDEN>
Subject: Re: bug#51037: [PATCH] Make `print-level` & `print-length`
 customizable in ERT batch tests
In-Reply-To: <86mtlylqm6.fsf@HIDDEN> (Michael's message of "Sat, 20 Nov
 2021 08:49:05 -0800")
References: <86tuhvmtpl.fsf@HIDDEN> <83fstd1bth.fsf@HIDDEN>
 <87czogslm4.fsf@HIDDEN> <86ily2mjtq.fsf@HIDDEN>
 <87r1cp89o4.fsf@HIDDEN> <86fst5m48v.fsf@HIDDEN>
 <87a6jd5891.fsf@HIDDEN> <86mtmykxro.fsf@HIDDEN>
 <87y26hz24c.fsf@HIDDEN> <86bl3blcgm.fsf@HIDDEN>
 <87wnlya9sj.fsf@HIDDEN> <86wnlbmooj.fsf@HIDDEN>
 <87fsry7qdy.fsf@HIDDEN> <87bl2m7q9g.fsf@HIDDEN>
 <86zgq5kn9y.fsf@HIDDEN> <87ilws7d7e.fsf@HIDDEN>
 <m2r1beeor3.fsf@HIDDEN> <87pmqxlsob.fsf@HIDDEN>
 <86pmqwkw1r.fsf@HIDDEN> <m2k0h49e6h.fsf@HIDDEN>
 <86mtlylqm6.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (darwin)
Date: Sun, 21 Nov 2021 01:19:28 +0300
Message-ID: <m2bl2ea2rz.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 51037
Cc: gazally@HIDDEN, Lars Ingebrigtsen <larsi@HIDDEN>,
 Eli Zaretskii <eliz@HIDDEN>, 51037 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

On 20/11/2021 08:49 -0800, Michael wrote:

>> On 19/11/2021 07:24 -0800, Michael wrote:
>>
>>> Lars Ingebrigtsen <larsi@HIDDEN> writes:
>>>
>>>> Filipp Gunbin <fgunbin@HIDDEN> writes:
>>>>
>>>>> The docstring for backtrace-line-length says: "If set to nil
>>>>> or
>>>>> zero,
>>>>> backtrace mode will not abbreviate the forms it prints."  So
>>>>> the
>>>>> above
>>>>> sentence, which I removed, was indeed not true?  (a quick
>>>>> look over
>>>>> its usages confirmed that to me, but I'd like someone else to
>>>>> check)
>>>>
>>>> I think the intention is that a nil value of
>>>> backtrace-line-length
>>>> shouldn't limit the lengths -- but I haven't tested it.
>>>> Doesn't it
>>>> work?
>>>
>>> Yes, I'm a bit lost, Filipp... what is your concern? And I
>>> thought I *had* tested that.
>>
>> That the docstring contained a sentence which is not true.  A
>> minor
>> issue, of course.  I give examples here:
>> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=51037#117
>>
>> (there was also fix of interactive spec of
>> `ert-run-tests-interactively',
>> but that's obvious I think)
>>
> Hey Filipp,
>
> Note that _is_ true, as far as I know, and was intended to be
> true before my patch, and I verified that it became true with my
> patch :) Can you provide a test case that demonstrates it to be
> not true?

Yes, here https://debbugs.gnu.org/cgi/bugreport.cgi?bug=51037#117, as I
wrote above..




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51037; Package emacs. Full text available.

Message received at 51037 <at> debbugs.gnu.org:


Received: (at 51037) by debbugs.gnu.org; 20 Nov 2021 16:49:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Nov 20 11:49:40 2021
Received: from localhost ([127.0.0.1]:43570 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1moTYa-0003SH-Fq
	for submit <at> debbugs.gnu.org; Sat, 20 Nov 2021 11:49:40 -0500
Received: from transit01.runbox.com ([91.220.196.211]:59388)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <sp1ff@HIDDEN>) id 1moTYX-0003S1-Vf
 for 51037 <at> debbugs.gnu.org; Sat, 20 Nov 2021 11:49:39 -0500
Received: from mailtransmit03.runbox ([10.9.9.163] helo=aibo.runbox.com)
 by transit01.runbox.com with esmtps (TLS1.2) tls
 TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93)
 (envelope-from <sp1ff@HIDDEN>)
 id 1moTYR-004PZf-B0; Sat, 20 Nov 2021 17:49:31 +0100
Received: from [10.9.9.72] (helo=submission01.runbox)
 by mailtransmit03.runbox with esmtp (Exim 4.86_2)
 (envelope-from <sp1ff@HIDDEN>)
 id 1moTYO-0004cV-4P; Sat, 20 Nov 2021 17:49:28 +0100
Received: by submission01.runbox with esmtpsa [Authenticated ID (942723)]
 (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1)
 id 1moTY5-0002ng-Ik; Sat, 20 Nov 2021 17:49:09 +0100
References: <86tuhvmtpl.fsf@HIDDEN> <87ily94662.fsf@HIDDEN>
 <83fstd1bth.fsf@HIDDEN> <87czogslm4.fsf@HIDDEN>
 <86ily2mjtq.fsf@HIDDEN> <87r1cp89o4.fsf@HIDDEN>
 <86fst5m48v.fsf@HIDDEN> <87a6jd5891.fsf@HIDDEN>
 <86mtmykxro.fsf@HIDDEN> <87y26hz24c.fsf@HIDDEN>
 <86bl3blcgm.fsf@HIDDEN> <87wnlya9sj.fsf@HIDDEN>
 <86wnlbmooj.fsf@HIDDEN> <87fsry7qdy.fsf@HIDDEN>
 <87bl2m7q9g.fsf@HIDDEN> <86zgq5kn9y.fsf@HIDDEN>
 <87ilws7d7e.fsf@HIDDEN> <m2r1beeor3.fsf@HIDDEN>
 <87pmqxlsob.fsf@HIDDEN> <86pmqwkw1r.fsf@HIDDEN>
 <m2k0h49e6h.fsf@HIDDEN>
User-agent: mu4e 1.4.15; emacs 28.0.50
From: Michael <sp1ff@HIDDEN>
To: Filipp Gunbin <fgunbin@HIDDEN>
Subject: Re: bug#51037: [PATCH] Make `print-level` & `print-length`
 customizable in ERT batch tests
In-reply-to: <m2k0h49e6h.fsf@HIDDEN>
Date: Sat, 20 Nov 2021 08:49:05 -0800
Message-ID: <86mtlylqm6.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; format=flowed
X-Spam-Score: -0.1 (/)
X-Debbugs-Envelope-To: 51037
Cc: gazally@HIDDEN, Lars Ingebrigtsen <larsi@HIDDEN>,
 Eli Zaretskii <eliz@HIDDEN>, 51037 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.1 (-)


> On 19/11/2021 07:24 -0800, Michael wrote:
>
>> Lars Ingebrigtsen <larsi@HIDDEN> writes:
>>
>>> Filipp Gunbin <fgunbin@HIDDEN> writes:
>>>
>>>> The docstring for backtrace-line-length says: "If set to nil 
>>>> or
>>>> zero,
>>>> backtrace mode will not abbreviate the forms it prints."  So 
>>>> the
>>>> above
>>>> sentence, which I removed, was indeed not true?  (a quick 
>>>> look over
>>>> its usages confirmed that to me, but I'd like someone else to
>>>> check)
>>>
>>> I think the intention is that a nil value of 
>>> backtrace-line-length
>>> shouldn't limit the lengths -- but I haven't tested it. 
>>> Doesn't it
>>> work?
>>
>> Yes, I'm a bit lost, Filipp... what is your concern? And I
>> thought I *had* tested that.
>
> That the docstring contained a sentence which is not true.  A 
> minor
> issue, of course.  I give examples here:
> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=51037#117
>
> (there was also fix of interactive spec of 
> `ert-run-tests-interactively',
> but that's obvious I think)
>
Hey Filipp,

Note that _is_ true, as far as I know, and was intended to be
true before my patch, and I verified that it became true with my
patch :) Can you provide a test case that demonstrates it to be
not true?

-- 
Michael <sp1ff@HIDDEN>




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51037; Package emacs. Full text available.

Message received at 51037 <at> debbugs.gnu.org:


Received: (at 51037) by debbugs.gnu.org; 19 Nov 2021 18:46:26 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Nov 19 13:46:25 2021
Received: from localhost ([127.0.0.1]:40495 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mo8u1-0003JP-Ly
	for submit <at> debbugs.gnu.org; Fri, 19 Nov 2021 13:46:25 -0500
Received: from out3-smtp.messagingengine.com ([66.111.4.27]:54049)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <fgunbin@HIDDEN>) id 1mo8tz-0003J8-L7
 for 51037 <at> debbugs.gnu.org; Fri, 19 Nov 2021 13:46:24 -0500
Received: from compute4.internal (compute4.nyi.internal [10.202.2.44])
 by mailout.nyi.internal (Postfix) with ESMTP id 78E6A5C0109;
 Fri, 19 Nov 2021 13:46:18 -0500 (EST)
Received: from mailfrontend2 ([10.202.2.163])
 by compute4.internal (MEProxy); Fri, 19 Nov 2021 13:46:18 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h=
 from:to:cc:subject:in-reply-to:references:date:message-id
 :mime-version:content-type; s=fm1; bh=HUZfojvfnvYvz4hIRG2pgHlX7g
 imYyc7b1i/mwlqGa0=; b=T+CafAvf8DRzfgGImETNrA3zm9NidrynXwteLDizyN
 SDyRHgytbGhTb/8g7Fqam0sSf/Qd2ebQdTvqFTGJaJNv6R3qeZV/UfyGbgIInN9m
 70YTorPAah2AbOmSyZuyVobVHky9YuMcWPYyDOkiw9/d0YQRZO6EmR9uGYoNjP1Q
 lTABs1Q52ZjDmWZC8cNk1rtIA+G+R/FAwfAc2RbxKhbor2MHoay85y5ID+A4oWO1
 jsHCW8Xo4Asw5TnIOB7VRJYUpjHx+bd6kEJQbTp94wRKMTqwUgR6vhsRqmEl9wKe
 4wbgwlPewuj94+mSs3ij/h3MENVnH9wFCk6VnZ1gqLwg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:content-type:date:from:in-reply-to
 :message-id:mime-version:references:subject:to:x-me-proxy
 :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=HUZfoj
 vfnvYvz4hIRG2pgHlX7gimYyc7b1i/mwlqGa0=; b=J6I4A9yhzgqGntd3Wy66Ic
 npIpB50QmQQ7upIFS8dQ6RW9U2xcKl4EUE6vN0YHrA+0dxO128fzhUKkzEc3M98L
 iTqGmkPSh60Mm/k0bsi0AxMKzYtM6aP6YR1n/y9EkPf8RDRZ4aoxoaKFiEN8gI5Q
 tKM9rh0kqZZcvQwjq6R00UWPve70vbNbwvwxWGU3xS93Dokbg5InE1hwroZFDuFV
 zBXLguqp/6VSjjl45PJMblTc22nmkWBjCejlCgnGPvJZAF2n25uoF11m+9mDLg4G
 i3CH3187Bq/8AdBf/eTougJ3tQbYxI//+J7KC2wfgIk+cKP428c1qiYbBxA8YJ4w
 ==
X-ME-Sender: <xms:-vCXYd2yL8wZHmqgnNYol74oSi6q6CpWSW4ekYmcNquw-gVEAl99gA>
 <xme:-vCXYUHSs5xSydNdu_6pXj7WXAGANO7lY_Jd-uFR_fKprnbNe8UKWZ4du0kJ0dHEG
 4s43nIHh1gHgqxX>
X-ME-Received: <xmr:-vCXYd5Dw3ANeFcJOAYuuJrmMleQVqAhhTuo2oQ_N6xbLDxk6wEx8HXJhkTEy6n07g>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrfeekgdduudehucetufdoteggodetrfdotf
 fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
 uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne
 cujfgurhephffvufgjfhgffffkgggtsehttdertddtredtnecuhfhrohhmpefhihhlihhp
 phcuifhunhgsihhnuceofhhguhhnsghinhesfhgrshhtmhgrihhlrdhfmheqnecuggftrf
 grthhtvghrnheptdffhefgffejtddvvdehueetheeiheegudeghffgueetgfdvfeeuudfh
 feduveeinecuffhomhgrihhnpehgnhhurdhorhhgnecuvehluhhsthgvrhfuihiivgeptd
 enucfrrghrrghmpehmrghilhhfrhhomhepfhhguhhnsghinhesfhgrshhtmhgrihhlrdhf
 mh
X-ME-Proxy: <xmx:-vCXYa3FqMuXXLXVX3fyctHrKhTYaaoWS5eTGOny_JuQH2RzohjTjQ>
 <xmx:-vCXYQFdNdaw0mlmQOObe2gCgQk3F7GzGh4baYgyfsuBjStZmYkUWg>
 <xmx:-vCXYb8bGkJVsf91z1D0HZBCoacnYrq_bQdYPD1l-dJUYsF6jcraEg>
 <xmx:-vCXYUCa3EWIlHrg6nSlSAXjehJrXNf9vNTNzcxiRGzvfYLWLQAP3Q>
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri,
 19 Nov 2021 13:46:16 -0500 (EST)
From: Filipp Gunbin <fgunbin@HIDDEN>
To: Michael <sp1ff@HIDDEN>
Subject: Re: bug#51037: [PATCH] Make `print-level` & `print-length`
 customizable in ERT batch tests
In-Reply-To: <86pmqwkw1r.fsf@HIDDEN> (Michael's message of "Fri, 19 Nov
 2021 07:24:48 -0800")
References: <86tuhvmtpl.fsf@HIDDEN> <83fste2u4i.fsf@HIDDEN>
 <87ily94662.fsf@HIDDEN> <83fstd1bth.fsf@HIDDEN>
 <87czogslm4.fsf@HIDDEN> <86ily2mjtq.fsf@HIDDEN>
 <87r1cp89o4.fsf@HIDDEN> <86fst5m48v.fsf@HIDDEN>
 <87a6jd5891.fsf@HIDDEN> <86mtmykxro.fsf@HIDDEN>
 <87y26hz24c.fsf@HIDDEN> <86bl3blcgm.fsf@HIDDEN>
 <87wnlya9sj.fsf@HIDDEN> <86wnlbmooj.fsf@HIDDEN>
 <87fsry7qdy.fsf@HIDDEN> <87bl2m7q9g.fsf@HIDDEN>
 <86zgq5kn9y.fsf@HIDDEN> <87ilws7d7e.fsf@HIDDEN>
 <m2r1beeor3.fsf@HIDDEN> <87pmqxlsob.fsf@HIDDEN>
 <86pmqwkw1r.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (darwin)
Date: Fri, 19 Nov 2021 21:46:14 +0300
Message-ID: <m2k0h49e6h.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 51037
Cc: gazally@HIDDEN, Lars Ingebrigtsen <larsi@HIDDEN>,
 Eli Zaretskii <eliz@HIDDEN>, 51037 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

On 19/11/2021 07:24 -0800, Michael wrote:

> Lars Ingebrigtsen <larsi@HIDDEN> writes:
>
>> Filipp Gunbin <fgunbin@HIDDEN> writes:
>>
>>> The docstring for backtrace-line-length says: "If set to nil or
>>> zero,
>>> backtrace mode will not abbreviate the forms it prints."  So the
>>> above
>>> sentence, which I removed, was indeed not true?  (a quick look over
>>> its usages confirmed that to me, but I'd like someone else to
>>> check)
>>
>> I think the intention is that a nil value of backtrace-line-length
>> shouldn't limit the lengths -- but I haven't tested it.  Doesn't it
>> work?
>
> Yes, I'm a bit lost, Filipp... what is your concern? And I
> thought I *had* tested that.

That the docstring contained a sentence which is not true.  A minor
issue, of course.  I give examples here:
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=51037#117

(there was also fix of interactive spec of `ert-run-tests-interactively',
but that's obvious I think)

Filipp





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51037; Package emacs. Full text available.

Message received at 51037 <at> debbugs.gnu.org:


Received: (at 51037) by debbugs.gnu.org; 19 Nov 2021 15:25:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Nov 19 10:25:11 2021
Received: from localhost ([127.0.0.1]:40349 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mo5lH-0005jY-Fx
	for submit <at> debbugs.gnu.org; Fri, 19 Nov 2021 10:25:11 -0500
Received: from transit01.runbox.com ([91.220.196.211]:53540)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <sp1ff@HIDDEN>) id 1mo5lF-0005jH-DC
 for 51037 <at> debbugs.gnu.org; Fri, 19 Nov 2021 10:25:10 -0500
Received: from mailtransmit02.runbox ([10.9.9.162] helo=aibo.runbox.com)
 by transit01.runbox.com with esmtps (TLS1.2) tls
 TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93)
 (envelope-from <sp1ff@HIDDEN>)
 id 1mo5l8-0022z1-K2; Fri, 19 Nov 2021 16:25:02 +0100
Received: from [10.9.9.74] (helo=submission03.runbox)
 by mailtransmit02.runbox with esmtp (Exim 4.86_2)
 (envelope-from <sp1ff@HIDDEN>)
 id 1mo5l7-0004Gq-8k; Fri, 19 Nov 2021 16:25:01 +0100
Received: by submission03.runbox with esmtpsa [Authenticated ID (942723)]
 (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1)
 id 1mo5ky-0000Nx-3P; Fri, 19 Nov 2021 16:24:52 +0100
References: <86tuhvmtpl.fsf@HIDDEN> <877deqec10.fsf@HIDDEN>
 <83fste2u4i.fsf@HIDDEN> <87ily94662.fsf@HIDDEN>
 <83fstd1bth.fsf@HIDDEN> <87czogslm4.fsf@HIDDEN>
 <86ily2mjtq.fsf@HIDDEN> <87r1cp89o4.fsf@HIDDEN>
 <86fst5m48v.fsf@HIDDEN> <87a6jd5891.fsf@HIDDEN>
 <86mtmykxro.fsf@HIDDEN> <87y26hz24c.fsf@HIDDEN>
 <86bl3blcgm.fsf@HIDDEN> <87wnlya9sj.fsf@HIDDEN>
 <86wnlbmooj.fsf@HIDDEN> <87fsry7qdy.fsf@HIDDEN>
 <87bl2m7q9g.fsf@HIDDEN> <86zgq5kn9y.fsf@HIDDEN>
 <87ilws7d7e.fsf@HIDDEN> <m2r1beeor3.fsf@HIDDEN>
 <87pmqxlsob.fsf@HIDDEN>
User-agent: mu4e 1.4.15; emacs 28.0.50
From: Michael <sp1ff@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
Subject: Re: bug#51037: [PATCH] Make `print-level` & `print-length`
 customizable in ERT batch tests
In-reply-to: <87pmqxlsob.fsf@HIDDEN>
Date: Fri, 19 Nov 2021 07:24:48 -0800
Message-ID: <86pmqwkw1r.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; format=flowed
X-Spam-Score: -0.1 (/)
X-Debbugs-Envelope-To: 51037
Cc: gazally@HIDDEN, Eli Zaretskii <eliz@HIDDEN>,
 Filipp Gunbin <fgunbin@HIDDEN>, 51037 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.1 (-)


Lars Ingebrigtsen <larsi@HIDDEN> writes:

> Filipp Gunbin <fgunbin@HIDDEN> writes:
>
>> The docstring for backtrace-line-length says: "If set to nil or 
>> zero,
>> backtrace mode will not abbreviate the forms it prints."  So 
>> the above
>> sentence, which I removed, was indeed not true?  (a quick look 
>> over
>> its usages confirmed that to me, but I'd like someone else to 
>> check)
>
> I think the intention is that a nil value of 
> backtrace-line-length
> shouldn't limit the lengths -- but I haven't tested it.  Doesn't 
> it
> work?

Yes, I'm a bit lost, Filipp... what is your concern? And I
thought I *had* tested that.

-- 
Michael <sp1ff@HIDDEN>




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51037; Package emacs. Full text available.

Message received at 51037 <at> debbugs.gnu.org:


Received: (at 51037) by debbugs.gnu.org; 18 Nov 2021 13:51:47 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Nov 18 08:51:47 2021
Received: from localhost ([127.0.0.1]:35189 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mnhpL-0006OH-FT
	for submit <at> debbugs.gnu.org; Thu, 18 Nov 2021 08:51:47 -0500
Received: from out4-smtp.messagingengine.com ([66.111.4.28]:59019)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <fgunbin@HIDDEN>) id 1mnhpI-0006Nx-Ed
 for 51037 <at> debbugs.gnu.org; Thu, 18 Nov 2021 08:51:45 -0500
Received: from compute3.internal (compute3.nyi.internal [10.202.2.43])
 by mailout.nyi.internal (Postfix) with ESMTP id 445495C01BE;
 Thu, 18 Nov 2021 08:51:39 -0500 (EST)
Received: from mailfrontend1 ([10.202.2.162])
 by compute3.internal (MEProxy); Thu, 18 Nov 2021 08:51:39 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h=
 from:to:cc:subject:in-reply-to:references:date:message-id
 :mime-version:content-type; s=fm1; bh=t3COXIOaNAAOgXLS3sbFen3Gm0
 EenWk2nfp7drLru/s=; b=hpgfU4Rm5fgsfw8dSEGl4tzzG+IoK+hr6Fp4eZyAcZ
 m6eA/3FsmO+fyArVz4z/P562Qy3li1UlTe/aTWoP7WuaCffUW665t9daiONrjlsA
 fhJ7Ohd3c9aLAsjilX00Jt6iz/jgv/55RkSVvKS5C4rLIgUpyjqlsPq+cojfC3NI
 kIbg5FjV0JjnW1gwgQ/LIce9uB7IZxWhOIuQcMFf+K+0c7eDaXNEDZcEMUBkHnmw
 yF31V4eB1L0nyuNoNxgWwNsMNwNKCjCnf1fVFaRG/S9XeYl4HJ1Cta9bXce2hMKw
 gAYiDdJlN5Fot5/EmRfT4fgFc+w0kIM6m3NA2vPi/pIg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:content-type:date:from:in-reply-to
 :message-id:mime-version:references:subject:to:x-me-proxy
 :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=t3COXI
 OaNAAOgXLS3sbFen3Gm0EenWk2nfp7drLru/s=; b=JoHaXU2J+ylVmNM1wRdqiu
 PA81rSfIXaaZMpeBNtZ9lTSuWilNh+fPGOToOo0xxeMkGTWZnTypVZLD6pmNpaNQ
 e33zYmM1Ym6Z00ds0HSS3+3GfWRKAuxjXLueotKjxMcTTdvNAoFjbfiA87I/Y3TA
 TIeGX9GOGvotmsshRfU2+ZmW3GIiO6AsTWz9Msgv9Qq0ypwBEWdH6Si/IYMKSyQO
 o3AHvGzryuBOzNeGUe5XOoDEO/8FBcVP6UEZdVajPtZ1IyQt3wbGutOjo8n8+5LJ
 cLNPMdfmNbJUrtMFYA3P0F/jIVoQAsLbv9w66+0EFrXVPVDLxxkLEGnnrA0fxaQw
 ==
X-ME-Sender: <xms:alqWYb--sGiyA2jaEPNKhp6XEMSRRJSTHIZNVnhANyt_DiLx0I9BHw>
 <xme:alqWYXvtqiAzB-IwX4mxzgGc_oRPKfdNOxpqqyvyMIbA3sjomBeF4jt3gxZxrXZpJ
 pbh5mUaLKnojLbp>
X-ME-Received: <xmr:alqWYZD35wg0SJCX6yw6dD6iFp6IgBW6SIoReP4XNTmPe9PEj1L-aaD2yL8nNGOfjQ>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrfeeigdehgecutefuodetggdotefrodftvf
 curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu
 uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc
 fjughrpefhvffujghffgffkfggtgesthdtredttdertdenucfhrhhomhephfhilhhiphhp
 ucfiuhhnsghinhcuoehfghhunhgsihhnsehfrghsthhmrghilhdrfhhmqeenucggtffrrg
 htthgvrhhnpedvveekffdvueevhfdutdejheekvdeufeevtedttdevuddugfeiffeiveei
 vefhtdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe
 hfghhunhgsihhnsehfrghsthhmrghilhdrfhhm
X-ME-Proxy: <xmx:alqWYXc005DEpu5VrehYY605MCvIFOnpvq2madT7s1E9Q1ZbijAg-A>
 <xmx:alqWYQMFCDeyyyhOFMisXk4kjscbC0EU859NR9TQ2eVVudEG-NyJJQ>
 <xmx:alqWYZlwlVwsua5Hv9CuaK7GEU-PeJigis5ClAb0nztiXBnO9ZOUBA>
 <xmx:a1qWYVrw9_ITFki92Bc4u9OCCPnLP1AOKpf6pwtz-CWuFoHGJwCnsA>
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu,
 18 Nov 2021 08:51:37 -0500 (EST)
From: Filipp Gunbin <fgunbin@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
Subject: Re: bug#51037: [PATCH] Make `print-level` & `print-length`
 customizable in ERT batch tests
In-Reply-To: <87pmqxlsob.fsf@HIDDEN> (Lars Ingebrigtsen's message of "Thu,
 18 Nov 2021 10:27:48 +0100")
References: <86tuhvmtpl.fsf@HIDDEN> <877deqec10.fsf@HIDDEN>
 <83fste2u4i.fsf@HIDDEN> <87ily94662.fsf@HIDDEN>
 <83fstd1bth.fsf@HIDDEN> <87czogslm4.fsf@HIDDEN>
 <86ily2mjtq.fsf@HIDDEN> <87r1cp89o4.fsf@HIDDEN>
 <86fst5m48v.fsf@HIDDEN> <87a6jd5891.fsf@HIDDEN>
 <86mtmykxro.fsf@HIDDEN> <87y26hz24c.fsf@HIDDEN>
 <86bl3blcgm.fsf@HIDDEN> <87wnlya9sj.fsf@HIDDEN>
 <86wnlbmooj.fsf@HIDDEN> <87fsry7qdy.fsf@HIDDEN>
 <87bl2m7q9g.fsf@HIDDEN> <86zgq5kn9y.fsf@HIDDEN>
 <87ilws7d7e.fsf@HIDDEN> <m2r1beeor3.fsf@HIDDEN>
 <87pmqxlsob.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (darwin)
Date: Thu, 18 Nov 2021 16:51:35 +0300
Message-ID: <m24k89fu6w.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 51037
Cc: Michael <sp1ff@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>,
 gazally@HIDDEN, 51037 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

On 18/11/2021 10:27 +0100, Lars Ingebrigtsen wrote:

> Filipp Gunbin <fgunbin@HIDDEN> writes:
>
>> The docstring for backtrace-line-length says: "If set to nil or zero,
>> backtrace mode will not abbreviate the forms it prints."  So the above
>> sentence, which I removed, was indeed not true?  (a quick look over
>> its usages confirmed that to me, but I'd like someone else to check)
>
> I think the intention is that a nil value of backtrace-line-length
> shouldn't limit the lengths -- but I haven't tested it.  Doesn't it
> work?

ert-batch-print-length/level are 10 by default, and print-length/level
are let-bound to them during ert batch runs.  With these values, the
backtraces should be limited, if backtrace-line-length says so.

Then we go:

emacs --batch -l ert \
  --eval "
(setq ert-batch-backtrace-right-margin nil
      backtrace-line-length 50
      ert-batch-backtrace-line-length t)
" \
  --eval '(ert-deftest my-test () (error "test error"))' \
  -f ert-run-tests-batch-and-exit

The output is limited.

Try the same with ert-batch-backtrace-line-length nil in --eval, and the
output is not limited at all.  So none of (ert-batch-)print-level/length
get into play.

So I think I'll install my patch now..

Filipp




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51037; Package emacs. Full text available.

Message received at 51037 <at> debbugs.gnu.org:


Received: (at 51037) by debbugs.gnu.org; 18 Nov 2021 09:28:04 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Nov 18 04:28:04 2021
Received: from localhost ([127.0.0.1]:34743 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mndi7-0007G9-Pv
	for submit <at> debbugs.gnu.org; Thu, 18 Nov 2021 04:28:03 -0500
Received: from quimby.gnus.org ([95.216.78.240]:46282)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1mndi3-0007FW-Lz
 for 51037 <at> debbugs.gnu.org; Thu, 18 Nov 2021 04:28:02 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=eNAm8W8kxDYAHXQASn0EMJsNX+kccicKYFwKCuOZwRs=; b=mPtoVPhyfgI5ApvRZBdybXNS9p
 MI7V5KCIJjDKVsAxI/rlneDi1xEFQI/y5mjvhSpPQDkDGdXq7yL14RYHPHhBpMH2x6XtzV5CEO2Ow
 kTSXUAHei0M8LIbx2NDe6Bsqvr2kSGiFKUOl2rGGKRfKFWFRNaX4kX7sV5dwEM5qAZck=;
Received: from [84.212.220.105] (helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1mndhu-0007qX-BP; Thu, 18 Nov 2021 10:27:52 +0100
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Filipp Gunbin <fgunbin@HIDDEN>
Subject: Re: bug#51037: [PATCH] Make `print-level` & `print-length`
 customizable in ERT batch tests
References: <86tuhvmtpl.fsf@HIDDEN> <877deqec10.fsf@HIDDEN>
 <83fste2u4i.fsf@HIDDEN> <87ily94662.fsf@HIDDEN>
 <83fstd1bth.fsf@HIDDEN> <87czogslm4.fsf@HIDDEN>
 <86ily2mjtq.fsf@HIDDEN> <87r1cp89o4.fsf@HIDDEN>
 <86fst5m48v.fsf@HIDDEN> <87a6jd5891.fsf@HIDDEN>
 <86mtmykxro.fsf@HIDDEN> <87y26hz24c.fsf@HIDDEN>
 <86bl3blcgm.fsf@HIDDEN> <87wnlya9sj.fsf@HIDDEN>
 <86wnlbmooj.fsf@HIDDEN> <87fsry7qdy.fsf@HIDDEN>
 <87bl2m7q9g.fsf@HIDDEN> <86zgq5kn9y.fsf@HIDDEN>
 <87ilws7d7e.fsf@HIDDEN> <m2r1beeor3.fsf@HIDDEN>
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj
 SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAFVBMVEUJCAkqKiofHx8e
 HiBISEdAPz7///+cw1o9AAAAAWJLR0QGYWa4fQAAAAd0SU1FB+ULEgg1KekNhfYAAAGQSURBVDjL
 5VNBchwhDBRSHjDA+g5DHiBoPyAb+wOpyv/fkgbW5XXKe3BVbpma2Rm6JTUttCL/z3U8Isr6xSM6
 PabGF+TDj0/AzMf8n1mEtA/rXbnH+FvqtW65N7Mae6zTOp6j3zmsV3S2yhqxGN/x+Ep05H7Cq0v4
 +U4sCfAmAbm84dfpLTZC1tKLtfC0t/OddTClucwNXE29uSE+PZV6AlRezNIPBys8abE20BQjdfGV
 Qrb0FN0KnVUchmxG0EoIlHDC2kTTITXBLy7P5cxgLGSYFjkPRwS+sb7NqNkwhXRHFrtk2z5sNqk3
 ldFHzJGE79A5OOOkzuCIxAPhxdgzM8GpSBJSGVH6xavksRtssFFo99Qs4VV6hsP3QRnHIBzdprJr
 R18ixgDKaFGPg5/BkdZhoTKncW8YOTvT3TN0ZdxGs2gePrhGVL0bh2KagxMZ9VRanC7txsHmOwA3
 67LfmQfi41fC/ifMIF/xaaqdMZW/Js50RnpYiN8RzKVPn2XbjZC7zZVJoPmHYuvLppGMP6M+Mp5c
 oDFnAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDIxLTExLTE4VDA4OjUzOjQwKzAwOjAwGa0n9gAAACV0
 RVh0ZGF0ZTptb2RpZnkAMjAyMS0xMS0xOFQwODo1Mzo0MCswMDowMGjwn0oAAAAASUVORK5CYII=
X-Now-Playing: Alasdair Roberts og =?utf-8?Q?V=C3=B6lvur's?= _The Old Fabled
 River_: "Nu solen =?utf-8?Q?g=C3=A5r?= ned"
Date: Thu, 18 Nov 2021 10:27:48 +0100
In-Reply-To: <m2r1beeor3.fsf@HIDDEN> (Filipp Gunbin's message of "Wed, 17
 Nov 2021 19:22:08 +0300")
Message-ID: <87pmqxlsob.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: Filipp Gunbin <fgunbin@HIDDEN> writes: > The docstring
 for backtrace-line-length says: "If set to nil or zero, > backtrace mode
 will not abbreviate the forms it prints." So the above > sentence, which I
 removed, was indeed not true? (a qui [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 51037
Cc: Michael <sp1ff@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>,
 51037 <at> debbugs.gnu.org, gazally@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Filipp Gunbin <fgunbin@HIDDEN> writes:

> The docstring for backtrace-line-length says: "If set to nil or zero,
> backtrace mode will not abbreviate the forms it prints."  So the above
> sentence, which I removed, was indeed not true?  (a quick look over
> its usages confirmed that to me, but I'd like someone else to check)

I think the intention is that a nil value of backtrace-line-length
shouldn't limit the lengths -- but I haven't tested it.  Doesn't it
work?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51037; Package emacs. Full text available.

Message received at 51037 <at> debbugs.gnu.org:


Received: (at 51037) by debbugs.gnu.org; 17 Nov 2021 16:22:24 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Nov 17 11:22:24 2021
Received: from localhost ([127.0.0.1]:33621 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mnNhX-0005JH-M7
	for submit <at> debbugs.gnu.org; Wed, 17 Nov 2021 11:22:23 -0500
Received: from out1-smtp.messagingengine.com ([66.111.4.25]:52265)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <fgunbin@HIDDEN>) id 1mnNhR-0005Iv-O1
 for 51037 <at> debbugs.gnu.org; Wed, 17 Nov 2021 11:22:22 -0500
Received: from compute4.internal (compute4.nyi.internal [10.202.2.44])
 by mailout.nyi.internal (Postfix) with ESMTP id 656185C00E6;
 Wed, 17 Nov 2021 11:22:12 -0500 (EST)
Received: from mailfrontend2 ([10.202.2.163])
 by compute4.internal (MEProxy); Wed, 17 Nov 2021 11:22:12 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h=
 from:to:cc:subject:in-reply-to:references:date:message-id
 :mime-version:content-type; s=fm1; bh=NINwfmJLZ4eh9FMCdfJzOILDsr
 qdsoQfe4PR8bZthzY=; b=BGuZbMSZy08734/AOqmg8RfnrK8RgSKRYbiaJN+IoV
 7QKy3BoUVpbq2X5c8qqoobUjuACj0pHglHyZRsJwkqkBLMm4Hxx4x1TtDRIczAqV
 5SwHSRssoLng9uM2j4N6Z9ATVxmM/BiXzvMV3bKx+CcljEjPxwFfgNnrapFV2bgZ
 MAIxEH/vfQgL23mlvJJ0GiBmh+zfvqpjfHWpV3RM5m1m3i7MTAohFPLtLCQMNpfw
 1ohMXslEBskwBTU2xUKQY2F1Zyp4vJZS7a1M4nSIFF90swpTVZA8JZ0pqtNQyH6W
 u4IeZzcKTFjgxZBj8okwzxkQqWlizRKrbH6vwrJqVzYg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:content-type:date:from:in-reply-to
 :message-id:mime-version:references:subject:to:x-me-proxy
 :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=NINwfm
 JLZ4eh9FMCdfJzOILDsrqdsoQfe4PR8bZthzY=; b=CP6e4IcQaf1lsApoBbKyVQ
 yKJvJPBTy6MUJgHRKfZ5aL00r5CAxopK7e1WQS0gZCZsjlLtYxk3WGqKQgZbOi5Y
 yveDYib0srSQcJpnJkEB1GXOLx5QvAAtj+Syfmo9dW6gTlxPoqYLoubJCYIIz1RJ
 olsUOoiFbG3ao7SSNx6C6TxuM5iuJaBuu14UfkNlPAYfDCdo5pjJY9Qpd6dh1P9F
 zhGg80si5hKRO7agvJ9tw1uFMf7yo5FM4ICUZlJtDUoIykwKXI/NAkUNxbJhM5Ym
 2osZ6l2E5YS+9P0uVZdKg35H1z+bR9WCeR9LP6/U+6CRgXofEEf0Qqdf7ALiEHAQ
 ==
X-ME-Sender: <xms:NCyVYZgD3wPN96P-SvQ_IRB3lUt-53LflUCZv0kgDQv2760on8ITMQ>
 <xme:NCyVYeAzRWv574WxqnzfISQeZiAuJ-DU3y4lfMZd69Tx_-XjRBAC_QocTdz2pp4Bd
 OuIE_f9wMLgkDgZ>
X-ME-Received: <xmr:NCyVYZGu8uJRa0NHvBEkxkRqncYXjc1U93iYWP-jtKuqOfzjLtIN_ODtVuFWX5qjrA>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrfeeggdekvdcutefuodetggdotefrodftvf
 curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu
 uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc
 fjughrpefhvffujghffgffkfggtgesthdtredttdertdenucfhrhhomhephfhilhhiphhp
 ucfiuhhnsghinhcuoehfghhunhgsihhnsehfrghsthhmrghilhdrfhhmqeenucggtffrrg
 htthgvrhhnpefhieehteekudegvdefkedvveduteevieeukeetuefffeekffdvleeihedu
 ffeljeenucffohhmrghinhepihhnghgvsghrihhgthhsvghnrdhnohenucevlhhushhtvg
 hrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehfghhunhgsihhnsehfrghs
 thhmrghilhdrfhhm
X-ME-Proxy: <xmx:NCyVYeQFuponXkEpUfn1k-Tkl3GwyBHyxgFHyu3kGPnQ8npFWcR_Eg>
 <xmx:NCyVYWwe82QWUG_qANTQNdTEyeI9aA4Qm0_toRzdN6RFyTeJJk7TGw>
 <xmx:NCyVYU6YT51nJiNzFYE-s-9tsdFUeCCr1VGTOI_vs9Sj2r8oeRPWiw>
 <xmx:NCyVYa95yRFXb4czp_m8qieyu2RHZyag80hbM6XnN4_dNAsbYlotVw>
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed,
 17 Nov 2021 11:22:10 -0500 (EST)
From: Filipp Gunbin <fgunbin@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
Subject: Re: bug#51037: [PATCH] Make `print-level` & `print-length`
 customizable in ERT batch tests
In-Reply-To: <87ilws7d7e.fsf@HIDDEN> (Lars Ingebrigtsen's message of "Tue,
 16 Nov 2021 08:48:53 +0100")
References: <86tuhvmtpl.fsf@HIDDEN> <877deqec10.fsf@HIDDEN>
 <83fste2u4i.fsf@HIDDEN> <87ily94662.fsf@HIDDEN>
 <83fstd1bth.fsf@HIDDEN> <87czogslm4.fsf@HIDDEN>
 <86ily2mjtq.fsf@HIDDEN> <87r1cp89o4.fsf@HIDDEN>
 <86fst5m48v.fsf@HIDDEN> <87a6jd5891.fsf@HIDDEN>
 <86mtmykxro.fsf@HIDDEN> <87y26hz24c.fsf@HIDDEN>
 <86bl3blcgm.fsf@HIDDEN> <87wnlya9sj.fsf@HIDDEN>
 <86wnlbmooj.fsf@HIDDEN> <87fsry7qdy.fsf@HIDDEN>
 <87bl2m7q9g.fsf@HIDDEN> <86zgq5kn9y.fsf@HIDDEN>
 <87ilws7d7e.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (darwin)
Date: Wed, 17 Nov 2021 19:22:08 +0300
Message-ID: <m2r1beeor3.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 51037
Cc: Michael <sp1ff@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>,
 51037 <at> debbugs.gnu.org, gazally@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

On 16/11/2021 08:48 +0100, Lars Ingebrigtsen wrote:

> Michael <sp1ff@HIDDEN> writes:
>
>> New patch attached. Incorporates (I hope) these changes, as well
>> as addresses Eli's issues.
>
> Thanks; applied to Emacs 29 with some minor changes.
>
> -- 
> (domestic pets only, the antidote for overdose, milk.)
>    bloggy blog: http://lars.ingebrigtsen.no

I've got this fixup patch for this, below.

Mainly this fixes `ert' interactive spec, where there was a leftover
second argument, nil.

However I'm not quite sure in this docstring fix:

-mode.  A value of nil will short-circuit this mechanism; line
-lengths will be completely determined by `ert-batch-line-length'
-and `ert-batch-line-level'.  Any other value will be temporarily

The docstring for backtrace-line-length says: "If set to nil or zero,
backtrace mode will not abbreviate the forms it prints."  So the above
sentence, which I removed, was indeed not true?  (a quick look over
its usages confirmed that to me, but I'd like someone else to check)

Thanks.


diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el
index 36b4408dc8..7f9b7b22c7 100644
--- a/lisp/emacs-lisp/ert.el
+++ b/lisp/emacs-lisp/ert.el
@@ -101,12 +101,10 @@ ert-batch-backtrace-line-length
 forming them.  This variable governs the target maximum line
 length by manipulating these two variables while printing stack
 traces.  Setting this variable to t will re-use the value of
-`backtrace-line-length' while print stack traces in ERT batch
-mode.  A value of nil will short-circuit this mechanism; line
-lengths will be completely determined by `ert-batch-line-length'
-and `ert-batch-line-level'.  Any other value will be temporarily
-bound to `backtrace-line-length' when producing stack traces
-in batch mode.")
+`backtrace-line-length' while printing stack traces in ERT batch
+mode.  Any other value will be temporarily bound to
+`backtrace-line-length' when producing stack traces in batch
+mode.")
 
 (defface ert-test-result-expected '((((class color) (background light))
                                      :background "green1")
@@ -1447,8 +1445,6 @@ ert-run-tests-batch
                         (cond
                          ((eq ert-batch-backtrace-line-length t)
                           backtrace-line-length)
-                         ((eq ert-batch-backtrace-line-length nil)
-                          nil)
                          (t
                           ert-batch-backtrace-line-length)))
                        (print-level ert-batch-print-level)
@@ -2055,8 +2051,7 @@ ert-run-tests-interactively
            (read
             (completing-read (format-prompt "Run tests" default)
                              obarray #'ert-test-boundp nil nil
-                             'ert--selector-history default nil)))
-         nil))
+                             'ert--selector-history default nil)))))
   (let (buffer listener)
     (setq listener
           (lambda (event-type &rest event-args)




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51037; Package emacs. Full text available.
bug marked as fixed in version 29.1, send any further explanations to 51037 <at> debbugs.gnu.org and Michael <sp1ff@HIDDEN> Request was from Lars Ingebrigtsen <larsi@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 51037 <at> debbugs.gnu.org:


Received: (at 51037) by debbugs.gnu.org; 16 Nov 2021 07:49:06 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 16 02:49:05 2021
Received: from localhost ([127.0.0.1]:56931 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mmtDF-0003BP-MN
	for submit <at> debbugs.gnu.org; Tue, 16 Nov 2021 02:49:05 -0500
Received: from quimby.gnus.org ([95.216.78.240]:51864)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1mmtDD-0003An-Ek
 for 51037 <at> debbugs.gnu.org; Tue, 16 Nov 2021 02:49:03 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=BcyveR82gRqxHAr8FqPqj1ZAy1vMQpOyF4SJgYALgls=; b=LamnpjJI24pifpu8BjbBOmlPhp
 ZUmsCfFJZNqg2PCRvSYtzfvPd6S+O/gT2deIfxT3kpQqDhu1Vv073cNkB+AGdVisQ/SKZtSjJ/myR
 oHOIVPnnb1a8ZlbQVU6uVbp5dGbwsFkvvLprKm5PQCMuGOOY9GjU6sqQW1LaU97Ru3ZE=;
Received: from [84.212.220.105] (helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1mmtD3-0003kP-Vs; Tue, 16 Nov 2021 08:48:56 +0100
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Michael <sp1ff@HIDDEN>
Subject: Re: bug#51037: [PATCH] Make `print-level` & `print-length`
 customizable in ERT batch tests
References: <86tuhvmtpl.fsf@HIDDEN> <877deqec10.fsf@HIDDEN>
 <83fste2u4i.fsf@HIDDEN> <87ily94662.fsf@HIDDEN>
 <83fstd1bth.fsf@HIDDEN> <87czogslm4.fsf@HIDDEN>
 <86ily2mjtq.fsf@HIDDEN> <87r1cp89o4.fsf@HIDDEN>
 <86fst5m48v.fsf@HIDDEN> <87a6jd5891.fsf@HIDDEN>
 <86mtmykxro.fsf@HIDDEN> <87y26hz24c.fsf@HIDDEN>
 <86bl3blcgm.fsf@HIDDEN> <87wnlya9sj.fsf@HIDDEN>
 <86wnlbmooj.fsf@HIDDEN> <87fsry7qdy.fsf@HIDDEN>
 <87bl2m7q9g.fsf@HIDDEN> <86zgq5kn9y.fsf@HIDDEN>
X-Now-Playing: Joni Mitchell's _Archives: The Early Years (3)_: "Eastern Rain"
Date: Tue, 16 Nov 2021 08:48:53 +0100
In-Reply-To: <86zgq5kn9y.fsf@HIDDEN> (Michael's message of "Mon, 15 Nov
 2021 15:32:57 -0800")
Message-ID: <87ilws7d7e.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: Michael <sp1ff@HIDDEN> writes: > New patch attached.
 Incorporates
 (I hope) these changes, as well > as addresses Eli's issues. Thanks; applied
 to Emacs 29 with some minor changes. 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 51037
Cc: gazally@HIDDEN, Eli Zaretskii <eliz@HIDDEN>, 51037 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Michael <sp1ff@HIDDEN> writes:

> New patch attached. Incorporates (I hope) these changes, as well
> as addresses Eli's issues.

Thanks; applied to Emacs 29 with some minor changes.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51037; Package emacs. Full text available.

Message received at 51037 <at> debbugs.gnu.org:


Received: (at 51037) by debbugs.gnu.org; 15 Nov 2021 23:33:26 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 15 18:33:26 2021
Received: from localhost ([127.0.0.1]:56535 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mmlTZ-0005Ye-Mk
	for submit <at> debbugs.gnu.org; Mon, 15 Nov 2021 18:33:26 -0500
Received: from transit01.runbox.com ([91.220.196.211]:48240)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <sp1ff@HIDDEN>) id 1mmlTR-0005YG-D1
 for 51037 <at> debbugs.gnu.org; Mon, 15 Nov 2021 18:33:24 -0500
Received: from aibo.runbox.com ([185.226.149.25])
 by transit01.runbox.com with esmtps (TLS1.2) tls
 TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93)
 (envelope-from <sp1ff@HIDDEN>)
 id 1mmlTK-00ALOA-FM; Tue, 16 Nov 2021 00:33:10 +0100
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=runbox.com; 
 s=selector1;
 h=Content-Type:MIME-Version:Date:Message-ID:In-reply-to:Subject
 :Cc:To:From:References; bh=i/fuKqKTW4EIog46iPoCX0MFvNg6CcNigFViGTgOUMM=; b=MD
 GAkA4i2XCvjKUaqJXBBhFzOIuQSYFoUWonMx3sog+iQAe3VCc6uc5I+zxHI51TM8G74zqj6kGZGxe
 j+FKRzsOPhanNfT+YunVv6cOM7HdGamKz/jZVZ5axlpJ990943pXfFvli7h2lT4dttKVvoTj8HfSz
 zOXpu8L8JjrdlbtyviXC4el00Zq6C3G7zRf0oj7KLaFNXhVOyDpNcBdUuSdsbVOvIVCIRRiT3Gl7Q
 f3zjIVzdOvWaNeu+OT/JisJZ+RwcQAy66d1tBUwgyoyM0qSWjVLGG8pLfvwxW9u/1r5G5vLXUpJ0R
 xDeDZERqgRykwNquK7O87RSdtD5T73Jg==;
Received: from [10.9.9.74] (helo=submission03.runbox)
 by mailtransmit02.runbox with esmtp (Exim 4.86_2)
 (envelope-from <sp1ff@HIDDEN>)
 id 1mmlTI-0006yI-Jf; Tue, 16 Nov 2021 00:33:08 +0100
Received: by submission03.runbox with esmtpsa [Authenticated ID (942723)]
 (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1)
 id 1mmlTB-0002wS-Cx; Tue, 16 Nov 2021 00:33:01 +0100
References: <86tuhvmtpl.fsf@HIDDEN> <877deqec10.fsf@HIDDEN>
 <83fste2u4i.fsf@HIDDEN> <87ily94662.fsf@HIDDEN>
 <83fstd1bth.fsf@HIDDEN> <87czogslm4.fsf@HIDDEN>
 <86ily2mjtq.fsf@HIDDEN> <87r1cp89o4.fsf@HIDDEN>
 <86fst5m48v.fsf@HIDDEN> <87a6jd5891.fsf@HIDDEN>
 <86mtmykxro.fsf@HIDDEN> <87y26hz24c.fsf@HIDDEN>
 <86bl3blcgm.fsf@HIDDEN> <87wnlya9sj.fsf@HIDDEN>
 <86wnlbmooj.fsf@HIDDEN> <87fsry7qdy.fsf@HIDDEN>
 <87bl2m7q9g.fsf@HIDDEN>
User-agent: mu4e 1.4.15; emacs 28.0.50
From: Michael <sp1ff@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#51037: [PATCH] Make `print-level` & `print-length`
 customizable in ERT batch tests
In-reply-to: <87bl2m7q9g.fsf@HIDDEN>
Message-ID: <86zgq5kn9y.fsf@HIDDEN>
Date: Mon, 15 Nov 2021 15:32:57 -0800
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 51037
Cc: gazally@HIDDEN, 51037 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

--=-=-=
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: quoted-printable


> Lars Ingebrigtsen <larsi@HIDDEN> writes:
>
>> Michael <sp1ff@HIDDEN> writes:
>>
>>> OK-- here's the revised patch.
>>
>> Thanks; applied to Emacs 29 (with some whitespace changes to=20
>> make the
>> lines less wide).
>
> I spoke to soon -- we don't seem to have copyright assignment=20
> papers on
> file?  Is that in the process of happening?
>
> So here's the patch again with the whitespace tweaks while we=20
> wait for
> that.  =F0=9F=A4=A8
>
> diff --git a/doc/misc/ert.texi b/doc/misc/ert.texi
[snip]

New patch attached. Incorporates (I hope) these changes, as well
as addresses Eli's issues.


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0001-Make-results-details-in-ert-run-tests-batch-configur.patch
Content-Description: bug#51037

From ccc3a72949f8298c2b8194d3b302d019f934af43 Mon Sep 17 00:00:00 2001
From: Michael Herstine <sp1ff@HIDDEN>
Date: Tue, 5 Oct 2021 06:53:02 -0700
Subject: [PATCH] Make results details in ert-run-tests-batch configurable.

This commit introduces three new ert variables:
ert-batch-print-length, ert-batch-print-level &
ert-batch-backtrace-length.  The first two control print-length
and print-level, resp., when printing test results.

Since even modest values of print-level & print-length can
produce extremely long lines in backtraces along with
correspondingly long processing times to format them, this commit
also introduces the variable ert-backtrace-line-length which can,
optionally, override backtrace-line-length during ert batch test
stack traces.

Finally, it also removes the optional message-fn & output-buffer
arguments to ert-run-test-interactively (since they were only
used for testing purposes) and re-implements its tests in
terms of cl-letf.

* lisp/emacs-lisp/ert.el (ert-batch-print-length,
ert-batch-print-level,.ert-batch-backtrace-line-length,
ert-batch-test, ert-run-tests-interactively): Added the three
variables, bound them to these settings when formatting batch
test results including backtraces. Removed the optional
parameters output-buffer & message-fn from
ert-run-tests-interactively.
* test/lisp/emacs-lisp/ert-tests.el
(ert-test-run-tests-interactively, ert-test-run-tests-batch): use
cl-letf to capture output, new tests resp.
* test/lisp/ert-x-tests.el (ert-test-run-tests-interactively-2):
Changed to use cl-letf to capture output instead of using
message-fn.
* lisp/emacs-lisp/backtrace.el (backtrace--line-length-or-nil,
backtrace--print-func-and-args): Fixed a bug when setting
backtrace-line-length to nil by adding a new function to check
for that case & having backtrace--print-func-and-args use it.
* doc/misc/ert.texi: document the new variables & their usage
---
 doc/misc/ert.texi                   | 25 +++++++++
 etc/NEWS                            |  7 +++
 lisp/emacs-lisp/backtrace.el        | 21 +++++--
 lisp/emacs-lisp/ert.el              | 87 +++++++++++++++++++----------
 test/lisp/emacs-lisp/ert-tests.el   | 82 ++++++++++++++++++++++++---
 test/lisp/emacs-lisp/ert-x-tests.el | 44 ++++++++-------
 6 files changed, 200 insertions(+), 66 deletions(-)

diff --git a/doc/misc/ert.texi b/doc/misc/ert.texi
index 440c61add8e..2de3946db1e 100644
--- a/doc/misc/ert.texi
+++ b/doc/misc/ert.texi
@@ -390,6 +390,31 @@ Running Tests in Batch Mode
 emacs -batch -l ert -f ert-summarize-tests-batch-and-exit output.log
 @end example
 
+@vindex ert-batch-print-level
+@vindex ert-batch-print-length
+ERT attempts to limit the output size for failed tests by choosing
+conservative values for @code{print-level} & @code{print-length}
+when printing Lisp values.  This can in some cases make it difficult
+to see which portions of those values are incorrect.  Use
+@code{ert-batch-print-level} and @code{ert-batch-print-length}
+to customize that:
+
+@example
+emacs -batch -l ert -l my-tests.el \
+      --eval "(let ((ert-batch-print-level 10) \
+                    (ert-batch-print-length 120)) \
+                (ert-run-tests-batch-and-exit))"
+@end example
+
+@vindex ert-batch-backtrace-line-length
+Even modest settings for @code{print-level} & @code{print-length} can
+produce extremely long lines in backtraces, however, with attendant
+pauses in execution progress.  Set
+@code{ert-batch-backtrace-line-length} to t to use the value of
+@code{backtrace-line-length}, nil to stop any limitations on backtrace
+line lengths (i.e.@: to get full backtraces), or a positive integer to
+limit backtrace line length to that number.
+
 @vindex ert-quiet
 By default, ERT in batch mode is quite verbose, printing a line with
 result after each test.  This gives you progress information: how many
diff --git a/etc/NEWS b/etc/NEWS
index 3cad0995ac5..2fccea2a2eb 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -46,6 +46,13 @@ time.
 
 * Changes in Emacs 29.1
 
++++
+** New ERT variables 'ert-batch-print-length' and 'ert-batch-print-level'.
+These variables will override 'print-length' and 'print-level' when
+printing Lisp values in ERT batch test results.
+
+** Emacs now supports Unicode Standard version 14.0.
+
 ** Emoji
 
 +++
diff --git a/lisp/emacs-lisp/backtrace.el b/lisp/emacs-lisp/backtrace.el
index a5721aa3193..0e5f85d7b8b 100644
--- a/lisp/emacs-lisp/backtrace.el
+++ b/lisp/emacs-lisp/backtrace.el
@@ -55,9 +55,9 @@ backtrace-fontify
 (defcustom backtrace-line-length 5000
   "Target length for lines in Backtrace buffers.
 Backtrace mode will attempt to abbreviate printing of backtrace
-frames to make them shorter than this, but success is not
-guaranteed.  If set to nil or zero, Backtrace mode will not
-abbreviate the forms it prints."
+frames by setting `print-level' and `print-length' to make them
+shorter than this, but success is not guaranteed.  If set to nil
+or zero, backtrace mode will not abbreviate the forms it prints."
   :type 'integer
   :group 'backtrace
   :version "27.1")
@@ -751,6 +751,13 @@ backtrace--print-flags
     (insert (make-string (- backtrace--flags-width (- (point) beg)) ?\s))
     (put-text-property beg (point) 'backtrace-section 'func)))
 
+(defun backtrace--line-length-or-nil ()
+  "Return `backtrace-line-length' if valid, nil else."
+  ;; mirror the logic in `cl-print-to-string-with-limits'
+  (and (natnump backtrace-line-length)
+       (not (zerop backtrace-line-length))
+       backtrace-line-length))
+
 (defun backtrace--print-func-and-args (frame _view)
   "Print the function, arguments and buffer position of a backtrace FRAME.
 Format it according to VIEW."
@@ -769,11 +776,13 @@ backtrace--print-func-and-args
       (if (atom fun)
           (funcall backtrace-print-function fun)
         (insert
-         (backtrace--print-to-string fun (when args (/ backtrace-line-length 2)))))
+         (backtrace--print-to-string fun (when (and args (backtrace--line-length-or-nil)) (/ backtrace-line-length 2)))))
       (if args
           (insert (backtrace--print-to-string
-                   args (max (truncate (/ backtrace-line-length 5))
-                             (- backtrace-line-length (- (point) beg)))))
+                   args
+                   (if (backtrace--line-length-or-nil)
+                       (max (truncate (/ backtrace-line-length 5))
+                            (- backtrace-line-length (- (point) beg))))))
         ;; The backtrace-form property is so that backtrace-multi-line
         ;; will find it.  backtrace-multi-line doesn't do anything
         ;; useful with it, just being consistent.
diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el
index 8ebc81fd418..36b4408dc8e 100644
--- a/lisp/emacs-lisp/ert.el
+++ b/lisp/emacs-lisp/ert.el
@@ -77,6 +77,37 @@ ert-batch-backtrace-right-margin
 Use nil for no limit (caution: backtrace lines can be very long)."
   :type '(choice (const :tag "No truncation" nil) integer))
 
+(defvar ert-batch-print-length 10
+  "`print-length' setting used in `ert-run-tests-batch'.
+
+When formatting lists in test conditions, `print-length' will be
+temporarily set to this value.  See also
+`ert-batch-backtrace-line-length' for its effect on stack
+traces.")
+
+(defvar ert-batch-print-level 5
+  "`print-level' setting used in `ert-run-tests-batch'.
+
+When formatting lists in test conditions, `print-level' will be
+temporarily set to this value.  See also
+`ert-batch-backtrace-line-length' for its effect on stack
+traces.")
+
+(defvar ert-batch-backtrace-line-length t
+  "Target length for lines in ERT batch backtraces.
+
+Even modest settings for `print-length' and `print-level' can
+produce extremely long lines in backtraces and lengthy delays in
+forming them.  This variable governs the target maximum line
+length by manipulating these two variables while printing stack
+traces.  Setting this variable to t will re-use the value of
+`backtrace-line-length' while print stack traces in ERT batch
+mode.  A value of nil will short-circuit this mechanism; line
+lengths will be completely determined by `ert-batch-line-length'
+and `ert-batch-line-level'.  Any other value will be temporarily
+bound to `backtrace-line-length' when producing stack traces
+in batch mode.")
+
 (defface ert-test-result-expected '((((class color) (background light))
                                      :background "green1")
                                     (((class color) (background dark))
@@ -1402,8 +1433,7 @@ ert-run-tests-batch
                                       (ert-reason-for-test-result result)
                                     ""))))
               (message "%s" "")))))
-       (test-started
-        )
+       (test-started)
        (test-ended
         (cl-destructuring-bind (stats test result) event-args
           (unless (ert-test-result-expected-p test result)
@@ -1413,8 +1443,18 @@ ert-run-tests-batch
               (ert-test-result-with-condition
                (message "Test %S backtrace:" (ert-test-name test))
                (with-temp-buffer
-                 (insert (backtrace-to-string
-                          (ert-test-result-with-condition-backtrace result)))
+                 (let ((backtrace-line-length
+                        (cond
+                         ((eq ert-batch-backtrace-line-length t)
+                          backtrace-line-length)
+                         ((eq ert-batch-backtrace-line-length nil)
+                          nil)
+                         (t
+                          ert-batch-backtrace-line-length)))
+                       (print-level ert-batch-print-level)
+                       (print-length ert-batch-print-length))
+                   (insert (backtrace-to-string
+                            (ert-test-result-with-condition-backtrace result))))
                  (if (not ert-batch-backtrace-right-margin)
                      (message "%s"
                               (buffer-substring-no-properties (point-min)
@@ -1433,8 +1473,8 @@ ert-run-tests-batch
                  (ert--insert-infos result)
                  (insert "    ")
                  (let ((print-escape-newlines t)
-                       (print-level 5)
-                       (print-length 10))
+                       (print-level ert-batch-print-level)
+                       (print-length ert-batch-print-length))
                    (ert--pp-with-indentation-and-newline
                     (ert-test-result-with-condition-condition result)))
                  (goto-char (1- (point-max)))
@@ -1962,13 +2002,13 @@ ert--results-font-lock-function
   (ewoc-refresh ert--results-ewoc)
   (font-lock-default-function enabledp))
 
-(defun ert--setup-results-buffer (stats listener buffer-name)
+(defvar ert--output-buffer-name "*ert*")
+
+(defun ert--setup-results-buffer (stats listener)
   "Set up a test results buffer.
 
-STATS is the stats object; LISTENER is the results listener;
-BUFFER-NAME, if non-nil, is the buffer name to use."
-  (unless buffer-name (setq buffer-name "*ert*"))
-  (let ((buffer (get-buffer-create buffer-name)))
+STATS is the stats object; LISTENER is the results listener."
+  (let ((buffer (get-buffer-create ert--output-buffer-name)))
     (with-current-buffer buffer
       (let ((inhibit-read-only t))
         (buffer-disable-undo)
@@ -2000,18 +2040,11 @@ ert--setup-results-buffer
 (defvar ert--selector-history nil
   "List of recent test selectors read from terminal.")
 
-;; 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)
+(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'.
-OUTPUT-BUFFER-NAME and MESSAGE-FN should normally be nil; they
-are used for automated self-tests and specify which buffer to use
-and how to display message."
+SELECTOR works as described in `ert-select-tests'."
   (interactive
    (list (let ((default (if ert--selector-history
                             ;; Can't use `first' here as this form is
@@ -2024,23 +2057,17 @@ ert-run-tests-interactively
                              obarray #'ert-test-boundp nil nil
                              'ert--selector-history default nil)))
          nil))
-  (unless message-fn (setq message-fn 'message))
-  (let ((output-buffer-name output-buffer-name)
-        buffer
-        listener
-        (message-fn message-fn))
+  (let (buffer listener)
     (setq listener
           (lambda (event-type &rest event-args)
             (cl-ecase event-type
               (run-started
                (cl-destructuring-bind (stats) event-args
-                 (setq buffer (ert--setup-results-buffer stats
-                                                         listener
-                                                         output-buffer-name))
+                 (setq buffer (ert--setup-results-buffer stats listener))
                  (pop-to-buffer buffer)))
               (run-ended
                (cl-destructuring-bind (stats abortedp) event-args
-                 (funcall message-fn
+                 (message
                           "%sRan %s tests, %s results were as expected%s%s"
                           (if (not abortedp)
                               ""
@@ -2394,7 +2421,7 @@ ert-results-rerun-all-tests
   (interactive nil ert-results-mode)
   (cl-assert (eql major-mode 'ert-results-mode))
   (let ((selector (ert--stats-selector ert--results-stats)))
-    (ert-run-tests-interactively selector (buffer-name))))
+    (ert-run-tests-interactively selector)))
 
 (defun ert-results-rerun-test-at-point ()
   "Re-run the test at point.
diff --git a/test/lisp/emacs-lisp/ert-tests.el b/test/lisp/emacs-lisp/ert-tests.el
index 79576d24032..1a8c9bf4f08 100644
--- a/test/lisp/emacs-lisp/ert-tests.el
+++ b/test/lisp/emacs-lisp/ert-tests.el
@@ -39,10 +39,11 @@ ert-test-body-runs
 (defun ert-self-test ()
   "Run ERT's self-tests and make sure they actually ran."
   (let ((window-configuration (current-window-configuration)))
-    (let ((ert--test-body-was-run nil))
+    (let ((ert--test-body-was-run nil)
+          (ert--output-buffer-name " *ert self-tests*"))
       ;; The buffer name chosen here should not compete with the default
       ;; results buffer name for completion in `switch-to-buffer'.
-      (let ((stats (ert-run-tests-interactively "^ert-" " *ert self-tests*")))
+      (let ((stats (ert-run-tests-interactively "^ert-")))
         (cl-assert ert--test-body-was-run)
         (if (zerop (ert-stats-completed-unexpected stats))
             ;; Hide results window only when everything went well.
@@ -519,17 +520,18 @@ ert-test-run-tests-interactively
                                      :body (lambda () (ert-skip
                                                        "skip message")))))
     (let ((ert-debug-on-error nil))
-      (let* ((buffer-name (generate-new-buffer-name " *ert-test-run-tests*"))
-             (messages nil)
-             (mock-message-fn
-              (lambda (format-string &rest args)
-                (push (apply #'format format-string args) messages))))
+      (cl-letf* ((buffer-name (generate-new-buffer-name
+                               " *ert-test-run-tests*"))
+                 (ert--output-buffer-name buffer-name)
+                 (messages nil)
+                 ((symbol-function 'message)
+                  (lambda (format-string &rest args)
+                    (push (apply #'format format-string args) messages))))
         (save-window-excursion
           (unwind-protect
               (let ((case-fold-search nil))
                 (ert-run-tests-interactively
-                 `(member ,passing-test ,failing-test, skipped-test) buffer-name
-                 mock-message-fn)
+                 `(member ,passing-test ,failing-test, skipped-test))
                 (should (equal messages `(,(concat
                                             "Ran 3 tests, 1 results were "
                                             "as expected, 1 unexpected, "
@@ -551,6 +553,68 @@ ert-test-run-tests-interactively
             (when (get-buffer buffer-name)
               (kill-buffer buffer-name))))))))
 
+(ert-deftest ert-test-run-tests-batch ()
+  (let* ((complex-list '((:1 (:2 (:3 (:4 (:5 (:6 "abc"))))))))
+	 (long-list (make-list 11 1))
+	 (failing-test-1
+          (make-ert-test :name 'failing-test-1
+			 :body (lambda () (should (equal complex-list 1)))))
+	 (failing-test-2
+          (make-ert-test :name 'failing-test-2
+			 :body (lambda () (should (equal long-list 1))))))
+    (let ((ert-debug-on-error nil)
+          messages)
+      (cl-letf* (((symbol-function 'message)
+                  (lambda (format-string &rest args)
+                    (push (apply #'format format-string args) messages))))
+        (save-window-excursion
+          (unwind-protect
+              (let ((case-fold-search nil)
+                    (ert-batch-backtrace-right-margin nil)
+		    (ert-batch-print-level 10)
+		    (ert-batch-print-length 11))
+                (ert-run-tests-batch
+                 `(member ,failing-test-1 ,failing-test-2))))))
+      (let ((long-text "(different-types[ \t\n]+(1 1 1 1 1 1 1 1 1 1 1)[ \t\n]+1)))[ \t\n]*$")
+	    (complex-text "(different-types[ \t\n]+((:1[ \t\n]+(:2[ \t\n]+(:3[ \t\n]+(:4[ \t\n]+(:5[ \t\n]+(:6[ \t\n]+\"abc\")))))))[ \t\n]+1)))[ \t\n]*$")
+            found-long
+	    found-complex)
+	(cl-loop for msg in (reverse messages)
+		 do
+		 (unless found-long
+		   (setq found-long (string-match long-text msg)))
+		 (unless found-complex
+		   (setq found-complex (string-match complex-text msg))))
+	(should found-long)
+	(should found-complex)))))
+
+(ert-deftest ert-test-run-tests-batch-expensive ()
+  (let* ((complex-list '((:1 (:2 (:3 (:4 (:5 (:6 "abc"))))))))
+	 (failing-test-1
+          (make-ert-test :name 'failing-test-1
+			 :body (lambda () (should (equal complex-list 1))))))
+    (let ((ert-debug-on-error nil)
+          messages)
+      (cl-letf* (((symbol-function 'message)
+                  (lambda (format-string &rest args)
+                    (push (apply #'format format-string args) messages))))
+        (save-window-excursion
+          (unwind-protect
+              (let ((case-fold-search nil)
+                    (ert-batch-backtrace-right-margin nil)
+                    (ert-batch-backtrace-line-length nil)
+		    (ert-batch-print-level 6)
+		    (ert-batch-print-length 11))
+                (ert-run-tests-batch
+                 `(member ,failing-test-1))))))
+      (let ((frame "ert-fail(((should (equal complex-list 1)) :form (equal ((:1 (:2 (:3 (:4 (:5 (:6 \"abc\"))))))) 1) :value nil :explanation (different-types ((:1 (:2 (:3 (:4 (:5 (:6 \"abc\"))))))) 1)))")
+            found-frame)
+	(cl-loop for msg in (reverse messages)
+		 do
+		 (unless found-frame
+		   (setq found-frame (cl-search frame msg :test 'equal))))
+        (should found-frame)))))
+
 (ert-deftest ert-test-special-operator-p ()
   (should (ert--special-operator-p 'if))
   (should-not (ert--special-operator-p 'car))
diff --git a/test/lisp/emacs-lisp/ert-x-tests.el b/test/lisp/emacs-lisp/ert-x-tests.el
index 9baa9941586..7106b7abc0c 100644
--- a/test/lisp/emacs-lisp/ert-x-tests.el
+++ b/test/lisp/emacs-lisp/ert-x-tests.el
@@ -103,23 +103,27 @@ ert-propertized-string
 
 (ert-deftest ert-test-run-tests-interactively-2 ()
   :tags '(:causes-redisplay)
-  (let* ((passing-test (make-ert-test :name 'passing-test
-                                      :body (lambda () (ert-pass))))
-         (failing-test (make-ert-test :name 'failing-test
-                                      :body (lambda ()
-                                              (ert-info ((propertize "foo\nbar"
-                                                                     'a 'b))
-                                                (ert-fail
-                                                 "failure message")))))
-         (skipped-test (make-ert-test :name 'skipped-test
-                                      :body (lambda () (ert-skip
-							"skip message"))))
-         (ert-debug-on-error nil)
-         (buffer-name (generate-new-buffer-name "*ert-test-run-tests*"))
-         (messages nil)
-         (mock-message-fn
-          (lambda (format-string &rest args)
-            (push (apply #'format format-string args) messages))))
+  (cl-letf* ((passing-test (make-ert-test
+                            :name 'passing-test
+                            :body (lambda () (ert-pass))))
+             (failing-test (make-ert-test
+                            :name 'failing-test
+                            :body (lambda ()
+                                    (ert-info ((propertize "foo\nbar"
+                                                           'a 'b))
+                                              (ert-fail
+                                               "failure message")))))
+             (skipped-test (make-ert-test
+                            :name 'skipped-test
+                            :body (lambda () (ert-skip
+					      "skip message"))))
+             (ert-debug-on-error nil)
+             (messages nil)
+             (buffer-name (generate-new-buffer-name "*ert-test-run-tests*"))
+             ((symbol-function 'message)
+              (lambda (format-string &rest args)
+                (push (apply #'format format-string args) messages)))
+             (ert--output-buffer-name buffer-name))
     (cl-flet ((expected-string (with-font-lock-p)
                 (ert-propertized-string
                  "Selector: (member <passing-test> <failing-test> "
@@ -152,14 +156,12 @@ ert-test-run-tests-interactively-2
                  "failing-test"
                  nil "\n    Info: " '(a b) "foo\n"
                  nil "          " '(a b) "bar"
-                 nil "\n    (ert-test-failed \"failure message\")\n\n\n"
-                 )))
+                 nil "\n    (ert-test-failed \"failure message\")\n\n\n")))
       (save-window-excursion
         (unwind-protect
             (let ((case-fold-search nil))
               (ert-run-tests-interactively
-               `(member ,passing-test ,failing-test ,skipped-test) buffer-name
-               mock-message-fn)
+               `(member ,passing-test ,failing-test ,skipped-test))
               (should (equal messages `(,(concat
                                           "Ran 3 tests, 1 results were "
                                           "as expected, 1 unexpected, "
-- 
2.33.1


--=-=-=
Content-Type: text/plain; format=flowed


-- 
Michael <sp1ff@HIDDEN>

--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51037; Package emacs. Full text available.

Message received at 51037 <at> debbugs.gnu.org:


Received: (at 51037) by debbugs.gnu.org; 15 Nov 2021 23:12:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 15 18:12:22 2021
Received: from localhost ([127.0.0.1]:56511 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mml9B-0004vj-K8
	for submit <at> debbugs.gnu.org; Mon, 15 Nov 2021 18:12:21 -0500
Received: from transit01.runbox.com ([91.220.196.211]:46714)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <sp1ff@HIDDEN>) id 1mml96-0004vP-8V
 for 51037 <at> debbugs.gnu.org; Mon, 15 Nov 2021 18:12:19 -0500
Received: from aibo.runbox.com ([185.226.149.25])
 by transit01.runbox.com with esmtps (TLS1.2) tls
 TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93)
 (envelope-from <sp1ff@HIDDEN>)
 id 1mml8y-00AJ5U-GT; Tue, 16 Nov 2021 00:12:08 +0100
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=runbox.com; 
 s=selector1;
 h=Content-Type:MIME-Version:Message-ID:Date:In-reply-to:Subject
 :Cc:To:From:References; bh=4ihKTHCGFF6igsF/FJxKuKlxY4HnFpJys/1El998aro=; b=Kh
 aPAcXGph1P99x8pDZE/6Upp078gCC46jSswDsbh0GhTEVgFblRiawcLok/FlE4NrXPIB/yuuBycxs
 tsdjIK/h0chjnu0Mews/2qcqmeOa8dSH9lLNo7csO7VGFPYBgzB9LIJgiV84ePSEEOLLdcdfVhqyb
 HnbHsiIgm4Ez46LTAN95evXrIzprb78cnm0I3feuqB+A1o3p9gDPysQU5lU/YIRNrLBI0WzdATPl0
 7PZQ3YLo4KuR1QPoOHRpqDNPAiV8UL40gB3PzZ71C2Q4Mi7n8jtZyuilYPm0oWLxXWbVvPH8BCzqU
 0yfKvdRec3NEgIZHg6lc1FzySrbuSPjg==;
Received: from [10.9.9.74] (helo=submission03.runbox)
 by mailtransmit03.runbox with esmtp (Exim 4.86_2)
 (envelope-from <sp1ff@HIDDEN>)
 id 1mml8x-0004zR-JP; Tue, 16 Nov 2021 00:12:07 +0100
Received: by submission03.runbox with esmtpsa [Authenticated ID (942723)]
 (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1)
 id 1mml8o-0000jG-Hx; Tue, 16 Nov 2021 00:11:58 +0100
References: <86tuhvmtpl.fsf@HIDDEN> <877deqec10.fsf@HIDDEN>
 <83fste2u4i.fsf@HIDDEN> <87ily94662.fsf@HIDDEN>
 <83fstd1bth.fsf@HIDDEN> <87czogslm4.fsf@HIDDEN>
 <86ily2mjtq.fsf@HIDDEN> <87r1cp89o4.fsf@HIDDEN>
 <86fst5m48v.fsf@HIDDEN> <87a6jd5891.fsf@HIDDEN>
 <86mtmykxro.fsf@HIDDEN> <87y26hz24c.fsf@HIDDEN>
 <86bl3blcgm.fsf@HIDDEN> <87wnlya9sj.fsf@HIDDEN>
 <86wnlbmooj.fsf@HIDDEN> <83bl2nw723.fsf@HIDDEN>
 <86tugen3q4.fsf@HIDDEN> <83lf1qtxzw.fsf@HIDDEN>
User-agent: mu4e 1.4.15; emacs 28.0.50
From: Michael <sp1ff@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#51037: [PATCH] Make `print-level` & `print-length`
 customizable in ERT batch tests
In-reply-to: <83lf1qtxzw.fsf@HIDDEN>
Date: Mon, 15 Nov 2021 15:11:54 -0800
Message-ID: <864k8dm2th.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; format=flowed
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 51037
Cc: gazally@HIDDEN, larsi@HIDDEN, 51037 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)


Eli Zaretskii <eliz@HIDDEN> writes:

>> From: Michael <sp1ff@HIDDEN>
>> Cc: larsi@HIDDEN, gazally@HIDDEN, 51037 <at> debbugs.gnu.org
>> Date: Sun, 14 Nov 2021 07:42:27 -0800
>> 
>> This commit introduces three new ert variables:
>> ert-batch-print-length, ert-batch-print-level &
>> ert-batch-backtrace-length. The first two control print-length
>                             ^^
> Please leave 2 spaces between sentences, per our coding 
> conventions
> (here and elsewhere in your patch).

Fixed.

>> +line lengths (i.e. to get full backtraces), or a positive 
>> integer to
>
> Either "i.e.," (with a comma), or "i.e.@:".  Otherwise TeX will
> typeset "i.e." as if it ends a sentence.

Fixed.

>> +** New ERT batch variables
>> +
>> +Add three variables 'ert-batch-print-length', 
>> 'ert-batch-print-level'
>
> In NEWS we use a different style, like this:
>
>   Three new variables 'ert-batch-print-length', ...
>
> IOW, "Add" is not appropriate here.

Kindly fixed already by Lars.

>>  Backtrace mode will attempt to abbreviate printing of 
>>  backtrace
>> -frames to make them shorter than this, but success is not
>> -guaranteed.  If set to nil or zero, Backtrace mode will not
>> -abbreviate the forms it prints."
>> +frames by setting `print-level' & `print-length' to make them
>
> Please don't use "&" in doc strings; use "and" instead (here and
> elsewhere in the patch).

Fixed.

>> +shorter than this, but success is not guaranteed.  If set to 
>> nil
>> +or zero, Backtrace mode will not abbreviate the forms it 
>> prints."
>             ^^^^^^^^^
> "backtrace", not capitalized/

Oh! Good catch -- fixed.

>> -(defun ert--setup-results-buffer (stats listener buffer-name)
>> +(defvar ert--output-buffer-name "*ert*")
>> +
>> +(defun ert--setup-results-buffer (stats listener)
>>    "Set up a test results buffer.
>>  
>> -STATS is the stats object; LISTENER is the results listener;
>> -BUFFER-NAME, if non-nil, is the buffer name to use."
>> -  (unless buffer-name (setq buffer-name "*ert*"))
>> -  (let ((buffer (get-buffer-create buffer-name)))
>> +STATS is the stats object; LISTENER is the results listener."
>> +  (let ((buffer (get-buffer-create ert--output-buffer-name)))
>
> Why this change in the signature of the function?

A consequence of a decision discussed elsewhere in this thread:
the only reason that parameter existed was to enable unit
testing, which I re-wrote to use `cl-letf`.

Background: prior to this patch, `ert-run-tests-interactively`
accepted two optional parameters: output-buffer-name and
message-fn. The were soley used for the purpose of unit testing,
and were even documented in commentary as such:

;; 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?

I carried over the idiom to ert-run-tests-batch when adding my
own unit tests. Lars pointed out that I could use `cl-letf` to
override the function definition of `message`, rather than using
a "test-only" parameter. I did that, then removed the test-only
parameters from `ert-run-tests-interactively` an re-wrote those
unit tests to also use `cl-letf`. At that point, there was no one
using the the `buffer-name` parameter to
`ert--setup-results-buffer`. Since it's an internal function, I
felt comfortable just removing the parameter.

-- 
Michael <sp1ff@HIDDEN>




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51037; Package emacs. Full text available.

Message received at 51037 <at> debbugs.gnu.org:


Received: (at 51037) by debbugs.gnu.org; 14 Nov 2021 18:04:41 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Nov 14 13:04:41 2021
Received: from localhost ([127.0.0.1]:51594 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mmJrs-000109-Ra
	for submit <at> debbugs.gnu.org; Sun, 14 Nov 2021 13:04:41 -0500
Received: from eggs.gnu.org ([209.51.188.92]:52056)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1mmJrr-0000zw-80
 for 51037 <at> debbugs.gnu.org; Sun, 14 Nov 2021 13:04:39 -0500
Received: from [2001:470:142:3::e] (port=60632 helo=fencepost.gnu.org)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1mmJrl-00057G-42; Sun, 14 Nov 2021 13:04:33 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=/TMH0hreR6axAAH0AN9UTwVr8XTXue2UMn3R/f70UVA=; b=knsGPn6bfFtl
 zk+iKbwv0mmRt+/opV9nawZIvV52oReR20071F9U0Voj10ZCLrE5RKHDL3AIk/cBR1sxSt+EGODK6
 NzJTbNZbngbkXaP5ZUu9+gWvJZuleR5fXMVFt2EsINy2JXL7vCz6kGRGTO5uxji44vcoElYgBQZ1B
 PJp9Gtxmry41Dt5zIKKjtIDeM+XNxqR0SWcW0+eGG4zCDQkiV3Q90e7OyIw1f+A1RnWurp+nvlAw3
 USUdc8R57296tscnG5eJGXP7jjWdxabULrJSqW8VC9KPv9Xn760iN+ZmKoR9aAWGiwLGu9qWzGqRc
 UGlIStn7EpKbRZa71BrgHQ==;
Received: from [87.69.77.57] (port=4986 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1mmJrk-0005Ml-O8; Sun, 14 Nov 2021 13:04:33 -0500
Date: Sun, 14 Nov 2021 20:04:19 +0200
Message-Id: <83lf1qtxzw.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Michael <sp1ff@HIDDEN>
In-Reply-To: <86tugen3q4.fsf@HIDDEN> (message from Michael on Sun, 14 Nov
 2021 07:42:27 -0800)
Subject: Re: bug#51037: [PATCH] Make `print-level` & `print-length`
 customizable in ERT batch tests
References: <86tuhvmtpl.fsf@HIDDEN> <877deqec10.fsf@HIDDEN>
 <83fste2u4i.fsf@HIDDEN> <87ily94662.fsf@HIDDEN>
 <83fstd1bth.fsf@HIDDEN> <87czogslm4.fsf@HIDDEN>
 <86ily2mjtq.fsf@HIDDEN> <87r1cp89o4.fsf@HIDDEN>
 <86fst5m48v.fsf@HIDDEN> <87a6jd5891.fsf@HIDDEN>
 <86mtmykxro.fsf@HIDDEN> <87y26hz24c.fsf@HIDDEN>
 <86bl3blcgm.fsf@HIDDEN> <87wnlya9sj.fsf@HIDDEN>
 <86wnlbmooj.fsf@HIDDEN> <83bl2nw723.fsf@HIDDEN>
 <86tugen3q4.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 51037
Cc: gazally@HIDDEN, larsi@HIDDEN, 51037 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Michael <sp1ff@HIDDEN>
> Cc: larsi@HIDDEN, gazally@HIDDEN, 51037 <at> debbugs.gnu.org
> Date: Sun, 14 Nov 2021 07:42:27 -0800
> 
> This commit introduces three new ert variables:
> ert-batch-print-length, ert-batch-print-level &
> ert-batch-backtrace-length. The first two control print-length
                            ^^
Please leave 2 spaces between sentences, per our coding conventions
(here and elsewhere in your patch).

> +line lengths (i.e. to get full backtraces), or a positive integer to

Either "i.e.," (with a comma), or "i.e.@:".  Otherwise TeX will
typeset "i.e." as if it ends a sentence.

> +** New ERT batch variables
> +
> +Add three variables 'ert-batch-print-length', 'ert-batch-print-level'

In NEWS we use a different style, like this:

  Three new variables 'ert-batch-print-length', ...

IOW, "Add" is not appropriate here.

>  Backtrace mode will attempt to abbreviate printing of backtrace
> -frames to make them shorter than this, but success is not
> -guaranteed.  If set to nil or zero, Backtrace mode will not
> -abbreviate the forms it prints."
> +frames by setting `print-level' & `print-length' to make them

Please don't use "&" in doc strings; use "and" instead (here and
elsewhere in the patch).

> +shorter than this, but success is not guaranteed.  If set to nil
> +or zero, Backtrace mode will not abbreviate the forms it prints."
            ^^^^^^^^^
"backtrace", not capitalized/

> -(defun ert--setup-results-buffer (stats listener buffer-name)
> +(defvar ert--output-buffer-name "*ert*")
> +
> +(defun ert--setup-results-buffer (stats listener)
>    "Set up a test results buffer.
>  
> -STATS is the stats object; LISTENER is the results listener;
> -BUFFER-NAME, if non-nil, is the buffer name to use."
> -  (unless buffer-name (setq buffer-name "*ert*"))
> -  (let ((buffer (get-buffer-create buffer-name)))
> +STATS is the stats object; LISTENER is the results listener."
> +  (let ((buffer (get-buffer-create ert--output-buffer-name)))

Why this change in the signature of the function?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51037; Package emacs. Full text available.

Message received at 51037 <at> debbugs.gnu.org:


Received: (at 51037) by debbugs.gnu.org; 14 Nov 2021 17:50:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Nov 14 12:50:27 2021
Received: from localhost ([127.0.0.1]:51566 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mmJe7-0000c5-Jp
	for submit <at> debbugs.gnu.org; Sun, 14 Nov 2021 12:50:27 -0500
Received: from quimby.gnus.org ([95.216.78.240]:34722)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1mmJe5-0000bs-A9
 for 51037 <at> debbugs.gnu.org; Sun, 14 Nov 2021 12:50:25 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=pBqpsVYH+zvYGnO1IV0qbJQZJEI7kMUDzled5HpnW8w=; b=CWBvCHedW5tlLROstHHx8ERdY7
 QdKWKFgJREKZkfHxYen4cvHEKSmPHZHfq0DsXaPXftV1gSlvlVAu63TwYLPMw7eIZdciAg/197Oze
 WQslEj16gurWJX2oHqRqlMVBabZtbVGN5bXOdz8Gjk8Utl45HuNDuvn6ZURJdCueCZ+M=;
Received: from [84.212.220.105] (helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1mmJdx-0005ky-Ky; Sun, 14 Nov 2021 18:50:19 +0100
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Michael <sp1ff@HIDDEN>
Subject: Re: bug#51037: [PATCH] Make `print-level` & `print-length`
 customizable in ERT batch tests
References: <86tuhvmtpl.fsf@HIDDEN> <877deqec10.fsf@HIDDEN>
 <83fste2u4i.fsf@HIDDEN> <87ily94662.fsf@HIDDEN>
 <83fstd1bth.fsf@HIDDEN> <87czogslm4.fsf@HIDDEN>
 <86ily2mjtq.fsf@HIDDEN> <87r1cp89o4.fsf@HIDDEN>
 <86fst5m48v.fsf@HIDDEN> <87a6jd5891.fsf@HIDDEN>
 <86mtmykxro.fsf@HIDDEN> <87y26hz24c.fsf@HIDDEN>
 <86bl3blcgm.fsf@HIDDEN> <87wnlya9sj.fsf@HIDDEN>
 <86wnlbmooj.fsf@HIDDEN> <87fsry7qdy.fsf@HIDDEN>
 <87bl2m7q9g.fsf@HIDDEN> <86ilwumy0e.fsf@HIDDEN>
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj
 SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAD1BMVEXu3QKgkgFcVAGF
 egH///9tNUTkAAAAAWJLR0QEj2jZUQAAAAd0SU1FB+ULDhEtCsBJHAUAAAGjSURBVDjLrZTblSMx
 CEQlO4FGJLCIBCzIP7ep0qPds9+jY//omgIK5FL+8DTJ6N/zr4xSPxOk5wPYazSLBe4zQcXHFhjz
 VhYDkLBKoCKKex7NsEuijxkx5D4T9O4T6ONeFComV3mAFceIhgpWHzzNVkyzGpkPqWREOAtyWVoL
 BCKiz8iM7PWWYrl9gqu80w4IBnQCtcout4moSYXlE8gIWV5B26dQzghI+ZFKyvRhLSnVfUnRKsW9
 qri40nZpB2AEJpH46lSpu3MEoKxAf5L2puwGGC2bjm4EbHUlZ4YY0thI2oVxfXZVyBypnOyAu2dL
 lFIRKYMAbvRxm9g6fi9GF3POw49XQwjofNL2s3BwpIdMoASxIxBKdiIu7T5zNPwgPeKWgpt74YKb
 8MixZ96SbsHAIwUfbpDqN6h21QW8DW0Abjp318NXDnSMCNhIkPa6pKyqBk1yzm31ccxqbLs7LeYO
 rXlsSwYfmzoeygDA/N5ndyGtGBNSixUvbc5XZXyfAaRe2Mb2/8MhKP1T1179AvmdYMvfEVN5Apj7
 APgD2ODPzg8tvl9S/uy48AAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAyMS0xMS0xNFQxNzo0NToxMCsw
 MDowMICAYZ4AAAAldEVYdGRhdGU6bW9kaWZ5ADIwMjEtMTEtMTRUMTc6NDU6MTArMDA6MDDx3dki
 AAAAAElFTkSuQmCC
X-Now-Playing: Snapped Ankles's _Come Play The Trees_: "Jonny Guitar Calling
 Gosta Berlin"
Date: Sun, 14 Nov 2021 18:50:14 +0100
In-Reply-To: <86ilwumy0e.fsf@HIDDEN> (Michael's message of "Sun, 14 Nov
 2021 09:45:53 -0800")
Message-ID: <87h7ce62zt.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: Michael <sp1ff@HIDDEN> writes: > Right-- this is my first
 contribution. What's the first step on > getting that setup? Here's the form
 to get started: 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 51037
Cc: gazally@HIDDEN, 51037 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Michael <sp1ff@HIDDEN> writes:

> Right-- this is my first contribution. What's the first step on
> getting that setup?

Here's the form to get started:

Please email the following information to assign@HIDDEN, and we
will send you the assignment form for your past and future changes.

Please use your full legal name (in ASCII characters) as the subject
line of the message.
----------------------------------------------------------------------
REQUEST: SEND FORM FOR PAST AND FUTURE CHANGES

[What is the name of the program or package you're contributing to?]
Emacs

[Did you copy any files or text written by someone else in these changes?
Even if that material is free software, we need to know about it.]

[Do you have an employer who might have a basis to claim to own
your changes?  Do you attend a school which might make such a claim?]

[For the copyright registration, what country are you a citizen of?]

[What year were you born?]

[Please write your email address here.]

[Please write your postal address here.]

[Which files have you changed so far, and which new files have you written
so far?]




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51037; Package emacs. Full text available.

Message received at 51037 <at> debbugs.gnu.org:


Received: (at 51037) by debbugs.gnu.org; 14 Nov 2021 17:46:17 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Nov 14 12:46:17 2021
Received: from localhost ([127.0.0.1]:51548 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mmJa5-0000TE-AZ
	for submit <at> debbugs.gnu.org; Sun, 14 Nov 2021 12:46:17 -0500
Received: from transit01.runbox.com ([91.220.196.211]:33012)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <sp1ff@HIDDEN>) id 1mmJa2-0000T1-VV
 for 51037 <at> debbugs.gnu.org; Sun, 14 Nov 2021 12:46:16 -0500
Received: from aibo.runbox.com ([185.226.149.25])
 by transit01.runbox.com with esmtps (TLS1.2) tls
 TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93)
 (envelope-from <sp1ff@HIDDEN>)
 id 1mmJZw-007DmG-BG; Sun, 14 Nov 2021 18:46:08 +0100
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=runbox.com; 
 s=selector1;
 h=Content-Type:MIME-Version:Message-ID:Date:In-reply-to:Subject
 :Cc:To:From:References; bh=jbq58zHLEu49TNtHPfNnYwOaXb1ls6a5dDohpkgOiRU=; b=Pl
 zWHuk7NANoB7wWOVsMHwGgnOr8YobEqWMZnl/SQ6UX8lIQSrgrtJBfKjFKAZZdSt8b65aOUb14p1/
 8KBd7GCmZOMc20RITDCgoz93uarRo4vlI3wFb9Y3I/HgKKSejiuxDVfGrdpqjmbJdGSuDn4oVbkYJ
 kHLtUJvx5xgcFj5II6YT+KeWjFTcuY8WB08n8N6dtD1v+tfisfGKq+mhF+oS3nBwtH9yEHMs0a4k+
 t9eFnN5JH5DuGib24wD7mtrFaBB1dZv7kdPFmIFhmzX2zQqBtq8zQpzwkIThxFT3g5qRddRSKE4KA
 Ybeb/KyC9oXSQpoOoFe6vZMETIf2x8KA==;
Received: from [10.9.9.72] (helo=submission01.runbox)
 by mailtransmit02.runbox with esmtp (Exim 4.86_2)
 (envelope-from <sp1ff@HIDDEN>)
 id 1mmJZu-0006EU-BH; Sun, 14 Nov 2021 18:46:06 +0100
Received: by submission01.runbox with esmtpsa [Authenticated ID (942723)]
 (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1)
 id 1mmJZq-0004e9-KW; Sun, 14 Nov 2021 18:46:02 +0100
References: <86tuhvmtpl.fsf@HIDDEN> <877deqec10.fsf@HIDDEN>
 <83fste2u4i.fsf@HIDDEN> <87ily94662.fsf@HIDDEN>
 <83fstd1bth.fsf@HIDDEN> <87czogslm4.fsf@HIDDEN>
 <86ily2mjtq.fsf@HIDDEN> <87r1cp89o4.fsf@HIDDEN>
 <86fst5m48v.fsf@HIDDEN> <87a6jd5891.fsf@HIDDEN>
 <86mtmykxro.fsf@HIDDEN> <87y26hz24c.fsf@HIDDEN>
 <86bl3blcgm.fsf@HIDDEN> <87wnlya9sj.fsf@HIDDEN>
 <86wnlbmooj.fsf@HIDDEN> <87fsry7qdy.fsf@HIDDEN>
 <87bl2m7q9g.fsf@HIDDEN>
User-agent: mu4e 1.4.15; emacs 28.0.50
From: Michael <sp1ff@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
Subject: Re: bug#51037: [PATCH] Make `print-level` & `print-length`
 customizable in ERT batch tests
In-reply-to: <87bl2m7q9g.fsf@HIDDEN>
Date: Sun, 14 Nov 2021 09:45:53 -0800
Message-ID: <86ilwumy0e.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; format=flowed
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 51037
Cc: gazally@HIDDEN, 51037 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)


Lars Ingebrigtsen <larsi@HIDDEN> writes:

> I spoke to soon -- we don't seem to have copyright assignment 
> papers on
> file?  Is that in the process of happening?

Right-- this is my first contribution. What's the first step on
getting that setup?

-- 
Michael <sp1ff@HIDDEN>




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51037; Package emacs. Full text available.

Message received at 51037 <at> debbugs.gnu.org:


Received: (at 51037) by debbugs.gnu.org; 14 Nov 2021 15:42:58 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Nov 14 10:42:58 2021
Received: from localhost ([127.0.0.1]:51379 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mmHej-0003Pj-Jp
	for submit <at> debbugs.gnu.org; Sun, 14 Nov 2021 10:42:58 -0500
Received: from transit01.runbox.com ([91.220.196.211]:54248)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <sp1ff@HIDDEN>) id 1mmHeg-0003PS-G5
 for 51037 <at> debbugs.gnu.org; Sun, 14 Nov 2021 10:42:56 -0500
Received: from aibo.runbox.com ([185.226.149.25])
 by transit01.runbox.com with esmtps (TLS1.2) tls
 TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93)
 (envelope-from <sp1ff@HIDDEN>)
 id 1mmHeZ-0071cF-1j; Sun, 14 Nov 2021 16:42:47 +0100
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=runbox.com; 
 s=selector1;
 h=Content-Type:MIME-Version:Message-ID:Date:In-reply-to:Subject
 :Cc:To:From:References; bh=KVHLty3RYt2UUAAF59pXY/rAekLICPkWnAMKI/O0Ypo=; b=gi
 JLdd2hZFOoTag4ttp1sAFTYDH2XO1BxYKzM/quEHcv7oNl+y96FkCrlVbTq28oQEvrDoUP55t2jTc
 N0X96lUdESfQQH5Vnkw2PqYdaMYBrS2PB6DT4TNjOffbQEcn7gfRP2AoISdXmthXyQBaUiWreqldk
 i/bgB2e5UJ998FSTQTtlu7nEknVaSOYRVuvX24PWKM2t9hhU/K+LO4S5zzUPDhHa5dVQwb2sO5SQB
 VfaWGxI5c+/Y+wiXS/7CVZJz+uDqgyUSwr7KTG+lBRnQpPVlyUUTI5SjTxe6XOEgvkSO/dXCXATHQ
 QsetZ/syJSBI/5k85691YmQn/azMYyEQ==;
Received: from [10.9.9.72] (helo=submission01.runbox)
 by mailtransmit02.runbox with esmtp (Exim 4.86_2)
 (envelope-from <sp1ff@HIDDEN>)
 id 1mmHeX-0004nG-9r; Sun, 14 Nov 2021 16:42:45 +0100
Received: by submission01.runbox with esmtpsa [Authenticated ID (942723)]
 (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1)
 id 1mmHeJ-0001Mt-HW; Sun, 14 Nov 2021 16:42:32 +0100
References: <86tuhvmtpl.fsf@HIDDEN> <877deqec10.fsf@HIDDEN>
 <83fste2u4i.fsf@HIDDEN> <87ily94662.fsf@HIDDEN>
 <83fstd1bth.fsf@HIDDEN> <87czogslm4.fsf@HIDDEN>
 <86ily2mjtq.fsf@HIDDEN> <87r1cp89o4.fsf@HIDDEN>
 <86fst5m48v.fsf@HIDDEN> <87a6jd5891.fsf@HIDDEN>
 <86mtmykxro.fsf@HIDDEN> <87y26hz24c.fsf@HIDDEN>
 <86bl3blcgm.fsf@HIDDEN> <87wnlya9sj.fsf@HIDDEN>
 <86wnlbmooj.fsf@HIDDEN> <83bl2nw723.fsf@HIDDEN>
User-agent: mu4e 1.4.15; emacs 28.0.50
From: Michael <sp1ff@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#51037: [PATCH] Make `print-level` & `print-length`
 customizable in ERT batch tests
In-reply-to: <83bl2nw723.fsf@HIDDEN>
Date: Sun, 14 Nov 2021 07:42:27 -0800
Message-ID: <86tugen3q4.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 51037
Cc: gazally@HIDDEN, larsi@HIDDEN, 51037 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

--=-=-=
Content-Type: text/plain; format=flowed


>> From: Michael <sp1ff@HIDDEN>
>> Date: Sat, 13 Nov 2021 18:55:08 -0800
>> Cc: gazally@HIDDEN, 51037 <at> debbugs.gnu.org
>> 
>> OK-- here's the revised patch.
>
> Thanks.
>
> The patch includes some remnant of a merge conflict:
>
>> ++++
>> +** New ERT batch variables 'ert-batch-print-length' & 
>> 'ert-batch-print-level'
>> +These variables will override 'print-length' & 'print-level' 
>> when
>> +printing Lisp values in ERT batch test results.
>> +
>> +** Emacs now supports Unicode Standard version 14.0.
>> +>>>>>>> 129b2425c79 (Make print-length & print-level in 
>> ert-run-tests-batch configurable)
>
> Also, please try to keep the lines in the log message shorter 
> than 65
> characters.

That's embarassing. Both fixed, and commit message & NEWS entry
tidied up, altogether.


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0001-Make-results-details-in-ert-run-tests-batch-configur.patch
Content-Description: Make `print-level` & `print-length` configurable in ERT batch tests

From 71ba49d5c8822430025e2921d0d4376d9962ae8a Mon Sep 17 00:00:00 2001
From: Michael Herstine <sp1ff@HIDDEN>
Date: Tue, 5 Oct 2021 06:53:02 -0700
Subject: [PATCH] Make results details in ert-run-tests-batch configurable.

This commit introduces three new ert variables:
ert-batch-print-length, ert-batch-print-level &
ert-batch-backtrace-length. The first two control print-length
and print-level, resp., when printing test results.

Since even modest values of print-level & print-length can
produce extremely long lines in backtraces along with
correspondingly long processing times to format them, this commit
also introduces the variable ert-backtrace-line-length which can,
optionally, override backtrace-line-length during ert batch test
stack traces.

Finally, it also removes the optional message-fn & output-buffer
arguments to ert-run-test-interactively (since they were only
used for testing purposes) and re-implements its tests in
terms of cl-letf.

* lisp/emacs-lisp/ert.el (ert-batch-print-length,
ert-batch-print-level,.ert-batch-backtrace-line-length,
ert-batch-test, ert-run-tests-interactively): Added the three
variables, bound them to these settings when formatting batch
test results including backtraces. Removed the optional
parameters output-buffer & message-fn from
ert-run-tests-interactively.
* test/lisp/emacs-lisp/ert-tests.el
(ert-test-run-tests-interactively, ert-test-run-tests-batch): use
cl-letf to capture output, new tests resp.
* test/lisp/ert-x-tests.el (ert-test-run-tests-interactively-2):
Changed to use cl-letf to capture output instead of using
message-fn.
* lisp/emacs-lisp/backtrace.el (backtrace--line-length-or-nil,
backtrace--print-func-and-args): Fixed a bug when setting
backtrace-line-length to nil by adding a new function to check
for that case & having backtrace--print-func-and-args use it.
* doc/misc/ert.texi: document the new variables & their usage
---
 doc/misc/ert.texi                   | 25 +++++++++
 etc/NEWS                            | 11 ++++
 lisp/emacs-lisp/backtrace.el        | 21 +++++---
 lisp/emacs-lisp/ert.el              | 82 +++++++++++++++++++----------
 test/lisp/emacs-lisp/ert-tests.el   | 81 ++++++++++++++++++++++++----
 test/lisp/emacs-lisp/ert-x-tests.el | 41 +++++++--------
 6 files changed, 196 insertions(+), 65 deletions(-)

diff --git a/doc/misc/ert.texi b/doc/misc/ert.texi
index 440c61add8e..522b09dd617 100644
--- a/doc/misc/ert.texi
+++ b/doc/misc/ert.texi
@@ -390,6 +390,31 @@ Running Tests in Batch Mode
 emacs -batch -l ert -f ert-summarize-tests-batch-and-exit output.log
 @end example
 
+@vindex ert-batch-print-level
+@vindex ert-batch-print-length
+ERT attempts to limit the output size for failed tests by choosing
+conservative values for @code{print-level} & @code{print-length}
+when printing Lisp values.  This can in some cases make it difficult
+to see which portions of those values are incorrect.  Use
+@code{ert-batch-print-level} and @code{ert-batch-print-length}
+to customize that:
+
+@example
+emacs -batch -l ert -l my-tests.el \
+      --eval "(let ((ert-batch-print-level 10) \
+                    (ert-batch-print-length 120)) \
+                (ert-run-tests-batch-and-exit))"
+@end example
+
+@vindex ert-batch-backtrace-line-length
+Even modest settings for @code{print-level} & @code{print-length} can
+produce extremely long lines in backtraces, however, with attendant
+pauses in execution progress. Set
+@code{ert-batch-backtrace-line-length} to t to use the value of
+@code{backtrace-line-length}, nil to stop any limitations on backtrace
+line lengths (i.e. to get full backtraces), or a positive integer to
+limit backtrace line length to that number.
+
 @vindex ert-quiet
 By default, ERT in batch mode is quite verbose, printing a line with
 result after each test.  This gives you progress information: how many
diff --git a/etc/NEWS b/etc/NEWS
index 3cad0995ac5..286f01f6864 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -46,6 +46,17 @@ time.
 
 * Changes in Emacs 29.1
 
++++
+** New ERT batch variables
+
+Add three variables 'ert-batch-print-length', 'ert-batch-print-level'
+& 'ert-batch-backtrace-line-length'.  The first two will override
+'print-length' & 'print-level' when printing Lisp values in ERT
+batch test results.  The third controls line length when
+printing stack traces.
+
+** Emacs now supports Unicode Standard version 14.0.
+
 ** Emoji
 
 +++
diff --git a/lisp/emacs-lisp/backtrace.el b/lisp/emacs-lisp/backtrace.el
index a5721aa3193..90201442f08 100644
--- a/lisp/emacs-lisp/backtrace.el
+++ b/lisp/emacs-lisp/backtrace.el
@@ -55,9 +55,9 @@ backtrace-fontify
 (defcustom backtrace-line-length 5000
   "Target length for lines in Backtrace buffers.
 Backtrace mode will attempt to abbreviate printing of backtrace
-frames to make them shorter than this, but success is not
-guaranteed.  If set to nil or zero, Backtrace mode will not
-abbreviate the forms it prints."
+frames by setting `print-level' & `print-length' to make them
+shorter than this, but success is not guaranteed.  If set to nil
+or zero, Backtrace mode will not abbreviate the forms it prints."
   :type 'integer
   :group 'backtrace
   :version "27.1")
@@ -751,6 +751,13 @@ backtrace--print-flags
     (insert (make-string (- backtrace--flags-width (- (point) beg)) ?\s))
     (put-text-property beg (point) 'backtrace-section 'func)))
 
+(defun backtrace--line-length-or-nil ()
+  "Return `backtrace-line-length' if valid, nil else."
+  ;; mirror the logic in `cl-print-to-string-with-limits'
+  (and (natnump backtrace-line-length)
+       (not (zerop backtrace-line-length))
+       backtrace-line-length))
+
 (defun backtrace--print-func-and-args (frame _view)
   "Print the function, arguments and buffer position of a backtrace FRAME.
 Format it according to VIEW."
@@ -769,11 +776,13 @@ backtrace--print-func-and-args
       (if (atom fun)
           (funcall backtrace-print-function fun)
         (insert
-         (backtrace--print-to-string fun (when args (/ backtrace-line-length 2)))))
+         (backtrace--print-to-string fun (when (and args (backtrace--line-length-or-nil)) (/ backtrace-line-length 2)))))
       (if args
           (insert (backtrace--print-to-string
-                   args (max (truncate (/ backtrace-line-length 5))
-                             (- backtrace-line-length (- (point) beg)))))
+                   args
+                   (if (backtrace--line-length-or-nil)
+                       (max (truncate (/ backtrace-line-length 5))
+                            (- backtrace-line-length (- (point) beg))))))
         ;; The backtrace-form property is so that backtrace-multi-line
         ;; will find it.  backtrace-multi-line doesn't do anything
         ;; useful with it, just being consistent.
diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el
index 8ebc81fd418..9659c55cb64 100644
--- a/lisp/emacs-lisp/ert.el
+++ b/lisp/emacs-lisp/ert.el
@@ -77,6 +77,37 @@ ert-batch-backtrace-right-margin
 Use nil for no limit (caution: backtrace lines can be very long)."
   :type '(choice (const :tag "No truncation" nil) integer))
 
+(defvar ert-batch-print-length 10
+  "`print-length' setting used in `ert-run-tests-batch'.
+
+When formatting lists in test conditions, `print-length' will be
+temporarily set to this value.  See also
+`ert-batch-backtrace-line-length' for its effect on stack
+traces.")
+
+(defvar ert-batch-print-level 5
+  "`print-level' setting used in `ert-run-tests-batch'.
+
+When formatting lists in test conditions, `print-level' will be
+temporarily set to this value.  See also
+`ert-batch-backtrace-line-length' for its effect on stack
+traces.")
+
+(defvar ert-batch-backtrace-line-length t
+  "Target length for lines in ERT batch backtraces.
+
+Even modest settings for `print-length' & `print-level' can
+produce extremely long lines in backtraces & lengthy delays in
+forming them.  This variable governs the target maximum line
+length by manipulating these two variables while printing stack
+traces.  Setting this variable to t will re-use the value of
+`backtrace-line-length' while print stack traces in ERT batch
+mode.  A value of nil will short-circuit this mechanism; line
+lengths will be completely determined by `ert-batch-line-length'
+& `ert-batch-line-level'.  Any other value will be temporarily
+bound to `backtrace-line-length' when producing stack traces
+in batch mode.")
+
 (defface ert-test-result-expected '((((class color) (background light))
                                      :background "green1")
                                     (((class color) (background dark))
@@ -1402,8 +1433,7 @@ ert-run-tests-batch
                                       (ert-reason-for-test-result result)
                                     ""))))
               (message "%s" "")))))
-       (test-started
-        )
+       (test-started)
        (test-ended
         (cl-destructuring-bind (stats test result) event-args
           (unless (ert-test-result-expected-p test result)
@@ -1413,8 +1443,15 @@ ert-run-tests-batch
               (ert-test-result-with-condition
                (message "Test %S backtrace:" (ert-test-name test))
                (with-temp-buffer
-                 (insert (backtrace-to-string
-                          (ert-test-result-with-condition-backtrace result)))
+                 (let ((backtrace-line-length
+                        (cond
+                         ((eq ert-batch-backtrace-line-length t) backtrace-line-length)
+                         ((eq ert-batch-backtrace-line-length nil) nil)
+                         (t ert-batch-backtrace-line-length)))
+                       (print-level ert-batch-print-level)
+                       (print-length ert-batch-print-length))
+                   (insert (backtrace-to-string
+                            (ert-test-result-with-condition-backtrace result))))
                  (if (not ert-batch-backtrace-right-margin)
                      (message "%s"
                               (buffer-substring-no-properties (point-min)
@@ -1433,8 +1470,8 @@ ert-run-tests-batch
                  (ert--insert-infos result)
                  (insert "    ")
                  (let ((print-escape-newlines t)
-                       (print-level 5)
-                       (print-length 10))
+                       (print-level ert-batch-print-level)
+                       (print-length ert-batch-print-length))
                    (ert--pp-with-indentation-and-newline
                     (ert-test-result-with-condition-condition result)))
                  (goto-char (1- (point-max)))
@@ -1962,13 +1999,13 @@ ert--results-font-lock-function
   (ewoc-refresh ert--results-ewoc)
   (font-lock-default-function enabledp))
 
-(defun ert--setup-results-buffer (stats listener buffer-name)
+(defvar ert--output-buffer-name "*ert*")
+
+(defun ert--setup-results-buffer (stats listener)
   "Set up a test results buffer.
 
-STATS is the stats object; LISTENER is the results listener;
-BUFFER-NAME, if non-nil, is the buffer name to use."
-  (unless buffer-name (setq buffer-name "*ert*"))
-  (let ((buffer (get-buffer-create buffer-name)))
+STATS is the stats object; LISTENER is the results listener."
+  (let ((buffer (get-buffer-create ert--output-buffer-name)))
     (with-current-buffer buffer
       (let ((inhibit-read-only t))
         (buffer-disable-undo)
@@ -2000,18 +2037,11 @@ ert--setup-results-buffer
 (defvar ert--selector-history nil
   "List of recent test selectors read from terminal.")
 
-;; 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)
+(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'.
-OUTPUT-BUFFER-NAME and MESSAGE-FN should normally be nil; they
-are used for automated self-tests and specify which buffer to use
-and how to display message."
+SELECTOR works as described in `ert-select-tests'."
   (interactive
    (list (let ((default (if ert--selector-history
                             ;; Can't use `first' here as this form is
@@ -2024,23 +2054,17 @@ ert-run-tests-interactively
                              obarray #'ert-test-boundp nil nil
                              'ert--selector-history default nil)))
          nil))
-  (unless message-fn (setq message-fn 'message))
-  (let ((output-buffer-name output-buffer-name)
-        buffer
-        listener
-        (message-fn message-fn))
+  (let (buffer listener)
     (setq listener
           (lambda (event-type &rest event-args)
             (cl-ecase event-type
               (run-started
                (cl-destructuring-bind (stats) event-args
-                 (setq buffer (ert--setup-results-buffer stats
-                                                         listener
-                                                         output-buffer-name))
+                 (setq buffer (ert--setup-results-buffer stats listener))
                  (pop-to-buffer buffer)))
               (run-ended
                (cl-destructuring-bind (stats abortedp) event-args
-                 (funcall message-fn
+                 (message
                           "%sRan %s tests, %s results were as expected%s%s"
                           (if (not abortedp)
                               ""
diff --git a/test/lisp/emacs-lisp/ert-tests.el b/test/lisp/emacs-lisp/ert-tests.el
index 79576d24032..f783532aaff 100644
--- a/test/lisp/emacs-lisp/ert-tests.el
+++ b/test/lisp/emacs-lisp/ert-tests.el
@@ -39,10 +39,11 @@ ert-test-body-runs
 (defun ert-self-test ()
   "Run ERT's self-tests and make sure they actually ran."
   (let ((window-configuration (current-window-configuration)))
-    (let ((ert--test-body-was-run nil))
+    (let ((ert--test-body-was-run nil)
+          (ert--output-buffer-name " *ert self-tests*"))
       ;; The buffer name chosen here should not compete with the default
       ;; results buffer name for completion in `switch-to-buffer'.
-      (let ((stats (ert-run-tests-interactively "^ert-" " *ert self-tests*")))
+      (let ((stats (ert-run-tests-interactively "^ert-")))
         (cl-assert ert--test-body-was-run)
         (if (zerop (ert-stats-completed-unexpected stats))
             ;; Hide results window only when everything went well.
@@ -519,17 +520,17 @@ ert-test-run-tests-interactively
                                      :body (lambda () (ert-skip
                                                        "skip message")))))
     (let ((ert-debug-on-error nil))
-      (let* ((buffer-name (generate-new-buffer-name " *ert-test-run-tests*"))
-             (messages nil)
-             (mock-message-fn
-              (lambda (format-string &rest args)
-                (push (apply #'format format-string args) messages))))
+      (cl-letf* ((buffer-name (generate-new-buffer-name " *ert-test-run-tests*"))
+                 (ert--output-buffer-name buffer-name)
+                 (messages nil)
+                 ((symbol-function 'message)
+                  (lambda (format-string &rest args)
+                    (push (apply #'format format-string args) messages))))
         (save-window-excursion
           (unwind-protect
               (let ((case-fold-search nil))
                 (ert-run-tests-interactively
-                 `(member ,passing-test ,failing-test, skipped-test) buffer-name
-                 mock-message-fn)
+                 `(member ,passing-test ,failing-test, skipped-test))
                 (should (equal messages `(,(concat
                                             "Ran 3 tests, 1 results were "
                                             "as expected, 1 unexpected, "
@@ -551,6 +552,68 @@ ert-test-run-tests-interactively
             (when (get-buffer buffer-name)
               (kill-buffer buffer-name))))))))
 
+(ert-deftest ert-test-run-tests-batch ()
+  (let* ((complex-list '((:1 (:2 (:3 (:4 (:5 (:6 "abc"))))))))
+	 (long-list (make-list 11 1))
+	 (failing-test-1
+          (make-ert-test :name 'failing-test-1
+			 :body (lambda () (should (equal complex-list 1)))))
+	 (failing-test-2
+          (make-ert-test :name 'failing-test-2
+			 :body (lambda () (should (equal long-list 1))))))
+    (let ((ert-debug-on-error nil)
+          messages)
+      (cl-letf* (((symbol-function 'message)
+                  (lambda (format-string &rest args)
+                    (push (apply #'format format-string args) messages))))
+        (save-window-excursion
+          (unwind-protect
+              (let ((case-fold-search nil)
+                    (ert-batch-backtrace-right-margin nil)
+		    (ert-batch-print-level 10)
+		    (ert-batch-print-length 11))
+                (ert-run-tests-batch
+                 `(member ,failing-test-1 ,failing-test-2))))))
+      (let ((long-text "(different-types[ \t\n]+(1 1 1 1 1 1 1 1 1 1 1)[ \t\n]+1)))[ \t\n]*$")
+	    (complex-text "(different-types[ \t\n]+((:1[ \t\n]+(:2[ \t\n]+(:3[ \t\n]+(:4[ \t\n]+(:5[ \t\n]+(:6[ \t\n]+\"abc\")))))))[ \t\n]+1)))[ \t\n]*$")
+            found-long
+	    found-complex)
+	(cl-loop for msg in (reverse messages)
+		 do
+		 (unless found-long
+		   (setq found-long (string-match long-text msg)))
+		 (unless found-complex
+		   (setq found-complex (string-match complex-text msg))))
+	(should found-long)
+	(should found-complex)))))
+
+(ert-deftest ert-test-run-tests-batch-expensive ()
+  (let* ((complex-list '((:1 (:2 (:3 (:4 (:5 (:6 "abc"))))))))
+	 (failing-test-1
+          (make-ert-test :name 'failing-test-1
+			 :body (lambda () (should (equal complex-list 1))))))
+    (let ((ert-debug-on-error nil)
+          messages)
+      (cl-letf* (((symbol-function 'message)
+                  (lambda (format-string &rest args)
+                    (push (apply #'format format-string args) messages))))
+        (save-window-excursion
+          (unwind-protect
+              (let ((case-fold-search nil)
+                    (ert-batch-backtrace-right-margin nil)
+                    (ert-batch-backtrace-line-length nil)
+		    (ert-batch-print-level 6)
+		    (ert-batch-print-length 11))
+                (ert-run-tests-batch
+                 `(member ,failing-test-1))))))
+      (let ((frame "ert-fail(((should (equal complex-list 1)) :form (equal ((:1 (:2 (:3 (:4 (:5 (:6 \"abc\"))))))) 1) :value nil :explanation (different-types ((:1 (:2 (:3 (:4 (:5 (:6 \"abc\"))))))) 1)))")
+            found-frame)
+	(cl-loop for msg in (reverse messages)
+		 do
+		 (unless found-frame
+		   (setq found-frame (cl-search frame msg :test 'equal))))
+        (should found-frame)))))
+
 (ert-deftest ert-test-special-operator-p ()
   (should (ert--special-operator-p 'if))
   (should-not (ert--special-operator-p 'car))
diff --git a/test/lisp/emacs-lisp/ert-x-tests.el b/test/lisp/emacs-lisp/ert-x-tests.el
index 9baa9941586..1001525dee9 100644
--- a/test/lisp/emacs-lisp/ert-x-tests.el
+++ b/test/lisp/emacs-lisp/ert-x-tests.el
@@ -103,23 +103,24 @@ ert-propertized-string
 
 (ert-deftest ert-test-run-tests-interactively-2 ()
   :tags '(:causes-redisplay)
-  (let* ((passing-test (make-ert-test :name 'passing-test
-                                      :body (lambda () (ert-pass))))
-         (failing-test (make-ert-test :name 'failing-test
-                                      :body (lambda ()
-                                              (ert-info ((propertize "foo\nbar"
-                                                                     'a 'b))
-                                                (ert-fail
-                                                 "failure message")))))
-         (skipped-test (make-ert-test :name 'skipped-test
-                                      :body (lambda () (ert-skip
-							"skip message"))))
-         (ert-debug-on-error nil)
-         (buffer-name (generate-new-buffer-name "*ert-test-run-tests*"))
-         (messages nil)
-         (mock-message-fn
-          (lambda (format-string &rest args)
-            (push (apply #'format format-string args) messages))))
+  (cl-letf* ((passing-test (make-ert-test :name 'passing-test
+                                          :body (lambda () (ert-pass))))
+             (failing-test (make-ert-test :name 'failing-test
+                                          :body (lambda ()
+                                                  (ert-info ((propertize "foo\nbar"
+                                                                         'a 'b))
+                                                            (ert-fail
+                                                             "failure message")))))
+             (skipped-test (make-ert-test :name 'skipped-test
+                                          :body (lambda () (ert-skip
+							    "skip message"))))
+             (ert-debug-on-error nil)
+             (messages nil)
+             (buffer-name (generate-new-buffer-name "*ert-test-run-tests*"))
+             ((symbol-function 'message)
+              (lambda (format-string &rest args)
+                (push (apply #'format format-string args) messages)))
+             (ert--output-buffer-name buffer-name))
     (cl-flet ((expected-string (with-font-lock-p)
                 (ert-propertized-string
                  "Selector: (member <passing-test> <failing-test> "
@@ -152,14 +153,12 @@ ert-test-run-tests-interactively-2
                  "failing-test"
                  nil "\n    Info: " '(a b) "foo\n"
                  nil "          " '(a b) "bar"
-                 nil "\n    (ert-test-failed \"failure message\")\n\n\n"
-                 )))
+                 nil "\n    (ert-test-failed \"failure message\")\n\n\n")))
       (save-window-excursion
         (unwind-protect
             (let ((case-fold-search nil))
               (ert-run-tests-interactively
-               `(member ,passing-test ,failing-test ,skipped-test) buffer-name
-               mock-message-fn)
+               `(member ,passing-test ,failing-test ,skipped-test))
               (should (equal messages `(,(concat
                                           "Ran 3 tests, 1 results were "
                                           "as expected, 1 unexpected, "
-- 
2.33.1


--=-=-=
Content-Type: text/plain; format=flowed


-- 
Michael <sp1ff@HIDDEN>

--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51037; Package emacs. Full text available.

Message received at 51037 <at> debbugs.gnu.org:


Received: (at 51037) by debbugs.gnu.org; 14 Nov 2021 14:42:31 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Nov 14 09:42:31 2021
Received: from localhost ([127.0.0.1]:49595 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mmGiE-0007eG-JC
	for submit <at> debbugs.gnu.org; Sun, 14 Nov 2021 09:42:31 -0500
Received: from quimby.gnus.org ([95.216.78.240]:33078)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1mmGiB-0007e2-Qu
 for 51037 <at> debbugs.gnu.org; Sun, 14 Nov 2021 09:42:29 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID
 :In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To:Content-ID:
 Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc
 :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe:
 List-Post:List-Owner:List-Archive;
 bh=0deT/V8w7PcJHNA4tOVVP5RtFIytLiF4qmn8PWmXld8=; b=GAC/rhHdGrwPDJqOMwtYGL52kj
 ZU1k+pKv+5M5nIt0dCYbdjgRjr78fFtkwD2/XLGmcW/QBrTtYN9zk6Z9qhzNm4nkOdE7D8IlOJ5gZ
 F4Co9phEoL2DleHj6v64cIlPEV/HlRMjyJZWWRUc7WOuuofjCdhaXTWoLZVS1TMAPon0=;
Received: from [84.212.220.105] (helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1mmGi3-0004X9-Rc; Sun, 14 Nov 2021 15:42:22 +0100
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Michael <sp1ff@HIDDEN>
Subject: Re: bug#51037: [PATCH] Make `print-level` & `print-length`
 customizable in ERT batch tests
References: <86tuhvmtpl.fsf@HIDDEN> <877deqec10.fsf@HIDDEN>
 <83fste2u4i.fsf@HIDDEN> <87ily94662.fsf@HIDDEN>
 <83fstd1bth.fsf@HIDDEN> <87czogslm4.fsf@HIDDEN>
 <86ily2mjtq.fsf@HIDDEN> <87r1cp89o4.fsf@HIDDEN>
 <86fst5m48v.fsf@HIDDEN> <87a6jd5891.fsf@HIDDEN>
 <86mtmykxro.fsf@HIDDEN> <87y26hz24c.fsf@HIDDEN>
 <86bl3blcgm.fsf@HIDDEN> <87wnlya9sj.fsf@HIDDEN>
 <86wnlbmooj.fsf@HIDDEN> <87fsry7qdy.fsf@HIDDEN>
X-Now-Playing: Narrow Sea's _Caroline Shaw: Narrow Sea_: "Pt. 4 (feat. Dawn
 Upshaw, Gilbert Kalish)"
Date: Sun, 14 Nov 2021 15:42:19 +0100
In-Reply-To: <87fsry7qdy.fsf@HIDDEN> (Lars Ingebrigtsen's message of "Sun,
 14 Nov 2021 15:39:37 +0100")
Message-ID: <87bl2m7q9g.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: Lars Ingebrigtsen <larsi@HIDDEN> writes: > Michael
 <sp1ff@HIDDEN>
 writes: > >> OK-- here's the revised patch. > > Thanks; applied to Emacs
 29 (with some whitespace changes to make the > lines less wide). 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 51037
Cc: gazally@HIDDEN, 51037 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Lars Ingebrigtsen <larsi@HIDDEN> writes:

> Michael <sp1ff@HIDDEN> writes:
>
>> OK-- here's the revised patch.
>
> Thanks; applied to Emacs 29 (with some whitespace changes to make the
> lines less wide).

I spoke to soon -- we don't seem to have copyright assignment papers on
file?  Is that in the process of happening?

So here's the patch again with the whitespace tweaks while we wait for
that.  =F0=9F=A4=A8

diff --git a/doc/misc/ert.texi b/doc/misc/ert.texi
index 440c61add8..522b09dd61 100644
--- a/doc/misc/ert.texi
+++ b/doc/misc/ert.texi
@@ -390,6 +390,31 @@ Running Tests in Batch Mode
 emacs -batch -l ert -f ert-summarize-tests-batch-and-exit output.log
 @end example
=20
+@vindex ert-batch-print-level
+@vindex ert-batch-print-length
+ERT attempts to limit the output size for failed tests by choosing
+conservative values for @code{print-level} & @code{print-length}
+when printing Lisp values.  This can in some cases make it difficult
+to see which portions of those values are incorrect.  Use
+@code{ert-batch-print-level} and @code{ert-batch-print-length}
+to customize that:
+
+@example
+emacs -batch -l ert -l my-tests.el \
+      --eval "(let ((ert-batch-print-level 10) \
+                    (ert-batch-print-length 120)) \
+                (ert-run-tests-batch-and-exit))"
+@end example
+
+@vindex ert-batch-backtrace-line-length
+Even modest settings for @code{print-level} & @code{print-length} can
+produce extremely long lines in backtraces, however, with attendant
+pauses in execution progress. Set
+@code{ert-batch-backtrace-line-length} to t to use the value of
+@code{backtrace-line-length}, nil to stop any limitations on backtrace
+line lengths (i.e. to get full backtraces), or a positive integer to
+limit backtrace line length to that number.
+
 @vindex ert-quiet
 By default, ERT in batch mode is quite verbose, printing a line with
 result after each test.  This gives you progress information: how many
diff --git a/etc/NEWS b/etc/NEWS
index 312fc18f4f..ccae7a052c 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -54,6 +54,13 @@ This is in addition to previously-supported ways of disc=
overing 24-bit
 color support: either via the "RGB" or "setf24" capabilities, or if
 the 'COLORTERM' environment variable is set to the value "truecolor".
=20
++++
+** New ERT variables 'ert-batch-print-length' and 'ert-batch-print-level'.
+These variables will override 'print-length' and 'print-level' when
+printing Lisp values in ERT batch test results.
+
+** Emacs now supports Unicode Standard version 14.0.
+
 ** Emoji
=20
 +++
diff --git a/lisp/emacs-lisp/backtrace.el b/lisp/emacs-lisp/backtrace.el
index a5721aa319..90201442f0 100644
--- a/lisp/emacs-lisp/backtrace.el
+++ b/lisp/emacs-lisp/backtrace.el
@@ -55,9 +55,9 @@ backtrace-fontify
 (defcustom backtrace-line-length 5000
   "Target length for lines in Backtrace buffers.
 Backtrace mode will attempt to abbreviate printing of backtrace
-frames to make them shorter than this, but success is not
-guaranteed.  If set to nil or zero, Backtrace mode will not
-abbreviate the forms it prints."
+frames by setting `print-level' & `print-length' to make them
+shorter than this, but success is not guaranteed.  If set to nil
+or zero, Backtrace mode will not abbreviate the forms it prints."
   :type 'integer
   :group 'backtrace
   :version "27.1")
@@ -751,6 +751,13 @@ backtrace--print-flags
     (insert (make-string (- backtrace--flags-width (- (point) beg)) ?\s))
     (put-text-property beg (point) 'backtrace-section 'func)))
=20
+(defun backtrace--line-length-or-nil ()
+  "Return `backtrace-line-length' if valid, nil else."
+  ;; mirror the logic in `cl-print-to-string-with-limits'
+  (and (natnump backtrace-line-length)
+       (not (zerop backtrace-line-length))
+       backtrace-line-length))
+
 (defun backtrace--print-func-and-args (frame _view)
   "Print the function, arguments and buffer position of a backtrace FRAME.
 Format it according to VIEW."
@@ -769,11 +776,13 @@ backtrace--print-func-and-args
       (if (atom fun)
           (funcall backtrace-print-function fun)
         (insert
-         (backtrace--print-to-string fun (when args (/ backtrace-line-leng=
th 2)))))
+         (backtrace--print-to-string fun (when (and args (backtrace--line-=
length-or-nil)) (/ backtrace-line-length 2)))))
       (if args
           (insert (backtrace--print-to-string
-                   args (max (truncate (/ backtrace-line-length 5))
-                             (- backtrace-line-length (- (point) beg)))))
+                   args
+                   (if (backtrace--line-length-or-nil)
+                       (max (truncate (/ backtrace-line-length 5))
+                            (- backtrace-line-length (- (point) beg))))))
         ;; The backtrace-form property is so that backtrace-multi-line
         ;; will find it.  backtrace-multi-line doesn't do anything
         ;; useful with it, just being consistent.
diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el
index 8ebc81fd41..5396cbbd5d 100644
--- a/lisp/emacs-lisp/ert.el
+++ b/lisp/emacs-lisp/ert.el
@@ -77,6 +77,37 @@ ert-batch-backtrace-right-margin
 Use nil for no limit (caution: backtrace lines can be very long)."
   :type '(choice (const :tag "No truncation" nil) integer))
=20
+(defvar ert-batch-print-length 10
+  "`print-length' setting used in `ert-run-tests-batch'.
+
+When formatting lists in test conditions, `print-length' will be
+temporarily set to this value.  See also
+`ert-batch-backtrace-line-length' for its effect on stack
+traces.")
+
+(defvar ert-batch-print-level 5
+  "`print-level' setting used in `ert-run-tests-batch'.
+
+When formatting lists in test conditions, `print-level' will be
+temporarily set to this value.  See also
+`ert-batch-backtrace-line-length' for its effect on stack
+traces.")
+
+(defvar ert-batch-backtrace-line-length t
+  "Target length for lines in ERT batch backtraces.
+
+Even modest settings for `print-length' & `print-level' can
+produce extremely long lines in backtraces & lengthy delays in
+forming them.  This variable governs the target maximum line
+length by manipulating these two variables while printing stack
+traces.  Setting this variable to t will re-use the value of
+`backtrace-line-length' while print stack traces in ERT batch
+mode.  A value of nil will short-circuit this mechanism; line
+lengths will be completely determined by `ert-batch-line-length'
+& `ert-batch-line-level'.  Any other value will be temporarily
+bound to `backtrace-line-length' when producing stack traces
+in batch mode.")
+
 (defface ert-test-result-expected '((((class color) (background light))
                                      :background "green1")
                                     (((class color) (background dark))
@@ -1402,8 +1433,7 @@ ert-run-tests-batch
                                       (ert-reason-for-test-result result)
                                     ""))))
               (message "%s" "")))))
-       (test-started
-        )
+       (test-started)
        (test-ended
         (cl-destructuring-bind (stats test result) event-args
           (unless (ert-test-result-expected-p test result)
@@ -1413,8 +1443,19 @@ ert-run-tests-batch
               (ert-test-result-with-condition
                (message "Test %S backtrace:" (ert-test-name test))
                (with-temp-buffer
-                 (insert (backtrace-to-string
-                          (ert-test-result-with-condition-backtrace result=
)))
+                 (let ((backtrace-line-length
+                        (cond
+                         ((eq ert-batch-backtrace-line-length t)
+                          backtrace-line-length)
+                         ((eq ert-batch-backtrace-line-length nil)
+                          nil)
+                         (t
+                          ert-batch-backtrace-line-length)))
+                       (print-level ert-batch-print-level)
+                       (print-length ert-batch-print-length))
+                   (insert (backtrace-to-string
+                            (ert-test-result-with-condition-backtrace
+                             result))))
                  (if (not ert-batch-backtrace-right-margin)
                      (message "%s"
                               (buffer-substring-no-properties (point-min)
@@ -1433,8 +1474,8 @@ ert-run-tests-batch
                  (ert--insert-infos result)
                  (insert "    ")
                  (let ((print-escape-newlines t)
-                       (print-level 5)
-                       (print-length 10))
+                       (print-level ert-batch-print-level)
+                       (print-length ert-batch-print-length))
                    (ert--pp-with-indentation-and-newline
                     (ert-test-result-with-condition-condition result)))
                  (goto-char (1- (point-max)))
@@ -1962,13 +2003,13 @@ ert--results-font-lock-function
   (ewoc-refresh ert--results-ewoc)
   (font-lock-default-function enabledp))
=20
-(defun ert--setup-results-buffer (stats listener buffer-name)
+(defvar ert--output-buffer-name "*ert*")
+
+(defun ert--setup-results-buffer (stats listener)
   "Set up a test results buffer.
=20
-STATS is the stats object; LISTENER is the results listener;
-BUFFER-NAME, if non-nil, is the buffer name to use."
-  (unless buffer-name (setq buffer-name "*ert*"))
-  (let ((buffer (get-buffer-create buffer-name)))
+STATS is the stats object; LISTENER is the results listener."
+  (let ((buffer (get-buffer-create ert--output-buffer-name)))
     (with-current-buffer buffer
       (let ((inhibit-read-only t))
         (buffer-disable-undo)
@@ -2000,18 +2041,11 @@ ert--setup-results-buffer
 (defvar ert--selector-history nil
   "List of recent test selectors read from terminal.")
=20
-;; 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-f=
n)
+(defun ert-run-tests-interactively (selector)
   "Run the tests specified by SELECTOR and display the results in a buffer.
=20
-SELECTOR works as described in `ert-select-tests'.
-OUTPUT-BUFFER-NAME and MESSAGE-FN should normally be nil; they
-are used for automated self-tests and specify which buffer to use
-and how to display message."
+SELECTOR works as described in `ert-select-tests'."
   (interactive
    (list (let ((default (if ert--selector-history
                             ;; Can't use `first' here as this form is
@@ -2024,23 +2058,17 @@ ert-run-tests-interactively
                              obarray #'ert-test-boundp nil nil
                              'ert--selector-history default nil)))
          nil))
-  (unless message-fn (setq message-fn 'message))
-  (let ((output-buffer-name output-buffer-name)
-        buffer
-        listener
-        (message-fn message-fn))
+  (let (buffer listener)
     (setq listener
           (lambda (event-type &rest event-args)
             (cl-ecase event-type
               (run-started
                (cl-destructuring-bind (stats) event-args
-                 (setq buffer (ert--setup-results-buffer stats
-                                                         listener
-                                                         output-buffer-nam=
e))
+                 (setq buffer (ert--setup-results-buffer stats listener))
                  (pop-to-buffer buffer)))
               (run-ended
                (cl-destructuring-bind (stats abortedp) event-args
-                 (funcall message-fn
+                 (message
                           "%sRan %s tests, %s results were as expected%s%s"
                           (if (not abortedp)
                               ""
@@ -2394,7 +2422,7 @@ ert-results-rerun-all-tests
   (interactive nil ert-results-mode)
   (cl-assert (eql major-mode 'ert-results-mode))
   (let ((selector (ert--stats-selector ert--results-stats)))
-    (ert-run-tests-interactively selector (buffer-name))))
+    (ert-run-tests-interactively selector)))
=20
 (defun ert-results-rerun-test-at-point ()
   "Re-run the test at point.
diff --git a/test/lisp/emacs-lisp/ert-tests.el b/test/lisp/emacs-lisp/ert-t=
ests.el
index 79576d2403..1a8c9bf4f0 100644
--- a/test/lisp/emacs-lisp/ert-tests.el
+++ b/test/lisp/emacs-lisp/ert-tests.el
@@ -39,10 +39,11 @@ ert-test-body-runs
 (defun ert-self-test ()
   "Run ERT's self-tests and make sure they actually ran."
   (let ((window-configuration (current-window-configuration)))
-    (let ((ert--test-body-was-run nil))
+    (let ((ert--test-body-was-run nil)
+          (ert--output-buffer-name " *ert self-tests*"))
       ;; The buffer name chosen here should not compete with the default
       ;; results buffer name for completion in `switch-to-buffer'.
-      (let ((stats (ert-run-tests-interactively "^ert-" " *ert self-tests*=
")))
+      (let ((stats (ert-run-tests-interactively "^ert-")))
         (cl-assert ert--test-body-was-run)
         (if (zerop (ert-stats-completed-unexpected stats))
             ;; Hide results window only when everything went well.
@@ -519,17 +520,18 @@ ert-test-run-tests-interactively
                                      :body (lambda () (ert-skip
                                                        "skip message")))))
     (let ((ert-debug-on-error nil))
-      (let* ((buffer-name (generate-new-buffer-name " *ert-test-run-tests*=
"))
-             (messages nil)
-             (mock-message-fn
-              (lambda (format-string &rest args)
-                (push (apply #'format format-string args) messages))))
+      (cl-letf* ((buffer-name (generate-new-buffer-name
+                               " *ert-test-run-tests*"))
+                 (ert--output-buffer-name buffer-name)
+                 (messages nil)
+                 ((symbol-function 'message)
+                  (lambda (format-string &rest args)
+                    (push (apply #'format format-string args) messages))))
         (save-window-excursion
           (unwind-protect
               (let ((case-fold-search nil))
                 (ert-run-tests-interactively
-                 `(member ,passing-test ,failing-test, skipped-test) buffe=
r-name
-                 mock-message-fn)
+                 `(member ,passing-test ,failing-test, skipped-test))
                 (should (equal messages `(,(concat
                                             "Ran 3 tests, 1 results were "
                                             "as expected, 1 unexpected, "
@@ -551,6 +553,68 @@ ert-test-run-tests-interactively
             (when (get-buffer buffer-name)
               (kill-buffer buffer-name))))))))
=20
+(ert-deftest ert-test-run-tests-batch ()
+  (let* ((complex-list '((:1 (:2 (:3 (:4 (:5 (:6 "abc"))))))))
+	 (long-list (make-list 11 1))
+	 (failing-test-1
+          (make-ert-test :name 'failing-test-1
+			 :body (lambda () (should (equal complex-list 1)))))
+	 (failing-test-2
+          (make-ert-test :name 'failing-test-2
+			 :body (lambda () (should (equal long-list 1))))))
+    (let ((ert-debug-on-error nil)
+          messages)
+      (cl-letf* (((symbol-function 'message)
+                  (lambda (format-string &rest args)
+                    (push (apply #'format format-string args) messages))))
+        (save-window-excursion
+          (unwind-protect
+              (let ((case-fold-search nil)
+                    (ert-batch-backtrace-right-margin nil)
+		    (ert-batch-print-level 10)
+		    (ert-batch-print-length 11))
+                (ert-run-tests-batch
+                 `(member ,failing-test-1 ,failing-test-2))))))
+      (let ((long-text "(different-types[ \t\n]+(1 1 1 1 1 1 1 1 1 1 1)[ \=
t\n]+1)))[ \t\n]*$")
+	    (complex-text "(different-types[ \t\n]+((:1[ \t\n]+(:2[ \t\n]+(:3[ \t=
\n]+(:4[ \t\n]+(:5[ \t\n]+(:6[ \t\n]+\"abc\")))))))[ \t\n]+1)))[ \t\n]*$")
+            found-long
+	    found-complex)
+	(cl-loop for msg in (reverse messages)
+		 do
+		 (unless found-long
+		   (setq found-long (string-match long-text msg)))
+		 (unless found-complex
+		   (setq found-complex (string-match complex-text msg))))
+	(should found-long)
+	(should found-complex)))))
+
+(ert-deftest ert-test-run-tests-batch-expensive ()
+  (let* ((complex-list '((:1 (:2 (:3 (:4 (:5 (:6 "abc"))))))))
+	 (failing-test-1
+          (make-ert-test :name 'failing-test-1
+			 :body (lambda () (should (equal complex-list 1))))))
+    (let ((ert-debug-on-error nil)
+          messages)
+      (cl-letf* (((symbol-function 'message)
+                  (lambda (format-string &rest args)
+                    (push (apply #'format format-string args) messages))))
+        (save-window-excursion
+          (unwind-protect
+              (let ((case-fold-search nil)
+                    (ert-batch-backtrace-right-margin nil)
+                    (ert-batch-backtrace-line-length nil)
+		    (ert-batch-print-level 6)
+		    (ert-batch-print-length 11))
+                (ert-run-tests-batch
+                 `(member ,failing-test-1))))))
+      (let ((frame "ert-fail(((should (equal complex-list 1)) :form (equal=
 ((:1 (:2 (:3 (:4 (:5 (:6 \"abc\"))))))) 1) :value nil :explanation (differ=
ent-types ((:1 (:2 (:3 (:4 (:5 (:6 \"abc\"))))))) 1)))")
+            found-frame)
+	(cl-loop for msg in (reverse messages)
+		 do
+		 (unless found-frame
+		   (setq found-frame (cl-search frame msg :test 'equal))))
+        (should found-frame)))))
+
 (ert-deftest ert-test-special-operator-p ()
   (should (ert--special-operator-p 'if))
   (should-not (ert--special-operator-p 'car))
diff --git a/test/lisp/emacs-lisp/ert-x-tests.el b/test/lisp/emacs-lisp/ert=
-x-tests.el
index 9baa994158..5813fc44bf 100644
--- a/test/lisp/emacs-lisp/ert-x-tests.el
+++ b/test/lisp/emacs-lisp/ert-x-tests.el
@@ -103,23 +103,26 @@ ert-propertized-string
=20
 (ert-deftest ert-test-run-tests-interactively-2 ()
   :tags '(:causes-redisplay)
-  (let* ((passing-test (make-ert-test :name 'passing-test
-                                      :body (lambda () (ert-pass))))
-         (failing-test (make-ert-test :name 'failing-test
-                                      :body (lambda ()
-                                              (ert-info ((propertize "foo\=
nbar"
-                                                                     'a 'b=
))
-                                                (ert-fail
-                                                 "failure message")))))
-         (skipped-test (make-ert-test :name 'skipped-test
-                                      :body (lambda () (ert-skip
-							"skip message"))))
-         (ert-debug-on-error nil)
-         (buffer-name (generate-new-buffer-name "*ert-test-run-tests*"))
-         (messages nil)
-         (mock-message-fn
-          (lambda (format-string &rest args)
-            (push (apply #'format format-string args) messages))))
+  (cl-letf* ((passing-test (make-ert-test
+                            :name 'passing-test
+                            :body (lambda () (ert-pass))))
+             (failing-test (make-ert-test
+                            :name 'failing-test
+                            :body (lambda ()
+                                    (ert-info ((propertize "foo\nbar"
+                                                           'a 'b))
+                                              (ert-fail
+                                               "failure message")))))
+             (skipped-test (make-ert-test :name 'skipped-test
+                                          :body (lambda () (ert-skip
+							    "skip message"))))
+             (ert-debug-on-error nil)
+             (messages nil)
+             (buffer-name (generate-new-buffer-name "*ert-test-run-tests*"=
))
+             ((symbol-function 'message)
+              (lambda (format-string &rest args)
+                (push (apply #'format format-string args) messages)))
+             (ert--output-buffer-name buffer-name))
     (cl-flet ((expected-string (with-font-lock-p)
                 (ert-propertized-string
                  "Selector: (member <passing-test> <failing-test> "
@@ -152,14 +155,12 @@ ert-test-run-tests-interactively-2
                  "failing-test"
                  nil "\n    Info: " '(a b) "foo\n"
                  nil "          " '(a b) "bar"
-                 nil "\n    (ert-test-failed \"failure message\")\n\n\n"
-                 )))
+                 nil "\n    (ert-test-failed \"failure message\")\n\n\n")))
       (save-window-excursion
         (unwind-protect
             (let ((case-fold-search nil))
               (ert-run-tests-interactively
-               `(member ,passing-test ,failing-test ,skipped-test) buffer-=
name
-               mock-message-fn)
+               `(member ,passing-test ,failing-test ,skipped-test))
               (should (equal messages `(,(concat
                                           "Ran 3 tests, 1 results were "
                                           "as expected, 1 unexpected, "




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51037; Package emacs. Full text available.

Message received at 51037 <at> debbugs.gnu.org:


Received: (at 51037) by debbugs.gnu.org; 14 Nov 2021 14:39:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Nov 14 09:39:48 2021
Received: from localhost ([127.0.0.1]:49591 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mmGfc-0007Zo-6o
	for submit <at> debbugs.gnu.org; Sun, 14 Nov 2021 09:39:48 -0500
Received: from quimby.gnus.org ([95.216.78.240]:33058)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1mmGfa-0007Zb-NA
 for 51037 <at> debbugs.gnu.org; Sun, 14 Nov 2021 09:39:47 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=Qzxbx7mibb6VVjiluW6+A0z8ckOEJY0TBQWlRMdlIXY=; b=JTVtT+x/SBCynH4THEpWyeVRx+
 JmjwupskHC613OF6VY7psQ+mJAqMtKB47xMc/bOsliX1L5BRla6NiSjwYByjqRQLFXPUM6FACH0jg
 JcH+r3HB693AYl4S6ruMzcCc3x0YS4zKLeMUqAlMauK4X4e6akPm/4WrcEp/iQ+poA+s=;
Received: from [84.212.220.105] (helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1mmGfS-0004Wd-CL; Sun, 14 Nov 2021 15:39:40 +0100
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Michael <sp1ff@HIDDEN>
Subject: Re: bug#51037: [PATCH] Make `print-level` & `print-length`
 customizable in ERT batch tests
References: <86tuhvmtpl.fsf@HIDDEN> <877deqec10.fsf@HIDDEN>
 <83fste2u4i.fsf@HIDDEN> <87ily94662.fsf@HIDDEN>
 <83fstd1bth.fsf@HIDDEN> <87czogslm4.fsf@HIDDEN>
 <86ily2mjtq.fsf@HIDDEN> <87r1cp89o4.fsf@HIDDEN>
 <86fst5m48v.fsf@HIDDEN> <87a6jd5891.fsf@HIDDEN>
 <86mtmykxro.fsf@HIDDEN> <87y26hz24c.fsf@HIDDEN>
 <86bl3blcgm.fsf@HIDDEN> <87wnlya9sj.fsf@HIDDEN>
 <86wnlbmooj.fsf@HIDDEN>
X-Now-Playing: Narrow Sea's _Caroline Shaw: Narrow Sea_: "Pt. 3 (feat. Dawn
 Upshaw, Gilbert Kalish)"
Date: Sun, 14 Nov 2021 15:39:37 +0100
In-Reply-To: <86wnlbmooj.fsf@HIDDEN> (Michael's message of "Sat, 13 Nov
 2021 18:55:08 -0800")
Message-ID: <87fsry7qdy.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: Michael <sp1ff@HIDDEN> writes: > OK-- here's the revised
 patch. Thanks; applied to Emacs 29 (with some whitespace changes to make
 the lines less wide). 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 51037
Cc: gazally@HIDDEN, 51037 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Michael <sp1ff@HIDDEN> writes:

> OK-- here's the revised patch.

Thanks; applied to Emacs 29 (with some whitespace changes to make the
lines less wide).

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51037; Package emacs. Full text available.

Message received at 51037 <at> debbugs.gnu.org:


Received: (at 51037) by debbugs.gnu.org; 14 Nov 2021 07:06:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Nov 14 02:06:02 2021
Received: from localhost ([127.0.0.1]:48993 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mm9aU-0005Xr-5k
	for submit <at> debbugs.gnu.org; Sun, 14 Nov 2021 02:06:02 -0500
Received: from eggs.gnu.org ([209.51.188.92]:49054)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1mm9aS-0005XJ-6t
 for 51037 <at> debbugs.gnu.org; Sun, 14 Nov 2021 02:06:01 -0500
Received: from [2001:470:142:3::e] (port=45048 helo=fencepost.gnu.org)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1mm9aM-0002en-1m; Sun, 14 Nov 2021 02:05:54 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=Hjf0l0ZDlcGyi4GEKmD9uhj02zEiJ89aYXF3PBNUG+I=; b=ZC46AzPL+0+s
 6xHnVmm+loPWjRkcyEQy72ZunWg4hNNfSUIhmOo6E9bDPrqxgy3/wdhCFkGVdy1czPfxn55rVAnLC
 dSf4t/uplbu79OvujN4h7gbOwr4Rp3wldWVis8KbjR2bUwC8Ct/sizkBs0Urx2ERioGL/MDViuAxG
 hDir/XlTe4AYcI0HVlnW/qgVJiTBe2AnjVr//M50VfffkcIoR9a5PYa6BU20hbU4utVgiNXScPfb2
 RnPqTw+nTmN4j+OSZMptW7QEpUIsn4wUxm+0hp5b7oCfmlQEARhgVAm5zAA3XUiO/Z/0T72SGPY0h
 Ta2kSMUgW0IpLjOz25Kitw==;
Received: from [87.69.77.57] (port=3987 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1mm9aL-0005FI-Km; Sun, 14 Nov 2021 02:05:53 -0500
Date: Sun, 14 Nov 2021 09:05:40 +0200
Message-Id: <83bl2nw723.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Michael <sp1ff@HIDDEN>
In-Reply-To: <86wnlbmooj.fsf@HIDDEN> (message from Michael on Sat, 13 Nov
 2021 18:55:08 -0800)
Subject: Re: bug#51037: [PATCH] Make `print-level` & `print-length`
 customizable in ERT batch tests
References: <86tuhvmtpl.fsf@HIDDEN> <877deqec10.fsf@HIDDEN>
 <83fste2u4i.fsf@HIDDEN> <87ily94662.fsf@HIDDEN>
 <83fstd1bth.fsf@HIDDEN> <87czogslm4.fsf@HIDDEN>
 <86ily2mjtq.fsf@HIDDEN> <87r1cp89o4.fsf@HIDDEN>
 <86fst5m48v.fsf@HIDDEN> <87a6jd5891.fsf@HIDDEN>
 <86mtmykxro.fsf@HIDDEN> <87y26hz24c.fsf@HIDDEN>
 <86bl3blcgm.fsf@HIDDEN> <87wnlya9sj.fsf@HIDDEN>
 <86wnlbmooj.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 51037
Cc: gazally@HIDDEN, larsi@HIDDEN, 51037 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Michael <sp1ff@HIDDEN>
> Date: Sat, 13 Nov 2021 18:55:08 -0800
> Cc: gazally@HIDDEN, 51037 <at> debbugs.gnu.org
> 
> OK-- here's the revised patch.

Thanks.

The patch includes some remnant of a merge conflict:

> ++++
> +** New ERT batch variables 'ert-batch-print-length' & 'ert-batch-print-level'
> +These variables will override 'print-length' & 'print-level' when
> +printing Lisp values in ERT batch test results.
> +
> +** Emacs now supports Unicode Standard version 14.0.
> +>>>>>>> 129b2425c79 (Make print-length & print-level in ert-run-tests-batch configurable)

Also, please try to keep the lines in the log message shorter than 65
characters.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51037; Package emacs. Full text available.

Message received at 51037 <at> debbugs.gnu.org:


Received: (at 51037) by debbugs.gnu.org; 14 Nov 2021 02:55:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Nov 13 21:55:32 2021
Received: from localhost ([127.0.0.1]:48718 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mm5g3-0002Hg-Mr
	for submit <at> debbugs.gnu.org; Sat, 13 Nov 2021 21:55:32 -0500
Received: from transit01.runbox.com ([91.220.196.211]:50174)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <sp1ff@HIDDEN>) id 1mm5fz-0002HL-KD
 for 51037 <at> debbugs.gnu.org; Sat, 13 Nov 2021 21:55:30 -0500
Received: from aibo.runbox.com ([185.226.149.25])
 by transit01.runbox.com with esmtps (TLS1.2) tls
 TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93)
 (envelope-from <sp1ff@HIDDEN>)
 id 1mm5fs-005vhG-NT; Sun, 14 Nov 2021 03:55:20 +0100
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=runbox.com; 
 s=selector1;
 h=Content-Type:MIME-Version:Message-ID:Date:In-reply-to:Subject
 :Cc:To:From:References; bh=OtkcJcC2hWYGWKZpJ4/NFaEO5TTHkOyDY0vULUzwC4k=; b=a8
 A6eouf8gjozxB1LZlrLoeT2TcRc7jHj0AosM9ql25HC7uo9ptAL9KzBH3Quuh1X3XhAZKZ8L9v3Oz
 qBvEuWOvDZoMYUcgiKdrWQjoqh/uEkfZRSDlVf0+P/aOYsShqA0VKtRjw2ma4bjbTD3lhzostKpug
 VIM0llGYQOe/hqqzWs8BXQPVGaGXTEkGgptMzUlaHg6KDoYkpGDgCRQPWaPgpNVLFXBacmfLnwUn4
 k/8aI2w+p8tHU094ldPgWYyrC4+nY6RPRPpmuXsMcgXwBGL8SdyiloJAfWe/UbCoaPgvFAaOUC3wU
 Jbyj+LLTo2WdTZI2pFcNW7qOvlAEXpiw==;
Received: from [10.9.9.74] (helo=submission03.runbox)
 by mailtransmit03.runbox with esmtp (Exim 4.86_2)
 (envelope-from <sp1ff@HIDDEN>)
 id 1mm5fr-0001lV-Ql; Sun, 14 Nov 2021 03:55:19 +0100
Received: by submission03.runbox with esmtpsa [Authenticated ID (942723)]
 (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1)
 id 1mm5fk-0007qu-07; Sun, 14 Nov 2021 03:55:12 +0100
References: <86tuhvmtpl.fsf@HIDDEN> <877deqec10.fsf@HIDDEN>
 <83fste2u4i.fsf@HIDDEN> <87ily94662.fsf@HIDDEN>
 <83fstd1bth.fsf@HIDDEN> <87czogslm4.fsf@HIDDEN>
 <86ily2mjtq.fsf@HIDDEN> <87r1cp89o4.fsf@HIDDEN>
 <86fst5m48v.fsf@HIDDEN> <87a6jd5891.fsf@HIDDEN>
 <86mtmykxro.fsf@HIDDEN> <87y26hz24c.fsf@HIDDEN>
 <86bl3blcgm.fsf@HIDDEN> <87wnlya9sj.fsf@HIDDEN>
User-agent: mu4e 1.4.15; emacs 28.0.50
From: Michael <sp1ff@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
Subject: Re: bug#51037: [PATCH] Make `print-level` & `print-length`
 customizable in ERT batch tests
In-reply-to: <87wnlya9sj.fsf@HIDDEN>
Date: Sat, 13 Nov 2021 18:55:08 -0800
Message-ID: <86wnlbmooj.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 51037
Cc: gazally@HIDDEN, bug-gnu-emacs@HIDDEN, 51037 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

--=-=-=
Content-Type: text/plain; format=flowed


Lars Ingebrigtsen <larsi@HIDDEN> writes:

> Michael <sp1ff@HIDDEN> writes:
>
>> I was thinking to augment the docstring for
>> `backtrace-line-lenght' to note that print-level & print-length
>> will be overiden to honor it.
>
> Sounds good.
>
>> The problem is that I can't know a priori how big I have to set
>> them in order to honor print-level & print-length.
>
> No, but I thought the issue was with the corner case where we're 
> almost
> up against the limit already?  To work around that, doubling the 
> limit
> is fine in this context.
>
>> I think I can short-circuit this entirely by setting
>> `backtrace-line-length' to nil or zero before printing the 
>> backtrace
>> from ert. eval-level shouldn't enter into it I think; the 
>> concern was
>> that if code exceeded max-lisp-eval-depth, and the debugger was
>> triggered, *then* backtrace.el might have problems. Do you see 
>> a
>> reason to be concerned outside of that corner case?
>
> If that works without upping the limit, then that's fine.

OK-- here's the revised patch.

Gemini was on to something-- even modest settings for print-level
& print-length can produce *extremely* long lines in backtraces,
with corresponding execution pauses. So I:

  - fixed the minor error in backtrace.el so that setting
    backtrace-length to nil has the desired effect (i.e. removing
    any line length limitation)
  - introduced a third variable ert-batch-backtrace-line-length,
    with the following permissible values:
    - nil: remove any limitation on backtrace line length (full
    backtraces)
    - t: just use the value of backtrace-line-length
    - positive int: use this value to limit line lengths in
    backtraces



--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0001-Make-print-length-print-level-in-ert-run-tests-batch.patch
Content-Description: Updated patch for ert-batch-print-length & -level

From e256f6ff60547bb08e17f99f7eb5e9f08607ea17 Mon Sep 17 00:00:00 2001
From: Michael Herstine <sp1ff@HIDDEN>
Date: Tue, 5 Oct 2021 06:53:02 -0700
Subject: [PATCH] Make print-length & print-level in ert-run-tests-batch
 configurable

This commit introduces two new ert variables (ert-batch-print-length
and ert-batch-print-level) that make these settings configurable.  It
also adds an optional message-fn parameter to ert-batch-test (in the
style of of ert-run-tests-interactively) to facilitate testing.

Since even modest values of print-level & print-length can produce
extremely long lines in backtraces along with correspondingly long
processing times to format them, this commit also introduces the
variable ert-backtrace-line-length which, can optionally, override
backtrace-line-length during ert batch test stack traces.

* lisp/emacs-lisp/ert.el (ert-batch-print-length, ert-batch-print-level,
ert-batch-backtrace-line-length, ert-batch-test,
ert-run-tests-interactively): Added the three variables, bound them to
these settings when formatting batch test results including backtraces.
Removed the optional parameters output-buffer & message-fn from
ert-run-tests-interactively.
* test/lisp/emacs-lisp/ert-tests.el (ert-test-run-tests-interactively,
ert-test-run-tests-batch): use cl-letf to capture output, new tests
resp.
* test/lisp/ert-x-tests.el (ert-test-run-tests-interactively-2):
Changed to use cl-letf to capture output instead of using message-fn.
* lisp/emacs-lisp/backtrace.el (backtrace--line-length-or-nil,
backtrace--print-func-and-args): Fixed a bug when setting
backtrace-line-length to nil by adding a new function to check
for that case & having backtrace--print-func-and-args use it.
* doc/misc/ert.texi: document the new variables & their usage
---
 doc/misc/ert.texi                   | 25 +++++++++
 etc/NEWS                            |  8 +++
 lisp/emacs-lisp/backtrace.el        | 21 +++++---
 lisp/emacs-lisp/ert.el              | 82 +++++++++++++++++++----------
 test/lisp/emacs-lisp/ert-tests.el   | 81 ++++++++++++++++++++++++----
 test/lisp/emacs-lisp/ert-x-tests.el | 41 +++++++--------
 6 files changed, 193 insertions(+), 65 deletions(-)

diff --git a/doc/misc/ert.texi b/doc/misc/ert.texi
index 440c61add8e..522b09dd617 100644
--- a/doc/misc/ert.texi
+++ b/doc/misc/ert.texi
@@ -390,6 +390,31 @@ Running Tests in Batch Mode
 emacs -batch -l ert -f ert-summarize-tests-batch-and-exit output.log
 @end example
 
+@vindex ert-batch-print-level
+@vindex ert-batch-print-length
+ERT attempts to limit the output size for failed tests by choosing
+conservative values for @code{print-level} & @code{print-length}
+when printing Lisp values.  This can in some cases make it difficult
+to see which portions of those values are incorrect.  Use
+@code{ert-batch-print-level} and @code{ert-batch-print-length}
+to customize that:
+
+@example
+emacs -batch -l ert -l my-tests.el \
+      --eval "(let ((ert-batch-print-level 10) \
+                    (ert-batch-print-length 120)) \
+                (ert-run-tests-batch-and-exit))"
+@end example
+
+@vindex ert-batch-backtrace-line-length
+Even modest settings for @code{print-level} & @code{print-length} can
+produce extremely long lines in backtraces, however, with attendant
+pauses in execution progress. Set
+@code{ert-batch-backtrace-line-length} to t to use the value of
+@code{backtrace-line-length}, nil to stop any limitations on backtrace
+line lengths (i.e. to get full backtraces), or a positive integer to
+limit backtrace line length to that number.
+
 @vindex ert-quiet
 By default, ERT in batch mode is quite verbose, printing a line with
 result after each test.  This gives you progress information: how many
diff --git a/etc/NEWS b/etc/NEWS
index 3cad0995ac5..b315fa5be2b 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -46,6 +46,14 @@ time.
 
 * Changes in Emacs 29.1
 
++++
+** New ERT batch variables 'ert-batch-print-length' & 'ert-batch-print-level'
+These variables will override 'print-length' & 'print-level' when
+printing Lisp values in ERT batch test results.
+
+** Emacs now supports Unicode Standard version 14.0.
+>>>>>>> 129b2425c79 (Make print-length & print-level in ert-run-tests-batch configurable)
+
 ** Emoji
 
 +++
diff --git a/lisp/emacs-lisp/backtrace.el b/lisp/emacs-lisp/backtrace.el
index a5721aa3193..90201442f08 100644
--- a/lisp/emacs-lisp/backtrace.el
+++ b/lisp/emacs-lisp/backtrace.el
@@ -55,9 +55,9 @@ backtrace-fontify
 (defcustom backtrace-line-length 5000
   "Target length for lines in Backtrace buffers.
 Backtrace mode will attempt to abbreviate printing of backtrace
-frames to make them shorter than this, but success is not
-guaranteed.  If set to nil or zero, Backtrace mode will not
-abbreviate the forms it prints."
+frames by setting `print-level' & `print-length' to make them
+shorter than this, but success is not guaranteed.  If set to nil
+or zero, Backtrace mode will not abbreviate the forms it prints."
   :type 'integer
   :group 'backtrace
   :version "27.1")
@@ -751,6 +751,13 @@ backtrace--print-flags
     (insert (make-string (- backtrace--flags-width (- (point) beg)) ?\s))
     (put-text-property beg (point) 'backtrace-section 'func)))
 
+(defun backtrace--line-length-or-nil ()
+  "Return `backtrace-line-length' if valid, nil else."
+  ;; mirror the logic in `cl-print-to-string-with-limits'
+  (and (natnump backtrace-line-length)
+       (not (zerop backtrace-line-length))
+       backtrace-line-length))
+
 (defun backtrace--print-func-and-args (frame _view)
   "Print the function, arguments and buffer position of a backtrace FRAME.
 Format it according to VIEW."
@@ -769,11 +776,13 @@ backtrace--print-func-and-args
       (if (atom fun)
           (funcall backtrace-print-function fun)
         (insert
-         (backtrace--print-to-string fun (when args (/ backtrace-line-length 2)))))
+         (backtrace--print-to-string fun (when (and args (backtrace--line-length-or-nil)) (/ backtrace-line-length 2)))))
       (if args
           (insert (backtrace--print-to-string
-                   args (max (truncate (/ backtrace-line-length 5))
-                             (- backtrace-line-length (- (point) beg)))))
+                   args
+                   (if (backtrace--line-length-or-nil)
+                       (max (truncate (/ backtrace-line-length 5))
+                            (- backtrace-line-length (- (point) beg))))))
         ;; The backtrace-form property is so that backtrace-multi-line
         ;; will find it.  backtrace-multi-line doesn't do anything
         ;; useful with it, just being consistent.
diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el
index 8ebc81fd418..9659c55cb64 100644
--- a/lisp/emacs-lisp/ert.el
+++ b/lisp/emacs-lisp/ert.el
@@ -77,6 +77,37 @@ ert-batch-backtrace-right-margin
 Use nil for no limit (caution: backtrace lines can be very long)."
   :type '(choice (const :tag "No truncation" nil) integer))
 
+(defvar ert-batch-print-length 10
+  "`print-length' setting used in `ert-run-tests-batch'.
+
+When formatting lists in test conditions, `print-length' will be
+temporarily set to this value.  See also
+`ert-batch-backtrace-line-length' for its effect on stack
+traces.")
+
+(defvar ert-batch-print-level 5
+  "`print-level' setting used in `ert-run-tests-batch'.
+
+When formatting lists in test conditions, `print-level' will be
+temporarily set to this value.  See also
+`ert-batch-backtrace-line-length' for its effect on stack
+traces.")
+
+(defvar ert-batch-backtrace-line-length t
+  "Target length for lines in ERT batch backtraces.
+
+Even modest settings for `print-length' & `print-level' can
+produce extremely long lines in backtraces & lengthy delays in
+forming them.  This variable governs the target maximum line
+length by manipulating these two variables while printing stack
+traces.  Setting this variable to t will re-use the value of
+`backtrace-line-length' while print stack traces in ERT batch
+mode.  A value of nil will short-circuit this mechanism; line
+lengths will be completely determined by `ert-batch-line-length'
+& `ert-batch-line-level'.  Any other value will be temporarily
+bound to `backtrace-line-length' when producing stack traces
+in batch mode.")
+
 (defface ert-test-result-expected '((((class color) (background light))
                                      :background "green1")
                                     (((class color) (background dark))
@@ -1402,8 +1433,7 @@ ert-run-tests-batch
                                       (ert-reason-for-test-result result)
                                     ""))))
               (message "%s" "")))))
-       (test-started
-        )
+       (test-started)
        (test-ended
         (cl-destructuring-bind (stats test result) event-args
           (unless (ert-test-result-expected-p test result)
@@ -1413,8 +1443,15 @@ ert-run-tests-batch
               (ert-test-result-with-condition
                (message "Test %S backtrace:" (ert-test-name test))
                (with-temp-buffer
-                 (insert (backtrace-to-string
-                          (ert-test-result-with-condition-backtrace result)))
+                 (let ((backtrace-line-length
+                        (cond
+                         ((eq ert-batch-backtrace-line-length t) backtrace-line-length)
+                         ((eq ert-batch-backtrace-line-length nil) nil)
+                         (t ert-batch-backtrace-line-length)))
+                       (print-level ert-batch-print-level)
+                       (print-length ert-batch-print-length))
+                   (insert (backtrace-to-string
+                            (ert-test-result-with-condition-backtrace result))))
                  (if (not ert-batch-backtrace-right-margin)
                      (message "%s"
                               (buffer-substring-no-properties (point-min)
@@ -1433,8 +1470,8 @@ ert-run-tests-batch
                  (ert--insert-infos result)
                  (insert "    ")
                  (let ((print-escape-newlines t)
-                       (print-level 5)
-                       (print-length 10))
+                       (print-level ert-batch-print-level)
+                       (print-length ert-batch-print-length))
                    (ert--pp-with-indentation-and-newline
                     (ert-test-result-with-condition-condition result)))
                  (goto-char (1- (point-max)))
@@ -1962,13 +1999,13 @@ ert--results-font-lock-function
   (ewoc-refresh ert--results-ewoc)
   (font-lock-default-function enabledp))
 
-(defun ert--setup-results-buffer (stats listener buffer-name)
+(defvar ert--output-buffer-name "*ert*")
+
+(defun ert--setup-results-buffer (stats listener)
   "Set up a test results buffer.
 
-STATS is the stats object; LISTENER is the results listener;
-BUFFER-NAME, if non-nil, is the buffer name to use."
-  (unless buffer-name (setq buffer-name "*ert*"))
-  (let ((buffer (get-buffer-create buffer-name)))
+STATS is the stats object; LISTENER is the results listener."
+  (let ((buffer (get-buffer-create ert--output-buffer-name)))
     (with-current-buffer buffer
       (let ((inhibit-read-only t))
         (buffer-disable-undo)
@@ -2000,18 +2037,11 @@ ert--setup-results-buffer
 (defvar ert--selector-history nil
   "List of recent test selectors read from terminal.")
 
-;; 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)
+(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'.
-OUTPUT-BUFFER-NAME and MESSAGE-FN should normally be nil; they
-are used for automated self-tests and specify which buffer to use
-and how to display message."
+SELECTOR works as described in `ert-select-tests'."
   (interactive
    (list (let ((default (if ert--selector-history
                             ;; Can't use `first' here as this form is
@@ -2024,23 +2054,17 @@ ert-run-tests-interactively
                              obarray #'ert-test-boundp nil nil
                              'ert--selector-history default nil)))
          nil))
-  (unless message-fn (setq message-fn 'message))
-  (let ((output-buffer-name output-buffer-name)
-        buffer
-        listener
-        (message-fn message-fn))
+  (let (buffer listener)
     (setq listener
           (lambda (event-type &rest event-args)
             (cl-ecase event-type
               (run-started
                (cl-destructuring-bind (stats) event-args
-                 (setq buffer (ert--setup-results-buffer stats
-                                                         listener
-                                                         output-buffer-name))
+                 (setq buffer (ert--setup-results-buffer stats listener))
                  (pop-to-buffer buffer)))
               (run-ended
                (cl-destructuring-bind (stats abortedp) event-args
-                 (funcall message-fn
+                 (message
                           "%sRan %s tests, %s results were as expected%s%s"
                           (if (not abortedp)
                               ""
diff --git a/test/lisp/emacs-lisp/ert-tests.el b/test/lisp/emacs-lisp/ert-tests.el
index 79576d24032..f783532aaff 100644
--- a/test/lisp/emacs-lisp/ert-tests.el
+++ b/test/lisp/emacs-lisp/ert-tests.el
@@ -39,10 +39,11 @@ ert-test-body-runs
 (defun ert-self-test ()
   "Run ERT's self-tests and make sure they actually ran."
   (let ((window-configuration (current-window-configuration)))
-    (let ((ert--test-body-was-run nil))
+    (let ((ert--test-body-was-run nil)
+          (ert--output-buffer-name " *ert self-tests*"))
       ;; The buffer name chosen here should not compete with the default
       ;; results buffer name for completion in `switch-to-buffer'.
-      (let ((stats (ert-run-tests-interactively "^ert-" " *ert self-tests*")))
+      (let ((stats (ert-run-tests-interactively "^ert-")))
         (cl-assert ert--test-body-was-run)
         (if (zerop (ert-stats-completed-unexpected stats))
             ;; Hide results window only when everything went well.
@@ -519,17 +520,17 @@ ert-test-run-tests-interactively
                                      :body (lambda () (ert-skip
                                                        "skip message")))))
     (let ((ert-debug-on-error nil))
-      (let* ((buffer-name (generate-new-buffer-name " *ert-test-run-tests*"))
-             (messages nil)
-             (mock-message-fn
-              (lambda (format-string &rest args)
-                (push (apply #'format format-string args) messages))))
+      (cl-letf* ((buffer-name (generate-new-buffer-name " *ert-test-run-tests*"))
+                 (ert--output-buffer-name buffer-name)
+                 (messages nil)
+                 ((symbol-function 'message)
+                  (lambda (format-string &rest args)
+                    (push (apply #'format format-string args) messages))))
         (save-window-excursion
           (unwind-protect
               (let ((case-fold-search nil))
                 (ert-run-tests-interactively
-                 `(member ,passing-test ,failing-test, skipped-test) buffer-name
-                 mock-message-fn)
+                 `(member ,passing-test ,failing-test, skipped-test))
                 (should (equal messages `(,(concat
                                             "Ran 3 tests, 1 results were "
                                             "as expected, 1 unexpected, "
@@ -551,6 +552,68 @@ ert-test-run-tests-interactively
             (when (get-buffer buffer-name)
               (kill-buffer buffer-name))))))))
 
+(ert-deftest ert-test-run-tests-batch ()
+  (let* ((complex-list '((:1 (:2 (:3 (:4 (:5 (:6 "abc"))))))))
+	 (long-list (make-list 11 1))
+	 (failing-test-1
+          (make-ert-test :name 'failing-test-1
+			 :body (lambda () (should (equal complex-list 1)))))
+	 (failing-test-2
+          (make-ert-test :name 'failing-test-2
+			 :body (lambda () (should (equal long-list 1))))))
+    (let ((ert-debug-on-error nil)
+          messages)
+      (cl-letf* (((symbol-function 'message)
+                  (lambda (format-string &rest args)
+                    (push (apply #'format format-string args) messages))))
+        (save-window-excursion
+          (unwind-protect
+              (let ((case-fold-search nil)
+                    (ert-batch-backtrace-right-margin nil)
+		    (ert-batch-print-level 10)
+		    (ert-batch-print-length 11))
+                (ert-run-tests-batch
+                 `(member ,failing-test-1 ,failing-test-2))))))
+      (let ((long-text "(different-types[ \t\n]+(1 1 1 1 1 1 1 1 1 1 1)[ \t\n]+1)))[ \t\n]*$")
+	    (complex-text "(different-types[ \t\n]+((:1[ \t\n]+(:2[ \t\n]+(:3[ \t\n]+(:4[ \t\n]+(:5[ \t\n]+(:6[ \t\n]+\"abc\")))))))[ \t\n]+1)))[ \t\n]*$")
+            found-long
+	    found-complex)
+	(cl-loop for msg in (reverse messages)
+		 do
+		 (unless found-long
+		   (setq found-long (string-match long-text msg)))
+		 (unless found-complex
+		   (setq found-complex (string-match complex-text msg))))
+	(should found-long)
+	(should found-complex)))))
+
+(ert-deftest ert-test-run-tests-batch-expensive ()
+  (let* ((complex-list '((:1 (:2 (:3 (:4 (:5 (:6 "abc"))))))))
+	 (failing-test-1
+          (make-ert-test :name 'failing-test-1
+			 :body (lambda () (should (equal complex-list 1))))))
+    (let ((ert-debug-on-error nil)
+          messages)
+      (cl-letf* (((symbol-function 'message)
+                  (lambda (format-string &rest args)
+                    (push (apply #'format format-string args) messages))))
+        (save-window-excursion
+          (unwind-protect
+              (let ((case-fold-search nil)
+                    (ert-batch-backtrace-right-margin nil)
+                    (ert-batch-backtrace-line-length nil)
+		    (ert-batch-print-level 6)
+		    (ert-batch-print-length 11))
+                (ert-run-tests-batch
+                 `(member ,failing-test-1))))))
+      (let ((frame "ert-fail(((should (equal complex-list 1)) :form (equal ((:1 (:2 (:3 (:4 (:5 (:6 \"abc\"))))))) 1) :value nil :explanation (different-types ((:1 (:2 (:3 (:4 (:5 (:6 \"abc\"))))))) 1)))")
+            found-frame)
+	(cl-loop for msg in (reverse messages)
+		 do
+		 (unless found-frame
+		   (setq found-frame (cl-search frame msg :test 'equal))))
+        (should found-frame)))))
+
 (ert-deftest ert-test-special-operator-p ()
   (should (ert--special-operator-p 'if))
   (should-not (ert--special-operator-p 'car))
diff --git a/test/lisp/emacs-lisp/ert-x-tests.el b/test/lisp/emacs-lisp/ert-x-tests.el
index 9baa9941586..1001525dee9 100644
--- a/test/lisp/emacs-lisp/ert-x-tests.el
+++ b/test/lisp/emacs-lisp/ert-x-tests.el
@@ -103,23 +103,24 @@ ert-propertized-string
 
 (ert-deftest ert-test-run-tests-interactively-2 ()
   :tags '(:causes-redisplay)
-  (let* ((passing-test (make-ert-test :name 'passing-test
-                                      :body (lambda () (ert-pass))))
-         (failing-test (make-ert-test :name 'failing-test
-                                      :body (lambda ()
-                                              (ert-info ((propertize "foo\nbar"
-                                                                     'a 'b))
-                                                (ert-fail
-                                                 "failure message")))))
-         (skipped-test (make-ert-test :name 'skipped-test
-                                      :body (lambda () (ert-skip
-							"skip message"))))
-         (ert-debug-on-error nil)
-         (buffer-name (generate-new-buffer-name "*ert-test-run-tests*"))
-         (messages nil)
-         (mock-message-fn
-          (lambda (format-string &rest args)
-            (push (apply #'format format-string args) messages))))
+  (cl-letf* ((passing-test (make-ert-test :name 'passing-test
+                                          :body (lambda () (ert-pass))))
+             (failing-test (make-ert-test :name 'failing-test
+                                          :body (lambda ()
+                                                  (ert-info ((propertize "foo\nbar"
+                                                                         'a 'b))
+                                                            (ert-fail
+                                                             "failure message")))))
+             (skipped-test (make-ert-test :name 'skipped-test
+                                          :body (lambda () (ert-skip
+							    "skip message"))))
+             (ert-debug-on-error nil)
+             (messages nil)
+             (buffer-name (generate-new-buffer-name "*ert-test-run-tests*"))
+             ((symbol-function 'message)
+              (lambda (format-string &rest args)
+                (push (apply #'format format-string args) messages)))
+             (ert--output-buffer-name buffer-name))
     (cl-flet ((expected-string (with-font-lock-p)
                 (ert-propertized-string
                  "Selector: (member <passing-test> <failing-test> "
@@ -152,14 +153,12 @@ ert-test-run-tests-interactively-2
                  "failing-test"
                  nil "\n    Info: " '(a b) "foo\n"
                  nil "          " '(a b) "bar"
-                 nil "\n    (ert-test-failed \"failure message\")\n\n\n"
-                 )))
+                 nil "\n    (ert-test-failed \"failure message\")\n\n\n")))
       (save-window-excursion
         (unwind-protect
             (let ((case-fold-search nil))
               (ert-run-tests-interactively
-               `(member ,passing-test ,failing-test ,skipped-test) buffer-name
-               mock-message-fn)
+               `(member ,passing-test ,failing-test ,skipped-test))
               (should (equal messages `(,(concat
                                           "Ran 3 tests, 1 results were "
                                           "as expected, 1 unexpected, "
-- 
2.33.1


--=-=-=
Content-Type: text/plain; format=flowed

-- 
Michael <sp1ff@HIDDEN>

--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51037; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 14 Nov 2021 02:55:36 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Nov 13 21:55:36 2021
Received: from localhost ([127.0.0.1]:48720 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mm5g6-0002Hv-QQ
	for submit <at> debbugs.gnu.org; Sat, 13 Nov 2021 21:55:36 -0500
Received: from lists.gnu.org ([209.51.188.17]:41944)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <sp1ff@HIDDEN>) id 1mm5g1-0002Ha-O5
 for submit <at> debbugs.gnu.org; Sat, 13 Nov 2021 21:55:33 -0500
Received: from eggs.gnu.org ([209.51.188.92]:52294)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <sp1ff@HIDDEN>) id 1mm5g1-0003eC-Fw
 for bug-gnu-emacs@HIDDEN; Sat, 13 Nov 2021 21:55:29 -0500
Received: from transit01.runbox.com ([91.220.196.211]:56664)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <sp1ff@HIDDEN>) id 1mm5fx-0001d8-Rz
 for bug-gnu-emacs@HIDDEN; Sat, 13 Nov 2021 21:55:29 -0500
Received: from aibo.runbox.com ([185.226.149.25])
 by transit01.runbox.com with esmtps (TLS1.2) tls
 TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93)
 (envelope-from <sp1ff@HIDDEN>)
 id 1mm5fs-005vhG-NT; Sun, 14 Nov 2021 03:55:20 +0100
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=runbox.com; 
 s=selector1;
 h=Content-Type:MIME-Version:Message-ID:Date:In-reply-to:Subject
 :Cc:To:From:References; bh=OtkcJcC2hWYGWKZpJ4/NFaEO5TTHkOyDY0vULUzwC4k=; b=a8
 A6eouf8gjozxB1LZlrLoeT2TcRc7jHj0AosM9ql25HC7uo9ptAL9KzBH3Quuh1X3XhAZKZ8L9v3Oz
 qBvEuWOvDZoMYUcgiKdrWQjoqh/uEkfZRSDlVf0+P/aOYsShqA0VKtRjw2ma4bjbTD3lhzostKpug
 VIM0llGYQOe/hqqzWs8BXQPVGaGXTEkGgptMzUlaHg6KDoYkpGDgCRQPWaPgpNVLFXBacmfLnwUn4
 k/8aI2w+p8tHU094ldPgWYyrC4+nY6RPRPpmuXsMcgXwBGL8SdyiloJAfWe/UbCoaPgvFAaOUC3wU
 Jbyj+LLTo2WdTZI2pFcNW7qOvlAEXpiw==;
Received: from [10.9.9.74] (helo=submission03.runbox)
 by mailtransmit03.runbox with esmtp (Exim 4.86_2)
 (envelope-from <sp1ff@HIDDEN>)
 id 1mm5fr-0001lV-Ql; Sun, 14 Nov 2021 03:55:19 +0100
Received: by submission03.runbox with esmtpsa [Authenticated ID (942723)]
 (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1)
 id 1mm5fk-0007qu-07; Sun, 14 Nov 2021 03:55:12 +0100
References: <86tuhvmtpl.fsf@HIDDEN> <877deqec10.fsf@HIDDEN>
 <83fste2u4i.fsf@HIDDEN> <87ily94662.fsf@HIDDEN>
 <83fstd1bth.fsf@HIDDEN> <87czogslm4.fsf@HIDDEN>
 <86ily2mjtq.fsf@HIDDEN> <87r1cp89o4.fsf@HIDDEN>
 <86fst5m48v.fsf@HIDDEN> <87a6jd5891.fsf@HIDDEN>
 <86mtmykxro.fsf@HIDDEN> <87y26hz24c.fsf@HIDDEN>
 <86bl3blcgm.fsf@HIDDEN> <87wnlya9sj.fsf@HIDDEN>
User-agent: mu4e 1.4.15; emacs 28.0.50
From: Michael <sp1ff@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
Subject: Re: bug#51037: [PATCH] Make `print-level` & `print-length`
 customizable in ERT batch tests
In-reply-to: <87wnlya9sj.fsf@HIDDEN>
Date: Sat, 13 Nov 2021 18:55:08 -0800
Message-ID: <86wnlbmooj.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
Received-SPF: pass client-ip=91.220.196.211; envelope-from=sp1ff@HIDDEN;
 helo=transit01.runbox.com
X-Spam_score_int: -27
X-Spam_score: -2.8
X-Spam_bar: --
X-Spam_report: (-2.8 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001,
 SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.4 (-)
X-Debbugs-Envelope-To: submit
Cc: gazally@HIDDEN, bug-gnu-emacs@HIDDEN, 51037 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.4 (--)

--=-=-=
Content-Type: text/plain; format=flowed


Lars Ingebrigtsen <larsi@HIDDEN> writes:

> Michael <sp1ff@HIDDEN> writes:
>
>> I was thinking to augment the docstring for
>> `backtrace-line-lenght' to note that print-level & print-length
>> will be overiden to honor it.
>
> Sounds good.
>
>> The problem is that I can't know a priori how big I have to set
>> them in order to honor print-level & print-length.
>
> No, but I thought the issue was with the corner case where we're 
> almost
> up against the limit already?  To work around that, doubling the 
> limit
> is fine in this context.
>
>> I think I can short-circuit this entirely by setting
>> `backtrace-line-length' to nil or zero before printing the 
>> backtrace
>> from ert. eval-level shouldn't enter into it I think; the 
>> concern was
>> that if code exceeded max-lisp-eval-depth, and the debugger was
>> triggered, *then* backtrace.el might have problems. Do you see 
>> a
>> reason to be concerned outside of that corner case?
>
> If that works without upping the limit, then that's fine.

OK-- here's the revised patch.

Gemini was on to something-- even modest settings for print-level
& print-length can produce *extremely* long lines in backtraces,
with corresponding execution pauses. So I:

  - fixed the minor error in backtrace.el so that setting
    backtrace-length to nil has the desired effect (i.e. removing
    any line length limitation)
  - introduced a third variable ert-batch-backtrace-line-length,
    with the following permissible values:
    - nil: remove any limitation on backtrace line length (full
    backtraces)
    - t: just use the value of backtrace-line-length
    - positive int: use this value to limit line lengths in
    backtraces



--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0001-Make-print-length-print-level-in-ert-run-tests-batch.patch
Content-Description: Updated patch for ert-batch-print-length & -level

From e256f6ff60547bb08e17f99f7eb5e9f08607ea17 Mon Sep 17 00:00:00 2001
From: Michael Herstine <sp1ff@HIDDEN>
Date: Tue, 5 Oct 2021 06:53:02 -0700
Subject: [PATCH] Make print-length & print-level in ert-run-tests-batch
 configurable

This commit introduces two new ert variables (ert-batch-print-length
and ert-batch-print-level) that make these settings configurable.  It
also adds an optional message-fn parameter to ert-batch-test (in the
style of of ert-run-tests-interactively) to facilitate testing.

Since even modest values of print-level & print-length can produce
extremely long lines in backtraces along with correspondingly long
processing times to format them, this commit also introduces the
variable ert-backtrace-line-length which, can optionally, override
backtrace-line-length during ert batch test stack traces.

* lisp/emacs-lisp/ert.el (ert-batch-print-length, ert-batch-print-level,
ert-batch-backtrace-line-length, ert-batch-test,
ert-run-tests-interactively): Added the three variables, bound them to
these settings when formatting batch test results including backtraces.
Removed the optional parameters output-buffer & message-fn from
ert-run-tests-interactively.
* test/lisp/emacs-lisp/ert-tests.el (ert-test-run-tests-interactively,
ert-test-run-tests-batch): use cl-letf to capture output, new tests
resp.
* test/lisp/ert-x-tests.el (ert-test-run-tests-interactively-2):
Changed to use cl-letf to capture output instead of using message-fn.
* lisp/emacs-lisp/backtrace.el (backtrace--line-length-or-nil,
backtrace--print-func-and-args): Fixed a bug when setting
backtrace-line-length to nil by adding a new function to check
for that case & having backtrace--print-func-and-args use it.
* doc/misc/ert.texi: document the new variables & their usage
---
 doc/misc/ert.texi                   | 25 +++++++++
 etc/NEWS                            |  8 +++
 lisp/emacs-lisp/backtrace.el        | 21 +++++---
 lisp/emacs-lisp/ert.el              | 82 +++++++++++++++++++----------
 test/lisp/emacs-lisp/ert-tests.el   | 81 ++++++++++++++++++++++++----
 test/lisp/emacs-lisp/ert-x-tests.el | 41 +++++++--------
 6 files changed, 193 insertions(+), 65 deletions(-)

diff --git a/doc/misc/ert.texi b/doc/misc/ert.texi
index 440c61add8e..522b09dd617 100644
--- a/doc/misc/ert.texi
+++ b/doc/misc/ert.texi
@@ -390,6 +390,31 @@ Running Tests in Batch Mode
 emacs -batch -l ert -f ert-summarize-tests-batch-and-exit output.log
 @end example
 
+@vindex ert-batch-print-level
+@vindex ert-batch-print-length
+ERT attempts to limit the output size for failed tests by choosing
+conservative values for @code{print-level} & @code{print-length}
+when printing Lisp values.  This can in some cases make it difficult
+to see which portions of those values are incorrect.  Use
+@code{ert-batch-print-level} and @code{ert-batch-print-length}
+to customize that:
+
+@example
+emacs -batch -l ert -l my-tests.el \
+      --eval "(let ((ert-batch-print-level 10) \
+                    (ert-batch-print-length 120)) \
+                (ert-run-tests-batch-and-exit))"
+@end example
+
+@vindex ert-batch-backtrace-line-length
+Even modest settings for @code{print-level} & @code{print-length} can
+produce extremely long lines in backtraces, however, with attendant
+pauses in execution progress. Set
+@code{ert-batch-backtrace-line-length} to t to use the value of
+@code{backtrace-line-length}, nil to stop any limitations on backtrace
+line lengths (i.e. to get full backtraces), or a positive integer to
+limit backtrace line length to that number.
+
 @vindex ert-quiet
 By default, ERT in batch mode is quite verbose, printing a line with
 result after each test.  This gives you progress information: how many
diff --git a/etc/NEWS b/etc/NEWS
index 3cad0995ac5..b315fa5be2b 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -46,6 +46,14 @@ time.
 
 * Changes in Emacs 29.1
 
++++
+** New ERT batch variables 'ert-batch-print-length' & 'ert-batch-print-level'
+These variables will override 'print-length' & 'print-level' when
+printing Lisp values in ERT batch test results.
+
+** Emacs now supports Unicode Standard version 14.0.
+>>>>>>> 129b2425c79 (Make print-length & print-level in ert-run-tests-batch configurable)
+
 ** Emoji
 
 +++
diff --git a/lisp/emacs-lisp/backtrace.el b/lisp/emacs-lisp/backtrace.el
index a5721aa3193..90201442f08 100644
--- a/lisp/emacs-lisp/backtrace.el
+++ b/lisp/emacs-lisp/backtrace.el
@@ -55,9 +55,9 @@ backtrace-fontify
 (defcustom backtrace-line-length 5000
   "Target length for lines in Backtrace buffers.
 Backtrace mode will attempt to abbreviate printing of backtrace
-frames to make them shorter than this, but success is not
-guaranteed.  If set to nil or zero, Backtrace mode will not
-abbreviate the forms it prints."
+frames by setting `print-level' & `print-length' to make them
+shorter than this, but success is not guaranteed.  If set to nil
+or zero, Backtrace mode will not abbreviate the forms it prints."
   :type 'integer
   :group 'backtrace
   :version "27.1")
@@ -751,6 +751,13 @@ backtrace--print-flags
     (insert (make-string (- backtrace--flags-width (- (point) beg)) ?\s))
     (put-text-property beg (point) 'backtrace-section 'func)))
 
+(defun backtrace--line-length-or-nil ()
+  "Return `backtrace-line-length' if valid, nil else."
+  ;; mirror the logic in `cl-print-to-string-with-limits'
+  (and (natnump backtrace-line-length)
+       (not (zerop backtrace-line-length))
+       backtrace-line-length))
+
 (defun backtrace--print-func-and-args (frame _view)
   "Print the function, arguments and buffer position of a backtrace FRAME.
 Format it according to VIEW."
@@ -769,11 +776,13 @@ backtrace--print-func-and-args
       (if (atom fun)
           (funcall backtrace-print-function fun)
         (insert
-         (backtrace--print-to-string fun (when args (/ backtrace-line-length 2)))))
+         (backtrace--print-to-string fun (when (and args (backtrace--line-length-or-nil)) (/ backtrace-line-length 2)))))
       (if args
           (insert (backtrace--print-to-string
-                   args (max (truncate (/ backtrace-line-length 5))
-                             (- backtrace-line-length (- (point) beg)))))
+                   args
+                   (if (backtrace--line-length-or-nil)
+                       (max (truncate (/ backtrace-line-length 5))
+                            (- backtrace-line-length (- (point) beg))))))
         ;; The backtrace-form property is so that backtrace-multi-line
         ;; will find it.  backtrace-multi-line doesn't do anything
         ;; useful with it, just being consistent.
diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el
index 8ebc81fd418..9659c55cb64 100644
--- a/lisp/emacs-lisp/ert.el
+++ b/lisp/emacs-lisp/ert.el
@@ -77,6 +77,37 @@ ert-batch-backtrace-right-margin
 Use nil for no limit (caution: backtrace lines can be very long)."
   :type '(choice (const :tag "No truncation" nil) integer))
 
+(defvar ert-batch-print-length 10
+  "`print-length' setting used in `ert-run-tests-batch'.
+
+When formatting lists in test conditions, `print-length' will be
+temporarily set to this value.  See also
+`ert-batch-backtrace-line-length' for its effect on stack
+traces.")
+
+(defvar ert-batch-print-level 5
+  "`print-level' setting used in `ert-run-tests-batch'.
+
+When formatting lists in test conditions, `print-level' will be
+temporarily set to this value.  See also
+`ert-batch-backtrace-line-length' for its effect on stack
+traces.")
+
+(defvar ert-batch-backtrace-line-length t
+  "Target length for lines in ERT batch backtraces.
+
+Even modest settings for `print-length' & `print-level' can
+produce extremely long lines in backtraces & lengthy delays in
+forming them.  This variable governs the target maximum line
+length by manipulating these two variables while printing stack
+traces.  Setting this variable to t will re-use the value of
+`backtrace-line-length' while print stack traces in ERT batch
+mode.  A value of nil will short-circuit this mechanism; line
+lengths will be completely determined by `ert-batch-line-length'
+& `ert-batch-line-level'.  Any other value will be temporarily
+bound to `backtrace-line-length' when producing stack traces
+in batch mode.")
+
 (defface ert-test-result-expected '((((class color) (background light))
                                      :background "green1")
                                     (((class color) (background dark))
@@ -1402,8 +1433,7 @@ ert-run-tests-batch
                                       (ert-reason-for-test-result result)
                                     ""))))
               (message "%s" "")))))
-       (test-started
-        )
+       (test-started)
        (test-ended
         (cl-destructuring-bind (stats test result) event-args
           (unless (ert-test-result-expected-p test result)
@@ -1413,8 +1443,15 @@ ert-run-tests-batch
               (ert-test-result-with-condition
                (message "Test %S backtrace:" (ert-test-name test))
                (with-temp-buffer
-                 (insert (backtrace-to-string
-                          (ert-test-result-with-condition-backtrace result)))
+                 (let ((backtrace-line-length
+                        (cond
+                         ((eq ert-batch-backtrace-line-length t) backtrace-line-length)
+                         ((eq ert-batch-backtrace-line-length nil) nil)
+                         (t ert-batch-backtrace-line-length)))
+                       (print-level ert-batch-print-level)
+                       (print-length ert-batch-print-length))
+                   (insert (backtrace-to-string
+                            (ert-test-result-with-condition-backtrace result))))
                  (if (not ert-batch-backtrace-right-margin)
                      (message "%s"
                               (buffer-substring-no-properties (point-min)
@@ -1433,8 +1470,8 @@ ert-run-tests-batch
                  (ert--insert-infos result)
                  (insert "    ")
                  (let ((print-escape-newlines t)
-                       (print-level 5)
-                       (print-length 10))
+                       (print-level ert-batch-print-level)
+                       (print-length ert-batch-print-length))
                    (ert--pp-with-indentation-and-newline
                     (ert-test-result-with-condition-condition result)))
                  (goto-char (1- (point-max)))
@@ -1962,13 +1999,13 @@ ert--results-font-lock-function
   (ewoc-refresh ert--results-ewoc)
   (font-lock-default-function enabledp))
 
-(defun ert--setup-results-buffer (stats listener buffer-name)
+(defvar ert--output-buffer-name "*ert*")
+
+(defun ert--setup-results-buffer (stats listener)
   "Set up a test results buffer.
 
-STATS is the stats object; LISTENER is the results listener;
-BUFFER-NAME, if non-nil, is the buffer name to use."
-  (unless buffer-name (setq buffer-name "*ert*"))
-  (let ((buffer (get-buffer-create buffer-name)))
+STATS is the stats object; LISTENER is the results listener."
+  (let ((buffer (get-buffer-create ert--output-buffer-name)))
     (with-current-buffer buffer
       (let ((inhibit-read-only t))
         (buffer-disable-undo)
@@ -2000,18 +2037,11 @@ ert--setup-results-buffer
 (defvar ert--selector-history nil
   "List of recent test selectors read from terminal.")
 
-;; 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)
+(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'.
-OUTPUT-BUFFER-NAME and MESSAGE-FN should normally be nil; they
-are used for automated self-tests and specify which buffer to use
-and how to display message."
+SELECTOR works as described in `ert-select-tests'."
   (interactive
    (list (let ((default (if ert--selector-history
                             ;; Can't use `first' here as this form is
@@ -2024,23 +2054,17 @@ ert-run-tests-interactively
                              obarray #'ert-test-boundp nil nil
                              'ert--selector-history default nil)))
          nil))
-  (unless message-fn (setq message-fn 'message))
-  (let ((output-buffer-name output-buffer-name)
-        buffer
-        listener
-        (message-fn message-fn))
+  (let (buffer listener)
     (setq listener
           (lambda (event-type &rest event-args)
             (cl-ecase event-type
               (run-started
                (cl-destructuring-bind (stats) event-args
-                 (setq buffer (ert--setup-results-buffer stats
-                                                         listener
-                                                         output-buffer-name))
+                 (setq buffer (ert--setup-results-buffer stats listener))
                  (pop-to-buffer buffer)))
               (run-ended
                (cl-destructuring-bind (stats abortedp) event-args
-                 (funcall message-fn
+                 (message
                           "%sRan %s tests, %s results were as expected%s%s"
                           (if (not abortedp)
                               ""
diff --git a/test/lisp/emacs-lisp/ert-tests.el b/test/lisp/emacs-lisp/ert-tests.el
index 79576d24032..f783532aaff 100644
--- a/test/lisp/emacs-lisp/ert-tests.el
+++ b/test/lisp/emacs-lisp/ert-tests.el
@@ -39,10 +39,11 @@ ert-test-body-runs
 (defun ert-self-test ()
   "Run ERT's self-tests and make sure they actually ran."
   (let ((window-configuration (current-window-configuration)))
-    (let ((ert--test-body-was-run nil))
+    (let ((ert--test-body-was-run nil)
+          (ert--output-buffer-name " *ert self-tests*"))
       ;; The buffer name chosen here should not compete with the default
       ;; results buffer name for completion in `switch-to-buffer'.
-      (let ((stats (ert-run-tests-interactively "^ert-" " *ert self-tests*")))
+      (let ((stats (ert-run-tests-interactively "^ert-")))
         (cl-assert ert--test-body-was-run)
         (if (zerop (ert-stats-completed-unexpected stats))
             ;; Hide results window only when everything went well.
@@ -519,17 +520,17 @@ ert-test-run-tests-interactively
                                      :body (lambda () (ert-skip
                                                        "skip message")))))
     (let ((ert-debug-on-error nil))
-      (let* ((buffer-name (generate-new-buffer-name " *ert-test-run-tests*"))
-             (messages nil)
-             (mock-message-fn
-              (lambda (format-string &rest args)
-                (push (apply #'format format-string args) messages))))
+      (cl-letf* ((buffer-name (generate-new-buffer-name " *ert-test-run-tests*"))
+                 (ert--output-buffer-name buffer-name)
+                 (messages nil)
+                 ((symbol-function 'message)
+                  (lambda (format-string &rest args)
+                    (push (apply #'format format-string args) messages))))
         (save-window-excursion
           (unwind-protect
               (let ((case-fold-search nil))
                 (ert-run-tests-interactively
-                 `(member ,passing-test ,failing-test, skipped-test) buffer-name
-                 mock-message-fn)
+                 `(member ,passing-test ,failing-test, skipped-test))
                 (should (equal messages `(,(concat
                                             "Ran 3 tests, 1 results were "
                                             "as expected, 1 unexpected, "
@@ -551,6 +552,68 @@ ert-test-run-tests-interactively
             (when (get-buffer buffer-name)
               (kill-buffer buffer-name))))))))
 
+(ert-deftest ert-test-run-tests-batch ()
+  (let* ((complex-list '((:1 (:2 (:3 (:4 (:5 (:6 "abc"))))))))
+	 (long-list (make-list 11 1))
+	 (failing-test-1
+          (make-ert-test :name 'failing-test-1
+			 :body (lambda () (should (equal complex-list 1)))))
+	 (failing-test-2
+          (make-ert-test :name 'failing-test-2
+			 :body (lambda () (should (equal long-list 1))))))
+    (let ((ert-debug-on-error nil)
+          messages)
+      (cl-letf* (((symbol-function 'message)
+                  (lambda (format-string &rest args)
+                    (push (apply #'format format-string args) messages))))
+        (save-window-excursion
+          (unwind-protect
+              (let ((case-fold-search nil)
+                    (ert-batch-backtrace-right-margin nil)
+		    (ert-batch-print-level 10)
+		    (ert-batch-print-length 11))
+                (ert-run-tests-batch
+                 `(member ,failing-test-1 ,failing-test-2))))))
+      (let ((long-text "(different-types[ \t\n]+(1 1 1 1 1 1 1 1 1 1 1)[ \t\n]+1)))[ \t\n]*$")
+	    (complex-text "(different-types[ \t\n]+((:1[ \t\n]+(:2[ \t\n]+(:3[ \t\n]+(:4[ \t\n]+(:5[ \t\n]+(:6[ \t\n]+\"abc\")))))))[ \t\n]+1)))[ \t\n]*$")
+            found-long
+	    found-complex)
+	(cl-loop for msg in (reverse messages)
+		 do
+		 (unless found-long
+		   (setq found-long (string-match long-text msg)))
+		 (unless found-complex
+		   (setq found-complex (string-match complex-text msg))))
+	(should found-long)
+	(should found-complex)))))
+
+(ert-deftest ert-test-run-tests-batch-expensive ()
+  (let* ((complex-list '((:1 (:2 (:3 (:4 (:5 (:6 "abc"))))))))
+	 (failing-test-1
+          (make-ert-test :name 'failing-test-1
+			 :body (lambda () (should (equal complex-list 1))))))
+    (let ((ert-debug-on-error nil)
+          messages)
+      (cl-letf* (((symbol-function 'message)
+                  (lambda (format-string &rest args)
+                    (push (apply #'format format-string args) messages))))
+        (save-window-excursion
+          (unwind-protect
+              (let ((case-fold-search nil)
+                    (ert-batch-backtrace-right-margin nil)
+                    (ert-batch-backtrace-line-length nil)
+		    (ert-batch-print-level 6)
+		    (ert-batch-print-length 11))
+                (ert-run-tests-batch
+                 `(member ,failing-test-1))))))
+      (let ((frame "ert-fail(((should (equal complex-list 1)) :form (equal ((:1 (:2 (:3 (:4 (:5 (:6 \"abc\"))))))) 1) :value nil :explanation (different-types ((:1 (:2 (:3 (:4 (:5 (:6 \"abc\"))))))) 1)))")
+            found-frame)
+	(cl-loop for msg in (reverse messages)
+		 do
+		 (unless found-frame
+		   (setq found-frame (cl-search frame msg :test 'equal))))
+        (should found-frame)))))
+
 (ert-deftest ert-test-special-operator-p ()
   (should (ert--special-operator-p 'if))
   (should-not (ert--special-operator-p 'car))
diff --git a/test/lisp/emacs-lisp/ert-x-tests.el b/test/lisp/emacs-lisp/ert-x-tests.el
index 9baa9941586..1001525dee9 100644
--- a/test/lisp/emacs-lisp/ert-x-tests.el
+++ b/test/lisp/emacs-lisp/ert-x-tests.el
@@ -103,23 +103,24 @@ ert-propertized-string
 
 (ert-deftest ert-test-run-tests-interactively-2 ()
   :tags '(:causes-redisplay)
-  (let* ((passing-test (make-ert-test :name 'passing-test
-                                      :body (lambda () (ert-pass))))
-         (failing-test (make-ert-test :name 'failing-test
-                                      :body (lambda ()
-                                              (ert-info ((propertize "foo\nbar"
-                                                                     'a 'b))
-                                                (ert-fail
-                                                 "failure message")))))
-         (skipped-test (make-ert-test :name 'skipped-test
-                                      :body (lambda () (ert-skip
-							"skip message"))))
-         (ert-debug-on-error nil)
-         (buffer-name (generate-new-buffer-name "*ert-test-run-tests*"))
-         (messages nil)
-         (mock-message-fn
-          (lambda (format-string &rest args)
-            (push (apply #'format format-string args) messages))))
+  (cl-letf* ((passing-test (make-ert-test :name 'passing-test
+                                          :body (lambda () (ert-pass))))
+             (failing-test (make-ert-test :name 'failing-test
+                                          :body (lambda ()
+                                                  (ert-info ((propertize "foo\nbar"
+                                                                         'a 'b))
+                                                            (ert-fail
+                                                             "failure message")))))
+             (skipped-test (make-ert-test :name 'skipped-test
+                                          :body (lambda () (ert-skip
+							    "skip message"))))
+             (ert-debug-on-error nil)
+             (messages nil)
+             (buffer-name (generate-new-buffer-name "*ert-test-run-tests*"))
+             ((symbol-function 'message)
+              (lambda (format-string &rest args)
+                (push (apply #'format format-string args) messages)))
+             (ert--output-buffer-name buffer-name))
     (cl-flet ((expected-string (with-font-lock-p)
                 (ert-propertized-string
                  "Selector: (member <passing-test> <failing-test> "
@@ -152,14 +153,12 @@ ert-test-run-tests-interactively-2
                  "failing-test"
                  nil "\n    Info: " '(a b) "foo\n"
                  nil "          " '(a b) "bar"
-                 nil "\n    (ert-test-failed \"failure message\")\n\n\n"
-                 )))
+                 nil "\n    (ert-test-failed \"failure message\")\n\n\n")))
       (save-window-excursion
         (unwind-protect
             (let ((case-fold-search nil))
               (ert-run-tests-interactively
-               `(member ,passing-test ,failing-test ,skipped-test) buffer-name
-               mock-message-fn)
+               `(member ,passing-test ,failing-test ,skipped-test))
               (should (equal messages `(,(concat
                                           "Ran 3 tests, 1 results were "
                                           "as expected, 1 unexpected, "
-- 
2.33.1


--=-=-=
Content-Type: text/plain; format=flowed

-- 
Michael <sp1ff@HIDDEN>

--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51037; Package emacs. Full text available.

Message received at 51037 <at> debbugs.gnu.org:


Received: (at 51037) by debbugs.gnu.org; 27 Oct 2021 13:15:35 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Oct 27 09:15:34 2021
Received: from localhost ([127.0.0.1]:48691 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mfimE-00051g-NV
	for submit <at> debbugs.gnu.org; Wed, 27 Oct 2021 09:15:34 -0400
Received: from quimby.gnus.org ([95.216.78.240]:51488)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1mfimD-0004w8-4N
 for 51037 <at> debbugs.gnu.org; Wed, 27 Oct 2021 09:15:33 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=H8Ae3/O/C3P5EqrHIE3bSNfD3xUzPgeQ7zxGwB3+LNg=; b=gCTsMi/TXe/tkzKlOXUK65vxEE
 IaKBB56i8k4o5Aovrz3orqwMw1KAYwuA59bsUyK213Em5HJh2xneY9RRM8enntX7S7+ykwlBbO34d
 rfJTuJZfHJci90dgLLh/60K9glNbWQXJ6625ok2f5hxg2Qec3eNtd9lItC/nf1FBEXOY=;
Received: from [84.212.220.105] (helo=elva)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1mfim4-00062u-O0; Wed, 27 Oct 2021 15:15:27 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Michael <sp1ff@HIDDEN>
Subject: Re: bug#51037: [PATCH] Make `print-level` & `print-length`
 customizable in ERT batch tests
References: <86tuhvmtpl.fsf@HIDDEN> <877deqec10.fsf@HIDDEN>
 <83fste2u4i.fsf@HIDDEN> <87ily94662.fsf@HIDDEN>
 <83fstd1bth.fsf@HIDDEN> <87czogslm4.fsf@HIDDEN>
 <86ily2mjtq.fsf@HIDDEN> <87r1cp89o4.fsf@HIDDEN>
 <86fst5m48v.fsf@HIDDEN> <87a6jd5891.fsf@HIDDEN>
 <86mtmykxro.fsf@HIDDEN> <87y26hz24c.fsf@HIDDEN>
 <86bl3blcgm.fsf@HIDDEN>
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj
 SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAG1BMVEV7YWGAZWChdDdz
 T02DW0WUaTyLY0O/jS3////xjG5rAAAAAWJLR0QIht6VegAAAAd0SU1FB+UKGwwnNcKZZ4wAAAGo
 SURBVDjLdZRtbsMgDIZT7QI7wqRt2v/aYf9nygGWNQeoCVfo9WcbA0mlWiopPP6I4SXTVO3kz9fT
 6U2fLxO4xWowz+8272BYfgaYngE2YCOgeKljlIGDASsVK5VfIIjqBdO21JVmGBOw1Qg1ybDN5pPm
 jNHXSNfOlkEASTLegRmKA/HwELL6nBxEyKGV1uFjIY/41G1A1ggUlxt759c7SXBIGYh0P4IDomsR
 8KWtspbBBmruH50yCquAGsCNqL6WbXyPIB0QBiDvzIZQ/3iDCL0O1i3YBoDGLWL2PiRFglok2LSB
 COnCNRlaUGlnnlZGGJng1sVQgL5tq4oR7gARLnoqpfARzLKtUc8y3VpXTVekOpPi7WCarmYgzqKQ
 1qkAE5Eu4VFG02HWNWE1RHzoYggHAFfJc+Ym4Ye3El/s+urAJSog4Si+N2mDNnCJ5gi7F+U2m4g1
 cT+sdaRaII0I3NVgDr0+0qF4vYAyFBqXSOSTknkS7d/PIuTSEc73BR+B3Xk6H6/ihB8y/lFT5wBh
 latZZHHLELJILFvHrkT8XTPaxyWl+o2Bfy5i+pILZg5PAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDIx
 LTEwLTI3VDEyOjM5OjUzKzAwOjAwtrpcyQAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyMS0xMC0yN1Qx
 MjozOTo1MyswMDowMMfn5HUAAAAASUVORK5CYII=
X-Now-Playing: Aksak Maboul's _Figures (2)_: "Tout a une fin"
Date: Wed, 27 Oct 2021 15:15:24 +0200
In-Reply-To: <86bl3blcgm.fsf@HIDDEN> (Michael's message of "Tue, 26 Oct
 2021 14:10:01 -0700")
Message-ID: <87wnlya9sj.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: Michael <sp1ff@HIDDEN> writes: > I was thinking to
 augment
 the docstring for > `backtrace-line-lenght' to note that print-level &
 print-length > will be overiden to honor it. Sounds good. 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 51037
Cc: gazally@HIDDEN, Eli Zaretskii <eliz@HIDDEN>, 51037 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Michael <sp1ff@HIDDEN> writes:

> I was thinking to augment the docstring for
> `backtrace-line-lenght' to note that print-level & print-length
> will be overiden to honor it.

Sounds good.

> The problem is that I can't know a priori how big I have to set
> them in order to honor print-level & print-length.

No, but I thought the issue was with the corner case where we're almost
up against the limit already?  To work around that, doubling the limit
is fine in this context.

> I think I can short-circuit this entirely by setting
> `backtrace-line-length' to nil or zero before printing the backtrace
> from ert. eval-level shouldn't enter into it I think; the concern was
> that if code exceeded max-lisp-eval-depth, and the debugger was
> triggered, *then* backtrace.el might have problems. Do you see a
> reason to be concerned outside of that corner case?

If that works without upping the limit, then that's fine.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51037; Package emacs. Full text available.

Message received at 51037 <at> debbugs.gnu.org:


Received: (at 51037) by debbugs.gnu.org; 27 Oct 2021 13:13:20 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Oct 27 09:13:20 2021
Received: from localhost ([127.0.0.1]:48687 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mfik4-0004TD-Bx
	for submit <at> debbugs.gnu.org; Wed, 27 Oct 2021 09:13:20 -0400
Received: from quimby.gnus.org ([95.216.78.240]:51460)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1mfijz-0004Sv-F6
 for 51037 <at> debbugs.gnu.org; Wed, 27 Oct 2021 09:13:19 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=xB8KxCFPeZbOChGj2bs92OsjW/vqI7avvWSDmEk0TOU=; b=Bv2mPiWBU00XWzTpQHFp6iNHKU
 IAvqp5nCXYlPuus+CW8a1l8Jm7XvxXZhJ7B7hTq566ss88fjLIgfaeRABvUiNkJHGmIyA6gOwGn+t
 mrE7r03mEjZyvwkdDXqdd46oHCed6PhsIFujcajNw4Uzn2Dt7aFUasDRnuS5F2+8tHds=;
Received: from [84.212.220.105] (helo=elva)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1mfijp-00062O-SA; Wed, 27 Oct 2021 15:13:08 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Michael <sp1ff@HIDDEN>
Subject: Re: bug#51037: [PATCH] Make `print-level` & `print-length`
 customizable in ERT batch tests
References: <86tuhvmtpl.fsf@HIDDEN> <877deqec10.fsf@HIDDEN>
 <83fste2u4i.fsf@HIDDEN> <87ily94662.fsf@HIDDEN>
 <83fstd1bth.fsf@HIDDEN> <87czogslm4.fsf@HIDDEN>
 <86ily2mjtq.fsf@HIDDEN> <87r1cp89o4.fsf@HIDDEN>
 <86fst5m48v.fsf@HIDDEN> <87a6jd5891.fsf@HIDDEN>
 <86mtmykxro.fsf@HIDDEN> <87zgqxs1c8.fsf@HIDDEN>
 <86ee87lct4.fsf@HIDDEN>
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj
 SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAG1BMVEV7YWGAZWChdDdz
 T02DW0WUaTyLY0O/jS3////xjG5rAAAAAWJLR0QIht6VegAAAAd0SU1FB+UKGwwnNcKZZ4wAAAGo
 SURBVDjLdZRtbsMgDIZT7QI7wqRt2v/aYf9nygGWNQeoCVfo9WcbA0mlWiopPP6I4SXTVO3kz9fT
 6U2fLxO4xWowz+8272BYfgaYngE2YCOgeKljlIGDASsVK5VfIIjqBdO21JVmGBOw1Qg1ybDN5pPm
 jNHXSNfOlkEASTLegRmKA/HwELL6nBxEyKGV1uFjIY/41G1A1ggUlxt759c7SXBIGYh0P4IDomsR
 8KWtspbBBmruH50yCquAGsCNqL6WbXyPIB0QBiDvzIZQ/3iDCL0O1i3YBoDGLWL2PiRFglok2LSB
 COnCNRlaUGlnnlZGGJng1sVQgL5tq4oR7gARLnoqpfARzLKtUc8y3VpXTVekOpPi7WCarmYgzqKQ
 1qkAE5Eu4VFG02HWNWE1RHzoYggHAFfJc+Ym4Ye3El/s+urAJSog4Si+N2mDNnCJ5gi7F+U2m4g1
 cT+sdaRaII0I3NVgDr0+0qF4vYAyFBqXSOSTknkS7d/PIuTSEc73BR+B3Xk6H6/ihB8y/lFT5wBh
 latZZHHLELJILFvHrkT8XTPaxyWl+o2Bfy5i+pILZg5PAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDIx
 LTEwLTI3VDEyOjM5OjUzKzAwOjAwtrpcyQAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyMS0xMC0yN1Qx
 MjozOTo1MyswMDowMMfn5HUAAAAASUVORK5CYII=
X-Now-Playing: Aksak Maboul's _Figures (2)_: "Tout a une fin"
Date: Wed, 27 Oct 2021 15:13:05 +0200
In-Reply-To: <86ee87lct4.fsf@HIDDEN> (Michael's message of "Tue, 26 Oct
 2021 14:02:31 -0700")
Message-ID: <871r46bogu.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: Michael <sp1ff@HIDDEN> writes: > One thing: when I
 evaluate
 this: > > (let ((print-length nil) > (print-level nil) >
 (backtrace-line-length
 nil)) > (backtrace-to-string)) > > I receive the following error message:
 > > backtrace-pri [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 51037
Cc: Gemini Lasswell <gazally@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>,
 51037 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Michael <sp1ff@HIDDEN> writes:

> One thing: when I evaluate this:
>
>    (let ((print-length nil)
>          (print-level nil)
>          (backtrace-line-length nil))
>      (backtrace-to-string))
>
> I receive the following error message:
>
>    backtrace-print-frame: Wrong type argument:     number-or-marker-p,
>   nil
>
> I take it that is unexpected? It's fine if so, I'm happy to
> debug, I just want to be sure I'm not running off down the garden
> path.

nil should be a valid value for that variable, so it sounds like a bug.
Oddly enough, I'm not able to get a backtrace here...

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51037; Package emacs. Full text available.

Message received at 51037 <at> debbugs.gnu.org:


Received: (at 51037) by debbugs.gnu.org; 26 Oct 2021 21:10:34 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Oct 26 17:10:34 2021
Received: from localhost ([127.0.0.1]:47689 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mfTiM-0006YN-6P
	for submit <at> debbugs.gnu.org; Tue, 26 Oct 2021 17:10:34 -0400
Received: from transit01.runbox.com ([91.220.196.211]:57056)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <sp1ff@HIDDEN>) id 1mfTiJ-0006Y7-PM
 for 51037 <at> debbugs.gnu.org; Tue, 26 Oct 2021 17:10:32 -0400
Received: from aibo.runbox.com ([185.226.149.25])
 by transit01.runbox.com with esmtps (TLS1.2) tls
 TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93)
 (envelope-from <sp1ff@HIDDEN>)
 id 1mfTiC-000x3F-Um; Tue, 26 Oct 2021 23:10:24 +0200
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=runbox.com; 
 s=selector2;
 h=Content-Type:MIME-Version:Message-ID:Date:In-reply-to:Subject
 :Cc:To:From:References; bh=yxpohVUuxwsfrt90QAHWGmeH7IJcygMcz9sNLUqrXJo=; b=Mx
 hgIIhWUD9LYWuqdHeaoWm+RJhbY+sSwn7zFZ8Bv1JROKx3t9aMY01N7GHq6lDkpRYmQRcSd7WzhWz
 PSf3yCqOCF4N6lLrT7ouF2FCnz63vDDh10qesTAikyewyDIDUR1FApZnsCx9tiXky8ndRf4cNcwBD
 YA7qNbHhdPrz9UkdHwm6ndHhQ029RpEtndzx3HtJGB/OZOw/WBBdwexev8QMI3+YiPol7J1RkyYtS
 7wANSAyVHEwWopNyuHaSBqvHJjmlG2b9Gn3EG3SWmaF+kbmgRG4+acgLAmhPQdYCzk829DI978UXH
 EbKCLHgxwlmmo/jo9BPHtJPSN5IipGMQ==;
Received: from [10.9.9.73] (helo=submission02.runbox)
 by mailtransmit03.runbox with esmtp (Exim 4.86_2)
 (envelope-from <sp1ff@HIDDEN>)
 id 1mfTiA-0002wP-DB; Tue, 26 Oct 2021 23:10:22 +0200
Received: by submission02.runbox with esmtpsa [Authenticated ID (942723)]
 (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1)
 id 1mfTht-00005W-PI; Tue, 26 Oct 2021 23:10:06 +0200
References: <86tuhvmtpl.fsf@HIDDEN> <877deqec10.fsf@HIDDEN>
 <83fste2u4i.fsf@HIDDEN> <87ily94662.fsf@HIDDEN>
 <83fstd1bth.fsf@HIDDEN> <87czogslm4.fsf@HIDDEN>
 <86ily2mjtq.fsf@HIDDEN> <87r1cp89o4.fsf@HIDDEN>
 <86fst5m48v.fsf@HIDDEN> <87a6jd5891.fsf@HIDDEN>
 <86mtmykxro.fsf@HIDDEN> <87y26hz24c.fsf@HIDDEN>
User-agent: mu4e 1.4.15; emacs 28.0.50
From: Michael <sp1ff@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
Subject: Re: bug#51037: [PATCH] Make `print-level` & `print-length`
 customizable in ERT batch tests
In-reply-to: <87y26hz24c.fsf@HIDDEN>
Date: Tue, 26 Oct 2021 14:10:01 -0700
Message-ID: <86bl3blcgm.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; format=flowed
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 51037
Cc: gazally@HIDDEN, Eli Zaretskii <eliz@HIDDEN>, 51037 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)


Lars Ingebrigtsen <larsi@HIDDEN> writes:

> Michael <sp1ff@HIDDEN> writes:
>
>> The issue: stack traces are printed by the `backtrace`
>> package. backtrace.el was authored by Gemini (which is why I've
>> added him to this thread). backtrace.el doesn't directly work 
>> in
>> terms of `print-le{ngth,vel}`: it defines a custom variable
>> `backtrace-line-length` and then adjusts print-level &
>> print-length in let bindings in order to:
>>
>>  1. try to respect the desired line length
>>  2. not trigger bug 31919 (Lisp Debugger doesn't work when at
>>  stack limit)
>
> [...]
>
>> For myself, I was quite surprised to all learn this: I had to
>> spend a fair bit of time digging through the source to find out
>> what was happening to my settings for print-length &
>> print-level.
>
> Yeah, I didn't remember `backtrace-line-length' either.  Perhaps 
> it
> should be linked to from the doc strings of print-length and
> print-level... 

I was thinking to augment the docstring for
`backtrace-line-lenght' to note that print-level & print-length
will be overiden to honor it.

>> My personal incliniation is to remove the 
>> `backtrace-line-length`
>> variable entirely, and make the `debug` package responsible for
>> controlling print-level so as to avoid 31919. But that's me: is
>> there a compelling use-case for backtrace.el working in terms 
>> of
>> limiting line length rather than just using 
>> `print-le{ve,ength}`?
>
> Well...  if we're talking in an ert context, it could increase 
> both the
> backtrace-line-length and max-lisp-eval-depth variables when 
> gathering
> the backtrace, I think?

The problem is that I can't know a priori how big I have to set
them in order to honor print-level & print-length. I think I can
short-circuit this entirely by setting `backtrace-line-length' to
nil or zero before printing the backtrace from ert. eval-level
shouldn't enter into it I think; the concern was that if code
exceeded max-lisp-eval-depth, and the debugger was triggered,
*then* backtrace.el might have problems. Do you see a reason to
be concerned outside of that corner case?

-- 
Michael <sp1ff@HIDDEN>




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51037; Package emacs. Full text available.

Message received at 51037 <at> debbugs.gnu.org:


Received: (at 51037) by debbugs.gnu.org; 26 Oct 2021 21:02:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Oct 26 17:02:51 2021
Received: from localhost ([127.0.0.1]:47670 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mfTat-0006JK-KE
	for submit <at> debbugs.gnu.org; Tue, 26 Oct 2021 17:02:51 -0400
Received: from transit01.runbox.com ([91.220.196.211]:55496)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <sp1ff@HIDDEN>) id 1mfTar-0006J4-E8
 for 51037 <at> debbugs.gnu.org; Tue, 26 Oct 2021 17:02:51 -0400
Received: from aibo.runbox.com ([185.226.149.25])
 by transit01.runbox.com with esmtps (TLS1.2) tls
 TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93)
 (envelope-from <sp1ff@HIDDEN>)
 id 1mfTak-000vb4-T2; Tue, 26 Oct 2021 23:02:42 +0200
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=runbox.com; 
 s=selector2;
 h=Content-Type:MIME-Version:Message-ID:Date:In-reply-to:Subject
 :Cc:To:From:References; bh=U+gP+4zkeWtoNFytmskB3/C0uwV4g+k4nqaZXiDcKjw=; b=bk
 KtPmp9KaobfbqW+P3Z4wU0zEtdpXQugulLd6HsNgG26bsXCVKfV86dffUBlvB7N4BzadxThm1yVVG
 e/AoQanaHJiCmC5RJoslCIjHlbtfzk+6+oF3oir9KYHq+DTxTS7QnQqia+HazS1dzksbsOTlYLPU6
 Rzx01Iu8y2XkUhfte01r+3iP5Uwb89Q/hR77CqD8sCwpfPuXaRvS/936VSMYyMTuM9jQgQV5AmCqw
 rwXcrkWsGmEguQuXvsVihMK+S9QxX3eD+fZsL+CIfKN4EN4UE7uS6E0MfBJ1lRERYRsbwKwbucqye
 f87LXN7nNFhK4ytDQlCZGxP15BZpYXWw==;
Received: from [10.9.9.73] (helo=submission02.runbox)
 by mailtransmit02.runbox with esmtp (Exim 4.86_2)
 (envelope-from <sp1ff@HIDDEN>)
 id 1mfTai-0003Vc-Oz; Tue, 26 Oct 2021 23:02:40 +0200
Received: by submission02.runbox with esmtpsa [Authenticated ID (942723)]
 (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1)
 id 1mfTad-0007gG-D1; Tue, 26 Oct 2021 23:02:35 +0200
References: <86tuhvmtpl.fsf@HIDDEN> <877deqec10.fsf@HIDDEN>
 <83fste2u4i.fsf@HIDDEN> <87ily94662.fsf@HIDDEN>
 <83fstd1bth.fsf@HIDDEN> <87czogslm4.fsf@HIDDEN>
 <86ily2mjtq.fsf@HIDDEN> <87r1cp89o4.fsf@HIDDEN>
 <86fst5m48v.fsf@HIDDEN> <87a6jd5891.fsf@HIDDEN>
 <86mtmykxro.fsf@HIDDEN> <87zgqxs1c8.fsf@HIDDEN>
User-agent: mu4e 1.4.15; emacs 28.0.50
From: Michael <sp1ff@HIDDEN>
To: Gemini Lasswell <gazally@HIDDEN>
Subject: Re: bug#51037: [PATCH] Make `print-level` & `print-length`
 customizable in ERT batch tests
In-reply-to: <87zgqxs1c8.fsf@HIDDEN>
Date: Tue, 26 Oct 2021 14:02:31 -0700
Message-ID: <86ee87lct4.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; format=flowed
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 51037
Cc: Lars Ingebrigtsen <larsi@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>,
 51037 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)


Gemini Lasswell <gazally@HIDDEN> writes:

> Michael writes:
>
>> My personal incliniation is to remove the 
>> `backtrace-line-length`
>> variable entirely, and make the `debug` package responsible for
>> controlling print-level so as to avoid 31919. But that's me: is
>> there a compelling use-case for backtrace.el working in terms 
>> of
>> limiting line length rather than just using 
>> `print-le{ve,ength}`?
>
> The motivation for `backtrace-line-length` was to find a 
> compromise that
> made backtraces more user-friendly in interactive debugging for 
> both
> small and large data structures.  Setting `print-level` and
> `print-length` too small will create a lot of ellipses in small 
> data
> structures, making you have to expand those ellipses to see your 
> data;
> setting those variables a little bit bigger will unleash 
> exponential
> growth in line length for large data structures, causing delays 
> of
> seconds to minutes when rendering and navigating your backtrace. 
> The
> heuristics in `cl-print-to-string-with-limit` try to do a 
> reasonable job
> with both small and large data structures, so the user can get 
> on with
> debugging, rather than first having to figure out values of the 
> `print-`
> variables which will make debugging possible.
>
> Another goal of backtrace buffers is to make the data structures
> represented there be completely navigable, which is why lines 
> are not
> simply truncated.
>
> If you don't want ellipses in your backtraces, then bind
> `backtrace-line-length` to nil or zero.  If you want to see how 
> long a
> backtrace line can get, try that out with magit or org-export.

lol... I see. So you found `backtrace-line-length` to be more
ergonomic than print-level & print-length at controlling
verbosity (at least where backtraces are concerned)-- fair?

One thing: when I evaluate this:

    (let ((print-length nil)
          (print-level nil)
          (backtrace-line-length nil))
      (backtrace-to-string))

I receive the following error message:

    backtrace-print-frame: Wrong type argument: 
    number-or-marker-p, nil

I take it that is unexpected? It's fine if so, I'm happy to
debug, I just want to be sure I'm not running off down the garden
path.

-- 
Michael <sp1ff@HIDDEN>




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51037; Package emacs. Full text available.

Message received at 51037 <at> debbugs.gnu.org:


Received: (at 51037) by debbugs.gnu.org; 25 Oct 2021 13:05:20 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Oct 25 09:05:20 2021
Received: from localhost ([127.0.0.1]:41888 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mezfD-0005qQ-Mo
	for submit <at> debbugs.gnu.org; Mon, 25 Oct 2021 09:05:19 -0400
Received: from quimby.gnus.org ([95.216.78.240]:55228)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1mezfC-0005q9-AR
 for 51037 <at> debbugs.gnu.org; Mon, 25 Oct 2021 09:05:18 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=uga6PvDG/94sdrM4i4th0J2iqboRcw3Y6C7Wx9mC6D8=; b=fX79NB9B4NT6Ky0F898KW8F8lN
 JTzfdh1oUlgG0CyUpf/oMLfZJgGNNjwb9OXi+swqfB1XTNd6ikH0eNnUCI6+OjgjrUrXyB3vwXRmc
 2hZGGwL8MWZSWRplHOgxiGCejN7qujM/k48TSc9CxarFHCYMTKvKhYMG8cBTWGiGcjjs=;
Received: from [84.212.220.105] (helo=elva)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1mezf3-0001Fa-7M; Mon, 25 Oct 2021 15:05:11 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Michael <sp1ff@HIDDEN>
Subject: Re: bug#51037: [PATCH] Make `print-level` & `print-length`
 customizable in ERT batch tests
References: <86tuhvmtpl.fsf@HIDDEN> <877deqec10.fsf@HIDDEN>
 <83fste2u4i.fsf@HIDDEN> <87ily94662.fsf@HIDDEN>
 <83fstd1bth.fsf@HIDDEN> <87czogslm4.fsf@HIDDEN>
 <86ily2mjtq.fsf@HIDDEN> <87r1cp89o4.fsf@HIDDEN>
 <86fst5m48v.fsf@HIDDEN> <87a6jd5891.fsf@HIDDEN>
 <86mtmykxro.fsf@HIDDEN>
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAABGdBTUEAALGPC/xhBQAAACBj
 SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADFBMVEW4oGLo4LhfSi7/
 ///dCHUJAAAAAWJLR0QDEQxM8gAAAAd0SU1FB+UKGQ0CC0DACHwAAAGzSURBVCjPNdDBitswEAbg
 UYgX45OzSEvZUzaUYusp7GBD6pMVNKHklJQutHmKpCSXnFrILqUnOySgzFN2pO765I/5NRoNiCJJ
 E4GrB4UIsZmeUkR7QgbE0z2UxkpfEX+q3Wdt7IvCGoocYaY5V3NlnA9d4xAXgrHWWp9chGbEyMa0
 eaUDtr6bnjg6d3zGYwPF8fLCf77BantPJf7/wAxkkr6jLOJp6i/BygJ7CZCzrAXpETsVukmTzkHT
 QfnKKi1sP6Abx+5Ao7Hiq0d1hka1Mv6urxUuhjCzrXzUug+xFm3UZh44BKvm/QCSK4MvrdsM+uWF
 kfIEuIGnpjM+xpjtnpveYORjXF433V4JFRD/aIgOM+VjOHUDcuIbAhostcuIRD3ylTKjPKGJEh42
 pz4hWT+HM2u6JMdtXYLfWPXYpUS/uQHOVX13vic6+YUUI/z48+i09LBKtoO/7tjX4UzdxgfaPrWM
 xesau+utHIeYvJp558rMA9UIC/pQxGHQqMCZ3lXbyGP4gMvzrerCBKrBLx7SV34V2J6dFQGWl64z
 CXVAhJbyFCA8gTGh/Rt4xZ90lIp/x1KvKUgs+CYAAAAldEVYdGRhdGU6Y3JlYXRlADIwMjEtMTAt
 MjVUMTM6MDI6MTErMDA6MDCeWyIKAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDIxLTEwLTI1VDEzOjAy
 OjExKzAwOjAw7waatgAAAABJRU5ErkJggg==
X-Now-Playing: Mike Rutherford's _Smallcreep's Day_: "Romani"
Date: Mon, 25 Oct 2021 15:05:07 +0200
In-Reply-To: <86mtmykxro.fsf@HIDDEN> (Michael's message of "Sun, 24 Oct
 2021 12:50:35 -0700")
Message-ID: <87y26hz24c.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: Michael <sp1ff@HIDDEN> writes: > The issue: stack traces
 are printed by the `backtrace` > package. backtrace.el was authored by Gemini
 (which is why I've > added him to this thread). backtrace.el doesn't directly
 work in > terms of [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 51037
Cc: gazally@HIDDEN, Eli Zaretskii <eliz@HIDDEN>, 51037 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Michael <sp1ff@HIDDEN> writes:

> The issue: stack traces are printed by the `backtrace`
> package. backtrace.el was authored by Gemini (which is why I've
> added him to this thread). backtrace.el doesn't directly work in
> terms of `print-le{ngth,vel}`: it defines a custom variable
> `backtrace-line-length` and then adjusts print-level &
> print-length in let bindings in order to:
>
>  1. try to respect the desired line length
>  2. not trigger bug 31919 (Lisp Debugger doesn't work when at
>  stack limit)

[...]

> For myself, I was quite surprised to all learn this: I had to
> spend a fair bit of time digging through the source to find out
> what was happening to my settings for print-length &
> print-level.

Yeah, I didn't remember `backtrace-line-length' either.  Perhaps it
should be linked to from the doc strings of print-length and
print-level... 

> My personal incliniation is to remove the `backtrace-line-length`
> variable entirely, and make the `debug` package responsible for
> controlling print-level so as to avoid 31919. But that's me: is
> there a compelling use-case for backtrace.el working in terms of
> limiting line length rather than just using `print-le{ve,ength}`?

Well...  if we're talking in an ert context, it could increase both the
backtrace-line-length and max-lisp-eval-depth variables when gathering
the backtrace, I think?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51037; Package emacs. Full text available.

Message received at 51037 <at> debbugs.gnu.org:


Received: (at 51037) by debbugs.gnu.org; 25 Oct 2021 13:04:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Oct 25 09:04:37 2021
Received: from localhost ([127.0.0.1]:41884 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mezeX-0005on-Dg
	for submit <at> debbugs.gnu.org; Mon, 25 Oct 2021 09:04:37 -0400
Received: from aibo.runbox.com ([185.226.149.25]:57198)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <gazally@HIDDEN>) id 1mezeV-0005oe-JW
 for 51037 <at> debbugs.gnu.org; Mon, 25 Oct 2021 09:04:36 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=runbox.com; 
 s=selector2;
 h=Content-Type:MIME-Version:Message-ID:Date:In-reply-to:Subject
 :Cc:To:From:References; bh=mlEJKKkpkxkTFRnWfT3HSztm2SZiPlhU3qSh7fIdBA4=; b=a6
 0HnYlkkbKHh1mLIjReoEdb1un2vuWL5Sdu1GLcAHnIUob/wTtOr/nUqEgHHQj/ScNHLLYAMhdke+M
 PdVLYnnVZo977QDqWX9HdIpKFSWATmup+5yo4nuixah7oUslH3R5V7i0+1OK/vdGyaJibIO3QH4Ko
 6oVOzptFOBXgjez6V3/KX67S7Ma3kWBWgS9WAenP7fLb3tsmfRPRz3iUV5eG7foWb1DAC35ZJO9qi
 4OcwN+lcA8B/azT8+4FU6Blm/jA6rTcRFGER32bQevgC0hhbBcAXLo58bEKul2IS5be3ajU5QnSHV
 7PIh+I44jblPET+NU+5njIwwhFeKD8kw==;
Received: from [10.9.9.72] (helo=submission01.runbox)
 by mailtransmit03.runbox with esmtp (Exim 4.86_2)
 (envelope-from <gazally@HIDDEN>)
 id 1mezeT-00053e-9v; Mon, 25 Oct 2021 15:04:33 +0200
Received: by submission01.runbox with esmtpsa [Authenticated ID (696087)]
 (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1)
 id 1mezdx-0003ms-Oc; Mon, 25 Oct 2021 15:04:02 +0200
References: <86tuhvmtpl.fsf@HIDDEN> <877deqec10.fsf@HIDDEN>
 <83fste2u4i.fsf@HIDDEN> <87ily94662.fsf@HIDDEN>
 <83fstd1bth.fsf@HIDDEN> <87czogslm4.fsf@HIDDEN>
 <86ily2mjtq.fsf@HIDDEN> <87r1cp89o4.fsf@HIDDEN>
 <86fst5m48v.fsf@HIDDEN> <87a6jd5891.fsf@HIDDEN>
 <86mtmykxro.fsf@HIDDEN>
User-agent: mu4e 1.4.15; emacs 27.2
From: Gemini Lasswell <gazally@HIDDEN>
To: Michael <sp1ff@HIDDEN>
Subject: Re: bug#51037: [PATCH] Make `print-level` & `print-length`
 customizable in ERT batch tests
In-reply-to: <86mtmykxro.fsf@HIDDEN>
Date: Mon, 25 Oct 2021 07:03:51 -0600
Message-ID: <87zgqxs1c8.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 51037
Cc: Lars Ingebrigtsen <larsi@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>,
 51037 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Michael writes:

> My personal incliniation is to remove the `backtrace-line-length`
> variable entirely, and make the `debug` package responsible for
> controlling print-level so as to avoid 31919. But that's me: is
> there a compelling use-case for backtrace.el working in terms of
> limiting line length rather than just using `print-le{ve,ength}`?

The motivation for `backtrace-line-length` was to find a compromise that
made backtraces more user-friendly in interactive debugging for both
small and large data structures.  Setting `print-level` and
`print-length` too small will create a lot of ellipses in small data
structures, making you have to expand those ellipses to see your data;
setting those variables a little bit bigger will unleash exponential
growth in line length for large data structures, causing delays of
seconds to minutes when rendering and navigating your backtrace.  The
heuristics in `cl-print-to-string-with-limit` try to do a reasonable job
with both small and large data structures, so the user can get on with
debugging, rather than first having to figure out values of the `print-`
variables which will make debugging possible.

Another goal of backtrace buffers is to make the data structures
represented there be completely navigable, which is why lines are not
simply truncated.

If you don't want ellipses in your backtraces, then bind
`backtrace-line-length` to nil or zero.  If you want to see how long a
backtrace line can get, try that out with magit or org-export.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51037; Package emacs. Full text available.

Message received at 51037 <at> debbugs.gnu.org:


Received: (at 51037) by debbugs.gnu.org; 24 Oct 2021 19:50:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Oct 24 15:50:57 2021
Received: from localhost ([127.0.0.1]:41019 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mejWD-0002pn-Fx
	for submit <at> debbugs.gnu.org; Sun, 24 Oct 2021 15:50:57 -0400
Received: from aibo.runbox.com ([185.226.149.25]:41870)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <sp1ff@HIDDEN>) id 1mejW8-0002pb-3L
 for 51037 <at> debbugs.gnu.org; Sun, 24 Oct 2021 15:50:56 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=runbox.com; 
 s=selector2;
 h=Content-Type:MIME-Version:Message-ID:Date:In-reply-to:Subject
 :Cc:To:From:References; bh=WP88wZZ7Obnl6O8DkV2Djv2zTZj4LeddbxrlKuwgDqk=; b=ff
 1/zhyj4MDwqRIuM7Lk76GQ3GICIfn0y8fh2Y/YPxfQ6FgotNjoKV8BuWYzHQIFq1K2m7yYwrFK3uC
 zhdw39DCwUknsgjYUTNsi/L+2Ac+SqzssRuZ9MxNko0xCeInmFY0WOglVyGoXQD1IBpePIhHhf1FC
 WzZCU/y6yMSaUsS0X0uM5zRC8WoNoSXJFk3UWiJZBg1YMfl+u8n2b/aTMpoBhsdHUEFmh7vcPE/2H
 PKl5srdpU+Y4BS/aW+clBzYoJyZgGy4dtnbpaRv0nW88OFZ92Bl8txDfQWkGXOFAn6c4Llj0KYa8k
 VI4wyXFPmg6pM7MENV+Uf4ldaJNaWpRw==;
Received: from [10.9.9.74] (helo=submission03.runbox)
 by mailtransmit02.runbox with esmtp (Exim 4.86_2)
 (envelope-from <sp1ff@HIDDEN>)
 id 1mejW0-0006Xo-Uo; Sun, 24 Oct 2021 21:50:45 +0200
Received: by submission03.runbox with esmtpsa [Authenticated ID (942723)]
 (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1)
 id 1mejVu-0002QQ-Uo; Sun, 24 Oct 2021 21:50:39 +0200
References: <86tuhvmtpl.fsf@HIDDEN> <877deqec10.fsf@HIDDEN>
 <83fste2u4i.fsf@HIDDEN> <87ily94662.fsf@HIDDEN>
 <83fstd1bth.fsf@HIDDEN> <87czogslm4.fsf@HIDDEN>
 <86ily2mjtq.fsf@HIDDEN> <87r1cp89o4.fsf@HIDDEN>
 <86fst5m48v.fsf@HIDDEN> <87a6jd5891.fsf@HIDDEN>
User-agent: mu4e 1.4.15; emacs 28.0.50
From: Michael <sp1ff@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
Subject: Re: bug#51037: [PATCH] Make `print-level` & `print-length`
 customizable in ERT batch tests
In-reply-to: <87a6jd5891.fsf@HIDDEN>
Date: Sun, 24 Oct 2021 12:50:35 -0700
Message-ID: <86mtmykxro.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; format=flowed
X-Spam-Score: 0.9 (/)
X-Debbugs-Envelope-To: 51037
Cc: gazally@HIDDEN, Eli Zaretskii <eliz@HIDDEN>, 51037 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.1 (/)

+Gemini

Lars Ingebrigtsen <larsi@HIDDEN> writes:

> Michael <sp1ff@HIDDEN> writes:
>
>> Only when comparing _results_. Say I have test code like:
>>
>>    (let ((a (<some complex list>)
>>          (b (<another complex list>))))
>>      ...
>>      (should (equal a b))
>>
>> My changes would case the error message from the failed 
>> `should`
>> invocation to print `a` & `b` more fully (i.e. with fewwer
>> ellipses).
>
> Ah, I see.
>
>> The backtrace logic is separate, and un-touched by my patch as
>> submitted (tho of course I can change that).
>
> Perhaps it would be better if the same variables affected both 
> result
> printing and backtraces in the code that ert is testing.

I've run down a bit of a rabbit hole on this.

The issue: stack traces are printed by the `backtrace`
package. backtrace.el was authored by Gemini (which is why I've
added him to this thread). backtrace.el doesn't directly work in
terms of `print-le{ngth,vel}`: it defines a custom variable
`backtrace-line-length` and then adjusts print-level &
print-length in let bindings in order to:

  1. try to respect the desired line length
  2. not trigger bug 31919 (Lisp Debugger doesn't work when at
  stack limit)

Bug 31919 <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=31919>
occurs when the debugger is invoked in response to
`max-lisp-eval-depth` being exceeded. Since we're close the the
top of the stack already, a too-high setting of `print-level`
will cause backtraces to break.

Because of this arrangement, any attempt on the part of ert to
customize print-length & print-level comes to nothing--
`backtrace` will adjust them to satisfy conditions 1 & 2 above.

For myself, I was quite surprised to all learn this: I had to
spend a fair bit of time digging through the source to find out
what was happening to my settings for print-length &
print-level.

My personal incliniation is to remove the `backtrace-line-length`
variable entirely, and make the `debug` package responsible for
controlling print-level so as to avoid 31919. But that's me: is
there a compelling use-case for backtrace.el working in terms of
limiting line length rather than just using `print-le{ve,ength}`?

-- 
Michael <sp1ff@HIDDEN>




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51037; Package emacs. Full text available.

Message received at 51037 <at> debbugs.gnu.org:


Received: (at 51037) by debbugs.gnu.org; 13 Oct 2021 14:07:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Oct 13 10:07:08 2021
Received: from localhost ([127.0.0.1]:32968 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1maeuO-0002Ye-RD
	for submit <at> debbugs.gnu.org; Wed, 13 Oct 2021 10:07:08 -0400
Received: from quimby.gnus.org ([95.216.78.240]:51736)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1maeuJ-0002Y7-VI
 for 51037 <at> debbugs.gnu.org; Wed, 13 Oct 2021 10:07:03 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=Qu4hWgVKTNL4NPSj4a3NU9dXXi/VWE73s8grh03I2dM=; b=TOC97bOdYlV9BI0We+7VifdHP9
 pjRhUM5A0QoaR6kPdKPsyqU4m+zNFcaQKRgJBgrxrHHQ6YLZejWoivAx+OgBMj9BLVayjey0EWbHE
 4+rzGwborDAE3D3gBu02tgN1GYnluWpmObjXdxCjXuw+JtGbiuPT4IGGa19R4LTt3MCI=;
Received: from [84.212.220.105] (helo=elva)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1maeuA-0000UX-Th; Wed, 13 Oct 2021 16:06:53 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Michael <sp1ff@HIDDEN>
Subject: Re: bug#51037: [PATCH] Make `print-level` & `print-length`
 customizable in ERT batch tests
References: <86tuhvmtpl.fsf@HIDDEN> <877deqec10.fsf@HIDDEN>
 <83fste2u4i.fsf@HIDDEN> <87ily94662.fsf@HIDDEN>
 <83fstd1bth.fsf@HIDDEN> <87czogslm4.fsf@HIDDEN>
 <86ily2mjtq.fsf@HIDDEN> <87r1cp89o4.fsf@HIDDEN>
 <86fst5m48v.fsf@HIDDEN>
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj
 SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAALVBMVEUuIwtVOyFpZlQG
 BgJIMgZWTRBnVx1xbyt5gzmJczGFek2fklG6spOsl0T///9GbpeoAAAAAWJLR0QOb70wTwAAAAd0
 SU1FB+UKDQ4FMRSwOZgAAAGVSURBVDjL1dO9TsMwEAdwoxbmFgl2eAKkvgBIyQMg1V4QA0POCkwM
 sRv1AcLHxEDLqXSBibIhgWhNJD7WsCKhknfBLthJQWxd+E/R/XJ2Yp0JIXN1m0X3VK+Rxh+ZGazN
 BshPWCOEVD2dEpia5+KAkKl6AVU6yW+YBwAuwaT5A6RN4GuoWFgA4YB6vl8CLpMviOhUB5etgwNT
 x4hSv1mxvznPpUxaiGg6KLu+WF0pNhcyNiAgoO3R4MbtcSyT3qFS6kjdertTkNwfDTQM1ZDuZdmz
 Bb1vS/Y0XCkVlAFAQ4zHajhOo60HB0xQJvlZt6dG6vXO36nXvr+KyUA3hdDWi6VvbJ/UGhYmJ8i4
 HEh83x4/PDmgTNdhWba7aX6eZQU0eRQusRBjzPOPAmjkC9E/3Qyxg6mRRwsB7Uo8qQNy1C1jC1V9
 QF3ADoQI8TRQ1jEAKOK0DPqsk7j/DhCLEPt5L3v5Hrt14gd6nU4oIBz289yCGSyPVr9mZ2MZ+PWl
 A10lRYr7YQZR6/qkXGmUwb058zv47+ATvbpQrpuNH0IAAAAldEVYdGRhdGU6Y3JlYXRlADIwMjEt
 MTAtMTNUMTQ6MDU6NDkrMDA6MDB68E1IAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDIxLTEwLTEzVDE0
 OjA1OjQ5KzAwOjAwC6319AAAAABJRU5ErkJggg==
X-Now-Playing: David Grubbs & Nikus Veliotis's _The Harmless Dust_: "The
 Harmless Dust, Pt. Two"
Date: Wed, 13 Oct 2021 16:06:50 +0200
In-Reply-To: <86fst5m48v.fsf@HIDDEN> (Michael's message of "Wed, 13 Oct
 2021 06:41:20 -0700")
Message-ID: <87a6jd5891.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: Michael <sp1ff@HIDDEN> writes: > Only when comparing
 _results_.
 Say I have test code like: > > (let ((a (<some complex list>) > (b (<another
 complex list>)))) > ... > (should (equal a b)) > > My changes would case
 the error message [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 51037
Cc: Eli Zaretskii <eliz@HIDDEN>, 51037 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Michael <sp1ff@HIDDEN> writes:

> Only when comparing _results_. Say I have test code like:
>
>    (let ((a (<some complex list>)
>          (b (<another complex list>))))
>      ...
>      (should (equal a b))
>
> My changes would case the error message from the failed `should`
> invocation to print `a` & `b` more fully (i.e. with fewwer
> ellipses).

Ah, I see.

> The backtrace logic is separate, and un-touched by my patch as
> submitted (tho of course I can change that).

Perhaps it would be better if the same variables affected both result
printing and backtraces in the code that ert is testing.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51037; Package emacs. Full text available.

Message received at 51037 <at> debbugs.gnu.org:


Received: (at 51037) by debbugs.gnu.org; 13 Oct 2021 13:41:31 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Oct 13 09:41:31 2021
Received: from localhost ([127.0.0.1]:59077 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1maeVf-0001Kn-Bo
	for submit <at> debbugs.gnu.org; Wed, 13 Oct 2021 09:41:31 -0400
Received: from aibo.runbox.com ([91.220.196.211]:39678)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <sp1ff@HIDDEN>) id 1maeVb-0001Kd-Vo
 for 51037 <at> debbugs.gnu.org; Wed, 13 Oct 2021 09:41:29 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=runbox.com; 
 s=selector2;
 h=Content-Type:MIME-Version:Message-ID:Date:In-reply-to:Subject
 :Cc:To:From:References; bh=jgvdPW3nE2L+L8U+opV9LKuTsBtxKpM6DhNyoszoNfM=; b=XT
 LXWN2AlDI+q5l/m91eVvUuWEqz757LFxW6r36vZZ9YUOvg7gv09ckyqjSzywtiZZFHFG/JACmEFyv
 9MiOCIwUPb2VVBoCJT/4HC9fcQftXxCr40eNFITMl5fC5xndiTAbvg/24UfJa34iDS0eaJzg+nuRa
 wwNXzWizNXfEc+1V2vKHGde4OQVM15ra1NMZh68iyyUJdjuiwsTrCU4smo1fOMhutbrgyqYYO+D3Y
 mx4M2ORP3xQx/MhjNmYAeNagAKSkFQ3hjzQ8HE+CsohMkNVpNQUm/BWEsh6L8XjSesaWggiGGxVtR
 HCYWRTY3oOtTliHtufAyQSjymugkUm8A==;
Received: from [10.9.9.73] (helo=submission02.runbox)
 by mailtransmit02.runbox with esmtp (Exim 4.86_2)
 (envelope-from <sp1ff@HIDDEN>)
 id 1maeVZ-0006xy-V0; Wed, 13 Oct 2021 15:41:26 +0200
Received: by submission02.runbox with esmtpsa [Authenticated ID (942723)]
 (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1)
 id 1maeVY-0000Ct-I9; Wed, 13 Oct 2021 15:41:24 +0200
References: <86tuhvmtpl.fsf@HIDDEN> <877deqec10.fsf@HIDDEN>
 <83fste2u4i.fsf@HIDDEN> <87ily94662.fsf@HIDDEN>
 <83fstd1bth.fsf@HIDDEN> <87czogslm4.fsf@HIDDEN>
 <86ily2mjtq.fsf@HIDDEN> <87r1cp89o4.fsf@HIDDEN>
User-agent: mu4e 1.4.15; emacs 28.0.50
From: Michael <sp1ff@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
Subject: Re: bug#51037: [PATCH] Make `print-level` & `print-length`
 customizable in ERT batch tests
In-reply-to: <87r1cp89o4.fsf@HIDDEN>
Date: Wed, 13 Oct 2021 06:41:20 -0700
Message-ID: <86fst5m48v.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; format=flowed
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 51037
Cc: Eli Zaretskii <eliz@HIDDEN>, 51037 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

Hey Lars,

>> Sorry to chime-in late, but my patch does _not_ affect the
>> printing of backtraces, just results. That said, I do agree 
>> with
>> Eli about the truncated backtraces often being useless; what do
>> you think of another variable controlling
>> that... `ert-batch-full-backtraces` or something?
>
> I'm not sure I quite follow you here -- the original patch would 
> make
> the backtraces printed by ert more complete, wouldn't they?

Only when comparing _results_. Say I have test code like:

    (let ((a (<some complex list>)
          (b (<another complex list>))))
      ...
      (should (equal a b))

My changes would case the error message from the failed `should`
invocation to print `a` & `b` more fully (i.e. with fewwer
ellipses).

The backtrace logic is separate, and un-touched by my patch as
submitted (tho of course I can change that).

-- 
Michael <sp1ff@HIDDEN>




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51037; Package emacs. Full text available.

Message received at 51037 <at> debbugs.gnu.org:


Received: (at 51037) by debbugs.gnu.org; 13 Oct 2021 11:08:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Oct 13 07:08:11 2021
Received: from localhost ([127.0.0.1]:58531 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mac7H-0001LL-4G
	for submit <at> debbugs.gnu.org; Wed, 13 Oct 2021 07:08:11 -0400
Received: from quimby.gnus.org ([95.216.78.240]:49374)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1mac7B-0001Kn-1s
 for 51037 <at> debbugs.gnu.org; Wed, 13 Oct 2021 07:08:10 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=/npA079rYH4xdftgsWvWUTtpjrvdQFahfMVBoMH1Ydc=; b=kCE1GqRyw6UaRjaBqpAT9RXvor
 n1uDDlrmPHEPV8DKtOWBMKwbbqkPtntWAEW2RKHuLnnRtOvKk1C/kacoZiymtO06Tp4VRAIKu+NuU
 oPpvGPDnSlpDb/zlZt8ScKX8/x/FtC8xcm1F/GqzcdJVLWwdZRfJJubEF/pkoRVsydmw=;
Received: from [84.212.220.105] (helo=elva)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1mac72-0007TA-4Q; Wed, 13 Oct 2021 13:07:58 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Michael <sp1ff@HIDDEN>
Subject: Re: bug#51037: [PATCH] Make `print-level` & `print-length`
 customizable in ERT batch tests
References: <86tuhvmtpl.fsf@HIDDEN> <877deqec10.fsf@HIDDEN>
 <83fste2u4i.fsf@HIDDEN> <87ily94662.fsf@HIDDEN>
 <83fstd1bth.fsf@HIDDEN> <87czogslm4.fsf@HIDDEN>
 <86ily2mjtq.fsf@HIDDEN>
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj
 SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAFVBMVEUJCAkqKiofHx8e
 HiBISEdAPz7///+cw1o9AAAAAWJLR0QGYWa4fQAAAAd0SU1FB+UKDQsCB5KA+C0AAAGQSURBVDjL
 5VNBchwhDBRSHjDA+g5DHiBoPyAb+wOpyv/fkgbW5XXKe3BVbpma2Rm6JTUttCL/z3U8Isr6xSM6
 PabGF+TDj0/AzMf8n1mEtA/rXbnH+FvqtW65N7Mae6zTOp6j3zmsV3S2yhqxGN/x+Ep05H7Cq0v4
 +U4sCfAmAbm84dfpLTZC1tKLtfC0t/OddTClucwNXE29uSE+PZV6AlRezNIPBys8abE20BQjdfGV
 Qrb0FN0KnVUchmxG0EoIlHDC2kTTITXBLy7P5cxgLGSYFjkPRwS+sb7NqNkwhXRHFrtk2z5sNqk3
 ldFHzJGE79A5OOOkzuCIxAPhxdgzM8GpSBJSGVH6xavksRtssFFo99Qs4VV6hsP3QRnHIBzdprJr
 R18ixgDKaFGPg5/BkdZhoTKncW8YOTvT3TN0ZdxGs2gePrhGVL0bh2KagxMZ9VRanC7txsHmOwA3
 67LfmQfi41fC/ifMIF/xaaqdMZW/Js50RnpYiN8RzKVPn2XbjZC7zZVJoPmHYuvLppGMP6M+Mp5c
 oDFnAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDIxLTEwLTEzVDExOjAyOjA3KzAwOjAwUXaQhQAAACV0
 RVh0ZGF0ZTptb2RpZnkAMjAyMS0xMC0xM1QxMTowMjowNyswMDowMCArKDkAAAAASUVORK5CYII=
X-Now-Playing: Alasdair Roberts og =?utf-8?Q?V=C3=B6lvur's?= _The Old Fabled
 River_: "Orison of Unison"
Date: Wed, 13 Oct 2021 13:07:55 +0200
In-Reply-To: <86ily2mjtq.fsf@HIDDEN> (Michael's message of "Tue, 12 Oct
 2021 06:52:33 -0700")
Message-ID: <87r1cp89o4.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview:  Michael <sp1ff@HIDDEN> writes: > Sorry to chime-in late, 
 but my patch does _not_ affect the > printing of backtraces, just results.
 That said, I do agree with > Eli about the truncated backtraces often being
 useless; what do > you [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 51037
Cc: Eli Zaretskii <eliz@HIDDEN>, 51037 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Michael <sp1ff@HIDDEN> writes:

> Sorry to chime-in late, but my patch does _not_ affect the
> printing of backtraces, just results. That said, I do agree with
> Eli about the truncated backtraces often being useless; what do
> you think of another variable controlling
> that... `ert-batch-full-backtraces` or something?

I'm not sure I quite follow you here -- the original patch would make
the backtraces printed by ert more complete, wouldn't they?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51037; Package emacs. Full text available.

Message received at 51037 <at> debbugs.gnu.org:


Received: (at 51037) by debbugs.gnu.org; 12 Oct 2021 13:52:56 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Oct 12 09:52:55 2021
Received: from localhost ([127.0.0.1]:40164 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1maID9-0007kT-Kx
	for submit <at> debbugs.gnu.org; Tue, 12 Oct 2021 09:52:55 -0400
Received: from aibo.runbox.com ([91.220.196.211]:34142)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <sp1ff@HIDDEN>) id 1maID7-0007kD-D5
 for 51037 <at> debbugs.gnu.org; Tue, 12 Oct 2021 09:52:54 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=runbox.com; 
 s=selector2;
 h=Content-Type:MIME-Version:Message-ID:Date:In-reply-to:Subject
 :Cc:To:From:References; bh=8xEwethprZLzJ4NRbm9iXba+oE33JPbWMblbXaEMObc=; b=qs
 5DuopaZP8YkG3ZxIc+GCmrDYuhaL5hEH5UZPNq9dX0Eok4aRcKJT1oUIVPRORUmIELk7pktP38qUG
 FXU+8hRV0vdQKrdPCSQvhIu1Yyu0QAUubKiRAZa5RngjNkPM/ei6d8xRqwa3mmcgYRKXOtF/wdGM9
 JPnkPnqgOpdSMxAIVo8Fj+xEHTiQrMWgPidX7+vcxGzEowoVBMZ09A4uySYopXeHjq7yBdAdTbZb8
 ucvRxFjJYqNiswTHncAsPMyifnmd5Rf2UclQ9iH968fVxblPl89AO693PvgCNgSEHXMPub2pUrVF8
 lKZp3ZyBLSg0Z05BOOGAxsfjDfcEi9pw==;
Received: from [10.9.9.74] (helo=submission03.runbox)
 by mailtransmit02.runbox with esmtp (Exim 4.86_2)
 (envelope-from <sp1ff@HIDDEN>)
 id 1maID5-0004R5-AV; Tue, 12 Oct 2021 15:52:51 +0200
Received: by submission03.runbox with esmtpsa [Authenticated ID (942723)]
 (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1)
 id 1maICr-0002JG-TZ; Tue, 12 Oct 2021 15:52:38 +0200
References: <86tuhvmtpl.fsf@HIDDEN> <877deqec10.fsf@HIDDEN>
 <83fste2u4i.fsf@HIDDEN> <87ily94662.fsf@HIDDEN>
 <83fstd1bth.fsf@HIDDEN> <87czogslm4.fsf@HIDDEN>
User-agent: mu4e 1.4.15; emacs 28.0.50
From: Michael <sp1ff@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
Subject: Re: bug#51037: [PATCH] Make `print-level` & `print-length`
 customizable in ERT batch tests
In-reply-to: <87czogslm4.fsf@HIDDEN>
Date: Tue, 12 Oct 2021 06:52:33 -0700
Message-ID: <86ily2mjtq.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; format=flowed
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 51037
Cc: Eli Zaretskii <eliz@HIDDEN>, 51037 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)


> If you have very long structures, a simple backtrace can take 
> many
> screenfuls, which isn't what most people want or expect.
>
>> OK, but I was thinking about a more general problem, not just 
>> about
>> ERT.  The backtraces displayed in batch-mode are truncated too 
>> early,
>> and that makes them useless many times.
>
> That's true.  Programmers that need to debug these things should 
> have an
> easy way to get complete backtraces, but I don't think users 
> should be
> presented with them.  So perhaps we should just introduce a new 
> switch,
> like --complete-backtraces (or something) that would do the 
> right thing
> both in general and in ert.

Sorry to chime-in late, but my patch does _not_ affect the
printing of backtraces, just results. That said, I do agree with
Eli about the truncated backtraces often being useless; what do
you think of another variable controlling
that... `ert-batch-full-backtraces` or something?

-- 
Michael <sp1ff@HIDDEN>




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51037; Package emacs. Full text available.

Message received at 51037 <at> debbugs.gnu.org:


Received: (at 51037) by debbugs.gnu.org; 9 Oct 2021 11:19:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 09 07:19:40 2021
Received: from localhost ([127.0.0.1]:52382 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mZAOC-0001sY-7X
	for submit <at> debbugs.gnu.org; Sat, 09 Oct 2021 07:19:40 -0400
Received: from quimby.gnus.org ([95.216.78.240]:60728)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1mZAO9-0001sK-MO
 for 51037 <at> debbugs.gnu.org; Sat, 09 Oct 2021 07:19:38 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=kV+VUmkznDcJjYtFVdyAAw1StKuN7JgdZcEhqrBp1mA=; b=Cfi+xX3r6GCsY499XiMBCr4zVh
 oR4KZSPboIpeeYUkRY2OpldoxSxLfInhpk+e/eijHQksuSPbbsH/foZ9DbExkB8QLTEuwj3JR7OJX
 MhypXG6rq++ZixXTCO2F2Eh9YHktcKeh46Q8fOcDS7WfLJdlNMwlBxhpJDa6tN7n+VO0=;
Received: from [84.212.220.105] (helo=elva)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1mZAO1-0004pt-TP; Sat, 09 Oct 2021 13:19:32 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Michael <sp1ff@HIDDEN>
Subject: Re: bug#51037: [PATCH] Make `print-level` & `print-length`
 customizable in ERT batch tests
References: <86tuhvmtpl.fsf@HIDDEN> <877deqec10.fsf@HIDDEN>
 <86lf33mtdx.fsf@HIDDEN>
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj
 SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAElBMVEUkHxswKiQVEhFf
 VFCilpD///85qtkRAAAAAWJLR0QF+G/pxwAAAAd0SU1FB+UKCQsPE7KWxUoAAAGxSURBVDjLrVTb
 kdwwDJN4DZDmFUBrG7BPbiBj919TAMqPZC/5yEw0s7uWAYIgZG8pY+n5KVae1bB+2UorLcC4KXH/
 JtG+rRO/too77aHpfVmqQqH+CZgofSL6AFYFgAgRCTjHBTaK2mEGe4VbLb6agiCwgSaYoBo0sbd1
 tflDRav516RBJc4H3jRbVRE3X0ZPcKwWE8gqc8Bk7EEux0+cI8SEmIp3c3Alhl0pIVUYBN1qkyuS
 TFAig+c07QbGPRBUAqpy1z4hCfghqJasjtl7347jsMIpJMVgEgWf1vcESkqlE+Aa/rETWKjCaNgE
 DSXcflBqIR85Rz4VzM6nedsHkI6v5yQ8bD82ADlJsLnUBF57R8lSOEieTHaL6r7D1rawwQCCcUT4
 sXcgCxsPgK7p6lgvoPFDefoI/7R9R3MdbAAYgnG6bWmXbNzJ009/Xo5+bH0ZrccweeEtU1xOt6wY
 BG/mqMEcbRyVBBSDk68zSvRUyBjTHaRm+LUbKHwME3idFRLPi8bmNr1WHNR0S11A3zYA69c7cD0M
 78D52kp5l/q2/ieQr27Jr9//Nuwv69+Bnw57ZtnpcaJwAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDIx
 LTEwLTA5VDExOjE1OjE5KzAwOjAwnaRekAAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyMS0xMC0wOVQx
 MToxNToxOSswMDowMOz55iwAAAAASUVORK5CYII=
X-Now-Playing: Throwing Muses's _Chains Changed_: "Snail Head"
Date: Sat, 09 Oct 2021 13:19:29 +0200
In-Reply-To: <86lf33mtdx.fsf@HIDDEN> (Michael's message of "Fri, 08 Oct
 2021 08:24:42 -0700")
Message-ID: <875yu6phry.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview:  Michael <sp1ff@HIDDEN> writes: > Good point. I simply
 carried the strategy over from that used to > unit test
 `ert-run-tests-interactively`. TBH I was unaware of > `cl-letf`,
 and there *is* this comment above > `ert-run-tests-inter [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 51037
Cc: 51037 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Michael <sp1ff@HIDDEN> writes:

> Good point. I simply carried the strategy over from that used to
> unit test `ert-run-tests-interactively`. TBH I was unaware of
> `cl-letf`, and there *is* this comment above
> `ert-run-tests-interactively`:
>
>    ;; 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?
>
> Perhaps I should change *both* to just use `cl-letf`?

Sounds good to me.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51037; Package emacs. Full text available.

Message received at 51037 <at> debbugs.gnu.org:


Received: (at 51037) by debbugs.gnu.org; 8 Oct 2021 15:24:54 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Oct 08 11:24:54 2021
Received: from localhost ([127.0.0.1]:51743 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mYrjy-0000xp-6P
	for submit <at> debbugs.gnu.org; Fri, 08 Oct 2021 11:24:54 -0400
Received: from aibo.runbox.com ([91.220.196.211]:51298)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <sp1ff@HIDDEN>) id 1mYrjv-0000xf-Cn
 for 51037 <at> debbugs.gnu.org; Fri, 08 Oct 2021 11:24:52 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=runbox.com; 
 s=selector2;
 h=Content-Type:MIME-Version:Message-ID:Date:In-reply-to:Subject
 :Cc:To:From:References; bh=z6Bc7GxG3aCAypa5she9bWROLxyCUYJs/KbR6W+udAA=; b=c3
 B+samIS5jstN3LZZfXrsbqzg05LFKEGG1gkV5+4S7t+1jtSSePygVwnvTa2S1RtL8UDonL5XSE4vQ
 MwZb9KlaXtYy3VL0c5c38cQx9m4LxjXaCBeV8vtQWLMe8yTrmNdE+rEXzOt5vVFd2BidoPHjwk4Nw
 I3JTc59zWV7seCpwjFvqjBEWYoics3PzfQ31O6i7D0LzPkRZABhn6ueWbVxIikzQJimAsnbOfUXdY
 b4A9bkC8srnoDOZeF1CiyguW7jnoOfs22tmJ11grQusHawPIdajt5onycaofL8isbO1cGoUYcSW+r
 SpQLeV4TQlSmOQSEh3i+okRIjvNuDFEg==;
Received: from [10.9.9.72] (helo=submission01.runbox)
 by mailtransmit02.runbox with esmtp (Exim 4.86_2)
 (envelope-from <sp1ff@HIDDEN>)
 id 1mYrjt-0006Zc-0V; Fri, 08 Oct 2021 17:24:49 +0200
Received: by submission01.runbox with esmtpsa [Authenticated ID (942723)]
 (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1)
 id 1mYrjr-0002uc-Pi; Fri, 08 Oct 2021 17:24:48 +0200
References: <86tuhvmtpl.fsf@HIDDEN> <877deqec10.fsf@HIDDEN>
User-agent: mu4e 1.4.15; emacs 28.0.50
From: Michael <sp1ff@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
Subject: Re: bug#51037: [PATCH] Make `print-level` & `print-length`
 customizable in ERT batch tests
In-reply-to: <877deqec10.fsf@HIDDEN>
Date: Fri, 08 Oct 2021 08:24:42 -0700
Message-ID: <86lf33mtdx.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; format=flowed
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 51037
Cc: 51037 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)


Lars Ingebrigtsen <larsi@HIDDEN> writes:

> Michael <sp1ff@HIDDEN> writes:
>
>> When running ERT tests in batch mode, the conservative values
>> chosen for `print-level` and `print-length` sometimes make it
>> difficult to see what exactly is wrong.  This patch introduces
>> two new variables (`ert-batch-print-level` &
>> `ert-batch-print-length`) that one can use to customize them;
>> e.g.
>>
>>    emacs -batch -l ert -l my-tests.el \
>>          --eval "(let ((ert-batch-print-level 10) \
>>                        (ert-batch-print-length 120)) \
>>                    (ert-run-tests-batch-and-exit))"
>
> Sounds like a good idea.
>
>> +MESSAGE-FN should normally be nil; it is used for automated
>> +self-tests and specify how to display messages."
>
> I don't understand this bit, though.  If you want to test how 
> this
> function outputs messages, you can just `cl-letf' like this:
>
> (cl-letf (((symbol-function 'message) ...

Good point. I simply carried the strategy over from that used to
unit test `ert-run-tests-interactively`. TBH I was unaware of
`cl-letf`, and there *is* this comment above
`ert-run-tests-interactively`:

    ;; 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?

Perhaps I should change *both* to just use `cl-letf`?

-- 
Michael <sp1ff@HIDDEN>




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51037; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 8 Oct 2021 13:49:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Oct 08 09:49:49 2021
Received: from localhost ([127.0.0.1]:49494 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mYqFx-0004Jt-7L
	for submit <at> debbugs.gnu.org; Fri, 08 Oct 2021 09:49:49 -0400
Received: from lists.gnu.org ([209.51.188.17]:48914)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <geb-bug-gnu-emacs@HIDDEN>)
 id 1mYqFv-0004Jl-J9
 for submit <at> debbugs.gnu.org; Fri, 08 Oct 2021 09:49:47 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:49196)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <geb-bug-gnu-emacs@HIDDEN>)
 id 1mYqFv-0006YO-9t
 for bug-gnu-emacs@HIDDEN; Fri, 08 Oct 2021 09:49:47 -0400
Received: from ciao.gmane.io ([116.202.254.214]:39240)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <geb-bug-gnu-emacs@HIDDEN>)
 id 1mYqFt-0003dI-Pv
 for bug-gnu-emacs@HIDDEN; Fri, 08 Oct 2021 09:49:46 -0400
Received: from list by ciao.gmane.io with local (Exim 4.92)
 (envelope-from <geb-bug-gnu-emacs@HIDDEN>)
 id 1mYqFr-0009rU-Gt
 for bug-gnu-emacs@HIDDEN; Fri, 08 Oct 2021 15:49:43 +0200
X-Injected-Via-Gmane: http://gmane.org/
To: bug-gnu-emacs@HIDDEN
From: Andy Moreton <andrewjmoreton@HIDDEN>
Subject: Re: bug#51037: [PATCH] Make `print-level` & `print-length`
 customizable in ERT batch tests
Date: Fri, 08 Oct 2021 14:49:37 +0100
Message-ID: <86y273k4ni.fsf@HIDDEN>
References: <86tuhvmtpl.fsf@HIDDEN> <877deqec10.fsf@HIDDEN>
 <83fste2u4i.fsf@HIDDEN> <87ily94662.fsf@HIDDEN>
 <86h7dszgv2.fsf@HIDDEN> <87tuhsqypa.fsf@HIDDEN>
Mime-Version: 1.0
Content-Type: text/plain
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (windows-nt)
Cancel-Lock: sha1:V8Wm5vq+dt1ONqhq86DCldWvIdE=
Received-SPF: pass client-ip=116.202.254.214;
 envelope-from=geb-bug-gnu-emacs@HIDDEN; helo=ciao.gmane.io
X-Spam_score_int: 5
X-Spam_score: 0.5
X-Spam_bar: /
X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001,
 FORGED_GMAIL_RCVD=1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001,
 HEADER_FROM_DIFFERENT_DOMAINS=0.25, NML_ADSP_CUSTOM_MED=0.9,
 SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 0.1 (/)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.9 (/)

On Fri 08 Oct 2021, Lars Ingebrigtsen wrote:

> Andy Moreton <andrewjmoreton@HIDDEN> writes:
>
>> Isn't that what ert-batch-backtrace-right-margin is for ?
>>
>>   (defcustom ert-batch-backtrace-right-margin 70
>>     "Maximum length of lines in ERT backtraces in batch mode.
>>   Use nil for no limit (caution: backtrace lines can be very long)."
>>     :type '(choice (const :tag "No truncation" nil) integer))
>>
>> Also the TEST_BACKTRACE_LINE_LENGTH environment variable can be
>> used to set it (see test/Makefile.in).
>
> Right.  But ert will still shorten "internally" with print-length etc
> before chopping the lines to 70 characters.  Here's with a longer value:
>
> est test-ensure-list2 backtrace:
>   signal(error ("(\"foo\" \"foo\" \"foo\" \"foo\" \"foo\" \"foo\" \"foo\" \"foo\" \"..."))
>   error("%S" ("foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo"
> "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo"
> "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo"
> "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo"
> "foo" ...))
>   (closure (t) nil (error "%S" (make-list 100 "foo")))()
>
> Note the "..." at the end of the foo list -- that's from print-length.


Good point. The truncation would not be so bothersome if there were
separate console and logfile streams (with the truncation only happening
in the console stream, and the full details in the logfile stream).

Anything that can make failed tests easier to diagnose is a useful
improvement.

    AndyM





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51037; Package emacs. Full text available.

Message received at 51037 <at> debbugs.gnu.org:


Received: (at 51037) by debbugs.gnu.org; 7 Oct 2021 22:04:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Oct 07 18:04:14 2021
Received: from localhost ([127.0.0.1]:48625 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mYbUs-00011L-83
	for submit <at> debbugs.gnu.org; Thu, 07 Oct 2021 18:04:14 -0400
Received: from quimby.gnus.org ([95.216.78.240]:41562)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1mYbUq-000118-A5
 for 51037 <at> debbugs.gnu.org; Thu, 07 Oct 2021 18:04:12 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=HrEK/HIPI6xUctIvhjfW4D8wKNdEYJbGV98QsNvJMIs=; b=rCoMO91zm0v6mFoYBKDekxC/LX
 60NC0jFvWxuz+BWTn2BWwP5Lxu10qbZ9tAemsmVED7EzJXL3v7o8PRAFaNhzjJvU8YpzTJJ3WdSXa
 6aNm0ije6GQgOVK1H0v8KE6XWy8fAu9Z7G27NlygEti5D8fVxVoees91+gIEYUOEX6zI=;
Received: from [84.212.220.105] (helo=elva)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1mYbUh-0003Xq-0d; Fri, 08 Oct 2021 00:04:06 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Andy Moreton <andrewjmoreton@HIDDEN>
Subject: Re: bug#51037: [PATCH] Make `print-level` & `print-length`
 customizable in ERT batch tests
References: <86tuhvmtpl.fsf@HIDDEN> <877deqec10.fsf@HIDDEN>
 <83fste2u4i.fsf@HIDDEN> <87ily94662.fsf@HIDDEN>
 <86h7dszgv2.fsf@HIDDEN>
X-Now-Playing: Tuxedomoon's _Ten Years In One Night (Live)_: "Pinheads On
 The Move"
Date: Fri, 08 Oct 2021 00:04:01 +0200
In-Reply-To: <86h7dszgv2.fsf@HIDDEN> (Andy Moreton's message of "Thu, 07
 Oct 2021 22:04:33 +0100")
Message-ID: <87tuhsqypa.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: Andy Moreton <andrewjmoreton@HIDDEN> writes: > Isn't that
 what ert-batch-backtrace-right-margin is for ? > > (defcustom
 ert-batch-backtrace-right-margin
 70 > "Maximum length of lines in ERT backtraces in batch mode. > Use nil
 for no limit (cauti [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 51037
Cc: 51037 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Andy Moreton <andrewjmoreton@HIDDEN> writes:

> Isn't that what ert-batch-backtrace-right-margin is for ?
>
>   (defcustom ert-batch-backtrace-right-margin 70
>     "Maximum length of lines in ERT backtraces in batch mode.
>   Use nil for no limit (caution: backtrace lines can be very long)."
>     :type '(choice (const :tag "No truncation" nil) integer))
>
> Also the TEST_BACKTRACE_LINE_LENGTH environment variable can be
> used to set it (see test/Makefile.in).

Right.  But ert will still shorten "internally" with print-length etc
before chopping the lines to 70 characters.  Here's with a longer value:

est test-ensure-list2 backtrace:
  signal(error ("(\"foo\" \"foo\" \"foo\" \"foo\" \"foo\" \"foo\" \"foo\" \"foo\" \"..."))
  error("%S" ("foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" "foo" ...))
  (closure (t) nil (error "%S" (make-list 100 "foo")))()

Note the "..." at the end of the foo list -- that's from print-length.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51037; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 7 Oct 2021 21:04:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Oct 07 17:04:53 2021
Received: from localhost ([127.0.0.1]:48545 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mYaZR-0005jJ-6b
	for submit <at> debbugs.gnu.org; Thu, 07 Oct 2021 17:04:53 -0400
Received: from lists.gnu.org ([209.51.188.17]:34154)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <geb-bug-gnu-emacs@HIDDEN>)
 id 1mYaZM-0005j6-6p
 for submit <at> debbugs.gnu.org; Thu, 07 Oct 2021 17:04:51 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:43224)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <geb-bug-gnu-emacs@HIDDEN>)
 id 1mYaZM-0002hn-1f
 for bug-gnu-emacs@HIDDEN; Thu, 07 Oct 2021 17:04:48 -0400
Received: from ciao.gmane.io ([116.202.254.214]:35066)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <geb-bug-gnu-emacs@HIDDEN>)
 id 1mYaZK-0004OS-HU
 for bug-gnu-emacs@HIDDEN; Thu, 07 Oct 2021 17:04:47 -0400
Received: from list by ciao.gmane.io with local (Exim 4.92)
 (envelope-from <geb-bug-gnu-emacs@HIDDEN>)
 id 1mYaZH-0006J9-0e
 for bug-gnu-emacs@HIDDEN; Thu, 07 Oct 2021 23:04:43 +0200
X-Injected-Via-Gmane: http://gmane.org/
To: bug-gnu-emacs@HIDDEN
From: Andy Moreton <andrewjmoreton@HIDDEN>
Subject: Re: bug#51037: [PATCH] Make `print-level` & `print-length`
 customizable in ERT batch tests
Date: Thu, 07 Oct 2021 22:04:33 +0100
Message-ID: <86h7dszgv2.fsf@HIDDEN>
References: <86tuhvmtpl.fsf@HIDDEN> <877deqec10.fsf@HIDDEN>
 <83fste2u4i.fsf@HIDDEN> <87ily94662.fsf@HIDDEN>
Mime-Version: 1.0
Content-Type: text/plain
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (windows-nt)
Cancel-Lock: sha1:/VM6gN2emb3fx7ZDTxcXeN8/r0o=
Received-SPF: pass client-ip=116.202.254.214;
 envelope-from=geb-bug-gnu-emacs@HIDDEN; helo=ciao.gmane.io
X-Spam_score_int: 5
X-Spam_score: 0.5
X-Spam_bar: /
X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001,
 FORGED_GMAIL_RCVD=1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001,
 HEADER_FROM_DIFFERENT_DOMAINS=0.249, NML_ADSP_CUSTOM_MED=0.9,
 SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 0.1 (/)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.9 (/)

On Thu 07 Oct 2021, Lars Ingebrigtsen wrote:

> Eli Zaretskii <eliz@HIDDEN> writes:
>
>> Why do we limit print-length in batch mode?  In interactive session,
>> one can click or type RET on the ellipsis and get it expanded, but no
>> such joy in batch.  See
>>
>>   https://lists.gnu.org/archive/html/emacs-devel/2021-10/msg00395.html
>>
>> for how that makes debugging more difficult than it has to be.
>>
>> So how about using huge values in batch?  Are there any downsides?
>
> It'll make the error summaries completely unreadable, which isn't what
> you want when doing a "make check" -- you just want to see that there's
> a problem and where it is.  (Well, at least I do.)
>
> But when making a specific test (i.e., "make subr-tests" etc) it would
> indeed be nice to have untruncated backtraces.  I think adding these new
> variables would allow us to do this.

Isn't that what ert-batch-backtrace-right-margin is for ?

  (defcustom ert-batch-backtrace-right-margin 70
    "Maximum length of lines in ERT backtraces in batch mode.
  Use nil for no limit (caution: backtrace lines can be very long)."
    :type '(choice (const :tag "No truncation" nil) integer))

Also the TEST_BACKTRACE_LINE_LENGTH environment variable can be
used to set it (see test/Makefile.in).

    AndyM






Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51037; Package emacs. Full text available.

Message received at 51037 <at> debbugs.gnu.org:


Received: (at 51037) by debbugs.gnu.org; 7 Oct 2021 19:04:01 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Oct 07 15:04:01 2021
Received: from localhost ([127.0.0.1]:48454 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mYYgT-0002mV-Ah
	for submit <at> debbugs.gnu.org; Thu, 07 Oct 2021 15:04:01 -0400
Received: from quimby.gnus.org ([95.216.78.240]:40092)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1mYYgO-0002mF-GK
 for 51037 <at> debbugs.gnu.org; Thu, 07 Oct 2021 15:04:00 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=chO2Wck/jp5FSQN2W9Uw0GAKh4ZfObvq6MP0iS0BqII=; b=K7yl+jhkkLKy+wqN7XVp+/+oV3
 Go+10xFc3e5EbZdKvcbaujIXx6TVWO0z0pfjyOv8acf/xNFPvovNj+/yL6J0gqoPPXoU9GAxjl8LI
 15Ve6GuQTqcDTDVaU7vNgAgo37jcFJSots9/3FV66R+J8kRGCf/2kj7f1sccOS5YsJpw=;
Received: from [84.212.220.105] (helo=elva)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1mYYgF-0002Eo-NY; Thu, 07 Oct 2021 21:03:50 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#51037: [PATCH] Make `print-level` & `print-length`
 customizable in ERT batch tests
References: <86tuhvmtpl.fsf@HIDDEN> <877deqec10.fsf@HIDDEN>
 <83fste2u4i.fsf@HIDDEN> <87ily94662.fsf@HIDDEN>
 <83fstd1bth.fsf@HIDDEN>
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj
 SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAFVBMVEUZKTEZKTIkOkUt
 SVdNU2JJc4v////jk2ZGAAAAAWJLR0QGYWa4fQAAAAd0SU1FB+UKBxI3MPRG5w8AAAG6SURBVDjL
 lZNNkhoxDIVl4ACWMgdoyxwgWMwesDlAKvT9rzKS7G7oYbKIiuqFPz/9WA8A4lzYgiJsgkmYRWoi
 ZJp2EeK0m/R8l1QgIn+v5SYfUuRWc5HrpILMWUG9nv6U/eGSW91fjucISJZfQZMsR9HbWT+/JkDM
 DiQjEMbDbxXsLwyQhkIYrZVju7Xc2g2AnKxAPq6H1upFFcheXIHNcaz13Ko0AEwdFEaThEi7PuiS
 iDm5JPjPBnfACwjaZnwB/loYgycLAb8BtDyKY3QgJS+59BA1VsDSNdqXA5cq8LaMJAQc0WuMQZTE
 odDOeBTRjyULq4T6g4iM6VeAG5D+BTgtuXQfBnhh6UXhgy+At+AZRSW0gPxKVEKsWzWXrIe2u6K3
 bWZT8BO0nsvBWKG2aqDKBvSQdp8ftbyDfL7PcxsSCOMUEzp4SJk6oL5VDRIFc5WTXX4HXmULMH8q
 mFvVKk8AagQ6z060PkP/D/qWYYCHnAzgSGVey/cOigPivjiT2PA6vSQCL5LMBObcvL6xefIJujWK
 Ld+AEregVfHEaqQEneh1B2BWhNGL+zVCQHiLfj3AT/Hz6X/FFzD4giiy6Z5hAAAAJXRFWHRkYXRl
 OmNyZWF0ZQAyMDIxLTEwLTA3VDE4OjU1OjQ4KzAwOjAwZP3UgQAAACV0RVh0ZGF0ZTptb2RpZnkA
 MjAyMS0xMC0wN1QxODo1NTo0OCswMDowMBWgbD0AAAAASUVORK5CYII=
X-Now-Playing: Tuxedomoon's _Desire_: "Desire"
Date: Thu, 07 Oct 2021 21:03:47 +0200
In-Reply-To: <83fstd1bth.fsf@HIDDEN> (Eli Zaretskii's message of "Thu, 07 Oct
 2021 11:25:14 +0300")
Message-ID: <87czogslm4.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview:  Eli Zaretskii <eliz@HIDDEN> writes: > Sorry, I don't think
 I understand: why would that make them > unreadable? Text terminals wrap
 long lines. Or what am I missing? > Can you perhaps show an example of such
 an unreadable error summary? 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 51037
Cc: sp1ff@HIDDEN, 51037 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Eli Zaretskii <eliz@HIDDEN> writes:

> Sorry, I don't think I understand: why would that make them
> unreadable?  Text terminals wrap long lines.  Or what am I missing?
> Can you perhaps show an example of such an unreadable error summary?

If you have very long structures, a simple backtrace can take many
screenfuls, which isn't what most people want or expect.

> OK, but I was thinking about a more general problem, not just about
> ERT.  The backtraces displayed in batch-mode are truncated too early,
> and that makes them useless many times.

That's true.  Programmers that need to debug these things should have an
easy way to get complete backtraces, but I don't think users should be
presented with them.  So perhaps we should just introduce a new switch,
like --complete-backtraces (or something) that would do the right thing
both in general and in ert.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51037; Package emacs. Full text available.

Message received at 51037 <at> debbugs.gnu.org:


Received: (at 51037) by debbugs.gnu.org; 7 Oct 2021 08:26:04 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Oct 07 04:26:04 2021
Received: from localhost ([127.0.0.1]:45929 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mYOj5-0006RN-OQ
	for submit <at> debbugs.gnu.org; Thu, 07 Oct 2021 04:26:03 -0400
Received: from eggs.gnu.org ([209.51.188.92]:48674)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1mYOj1-0006Qm-7a
 for 51037 <at> debbugs.gnu.org; Thu, 07 Oct 2021 04:26:02 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:56748)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1mYOiv-0007vo-RQ; Thu, 07 Oct 2021 04:25:53 -0400
Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:3901
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1mYOiN-0006Am-VV; Thu, 07 Oct 2021 04:25:52 -0400
Date: Thu, 07 Oct 2021 11:25:14 +0300
Message-Id: <83fstd1bth.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
In-Reply-To: <87ily94662.fsf@HIDDEN> (message from Lars Ingebrigtsen on Thu, 
 07 Oct 2021 09:59:01 +0200)
Subject: Re: bug#51037: [PATCH] Make `print-level` & `print-length`
 customizable in ERT batch tests
References: <86tuhvmtpl.fsf@HIDDEN> <877deqec10.fsf@HIDDEN>
 <83fste2u4i.fsf@HIDDEN> <87ily94662.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 51037
Cc: sp1ff@HIDDEN, 51037 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Lars Ingebrigtsen <larsi@HIDDEN>
> Cc: sp1ff@HIDDEN,  51037 <at> debbugs.gnu.org
> Date: Thu, 07 Oct 2021 09:59:01 +0200
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> >   https://lists.gnu.org/archive/html/emacs-devel/2021-10/msg00395.html
> >
> > for how that makes debugging more difficult than it has to be.
> >
> > So how about using huge values in batch?  Are there any downsides?
> 
> It'll make the error summaries completely unreadable

Sorry, I don't think I understand: why would that make them
unreadable?  Text terminals wrap long lines.  Or what am I missing?
Can you perhaps show an example of such an unreadable error summary?

And even if this is something specific to ERT, why not use a huge
value in batch-mode by default, and bind the variables to smaller
values in ERT?

> But when making a specific test (i.e., "make subr-tests" etc) it would
> indeed be nice to have untruncated backtraces.  I think adding these new
> variables would allow us to do this.

OK, but I was thinking about a more general problem, not just about
ERT.  The backtraces displayed in batch-mode are truncated too early,
and that makes them useless many times.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51037; Package emacs. Full text available.

Message received at 51037 <at> debbugs.gnu.org:


Received: (at 51037) by debbugs.gnu.org; 7 Oct 2021 07:59:16 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Oct 07 03:59:16 2021
Received: from localhost ([127.0.0.1]:45899 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mYOJA-0001Oh-IK
	for submit <at> debbugs.gnu.org; Thu, 07 Oct 2021 03:59:16 -0400
Received: from quimby.gnus.org ([95.216.78.240]:34170)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1mYOJ5-0001OQ-1V
 for 51037 <at> debbugs.gnu.org; Thu, 07 Oct 2021 03:59:15 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=/4f8VNc6Y79+L0rc7XjGEFa3azHSbbP/hoP0nkuTVSI=; b=C+2+1VUGX8x8Nrmo3jj2ihZHmD
 H+DEdvms4Mb5aHgdyGNTdhZuzVFfFcT5OFnvMyLK0Ote+8Pc+t0f68GSGgdKs4sDrikolrKP08NjU
 wErq+LekTb8f24Zb/zhRlZLoNBXbx8TqNxTiSfpEzqeFV1CW80uya1AiB0cN/hdUAJvQ=;
Received: from [84.212.220.105] (helo=elva)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1mYOIv-0005pa-Uv; Thu, 07 Oct 2021 09:59:04 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#51037: [PATCH] Make `print-level` & `print-length`
 customizable in ERT batch tests
References: <86tuhvmtpl.fsf@HIDDEN> <877deqec10.fsf@HIDDEN>
 <83fste2u4i.fsf@HIDDEN>
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj
 SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAIVBMVEX9/f0hDA67wq9T
 qNr2723e3diWXk27olJdTkhSp7b///+JyUX3AAAAAWJLR0QKaND0VgAAAAd0SU1FB+UKBwcdLeLG
 JmUAAAGVSURBVDjLtdG/T4NAFAfwy5Grrmdsy4inJR2bEBO7GYLWkTQe0c0QSxlNh9qx0BRulsX7
 b70fTXtAm+jgGxj48H3v3gHAoS4sz/NAoIoa70FvD0sBiO6RaVgmCZujIwkBaQ2QmhHKVqvABGiC
 ORx2JXQuFdy3Ei8SnoKH1owjoE8V9QQ8Br4JtgQ616uboBak722wT4AeTssW6D12YJ6q8yuobd6F
 nneXMblIEJrQF4kMZ7jfAFAg8ooF2I1Was4BIocs4imcExK7cX6GRfUUDNcJWxPIooLlcY4k9NVx
 h9uU5QQWLkvLPEcMY7tU4G6ZTrC02OYI6k4CosQlcURcogpNRWJS3xwl8pHZYg9KqbFHlHyIJTFm
 2JZfHMD9jAlZiU4423DOzcQMDDN5XLypxgagQYjKKw21hKpzBRWvmgDle3vMq3ED0Le4w4o34DkI
 fNG94k2QV8F1/St83fhkQK+92ybsLtwanQA4+ksCib9kOcBCoeOEFISIEt8PEllvwApbicmC6kQD
 Jhrqw8Ul6lYzgEY/cgiymJjq9IAAAAAldEVYdGRhdGU6Y3JlYXRlADIwMjEtMTAtMDdUMDc6Mjk6
 NDUrMDA6MDCMUnQPAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDIxLTEwLTA3VDA3OjI5OjQ1KzAwOjAw
 /Q/MswAAAABJRU5ErkJggg==
X-Now-Playing: Blaine L. Reininger's _Broken Fingers_: "Playin' Your Game"
Date: Thu, 07 Oct 2021 09:59:01 +0200
In-Reply-To: <83fste2u4i.fsf@HIDDEN> (Eli Zaretskii's message of "Wed, 06 Oct
 2021 15:52:13 +0300")
Message-ID: <87ily94662.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: Eli Zaretskii <eliz@HIDDEN> writes: > Why do we limit
 print-length
 in batch mode? In interactive session, > one can click or type RET on the
 ellipsis and get it expanded,
 but no > such joy in batch. See > > https://lists.gnu.org/archive
 [...] Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 51037
Cc: sp1ff@HIDDEN, 51037 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Eli Zaretskii <eliz@HIDDEN> writes:

> Why do we limit print-length in batch mode?  In interactive session,
> one can click or type RET on the ellipsis and get it expanded, but no
> such joy in batch.  See
>
>   https://lists.gnu.org/archive/html/emacs-devel/2021-10/msg00395.html
>
> for how that makes debugging more difficult than it has to be.
>
> So how about using huge values in batch?  Are there any downsides?

It'll make the error summaries completely unreadable, which isn't what
you want when doing a "make check" -- you just want to see that there's
a problem and where it is.  (Well, at least I do.)

But when making a specific test (i.e., "make subr-tests" etc) it would
indeed be nice to have untruncated backtraces.  I think adding these new
variables would allow us to do this.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51037; Package emacs. Full text available.

Message received at 51037 <at> debbugs.gnu.org:


Received: (at 51037) by debbugs.gnu.org; 6 Oct 2021 12:52:28 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Oct 06 08:52:28 2021
Received: from localhost ([127.0.0.1]:42928 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mY6PL-0006w3-Nz
	for submit <at> debbugs.gnu.org; Wed, 06 Oct 2021 08:52:27 -0400
Received: from eggs.gnu.org ([209.51.188.92]:36030)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1mY6PK-0006vq-A4
 for 51037 <at> debbugs.gnu.org; Wed, 06 Oct 2021 08:52:26 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:48988)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1mY6PE-0006jh-Aa; Wed, 06 Oct 2021 08:52:20 -0400
Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:3224
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1mY6PD-0003t4-Tn; Wed, 06 Oct 2021 08:52:20 -0400
Date: Wed, 06 Oct 2021 15:52:13 +0300
Message-Id: <83fste2u4i.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
In-Reply-To: <877deqec10.fsf@HIDDEN> (message from Lars Ingebrigtsen on Wed, 
 06 Oct 2021 11:30:03 +0200)
Subject: Re: bug#51037: [PATCH] Make `print-level` & `print-length`
 customizable in ERT batch tests
References: <86tuhvmtpl.fsf@HIDDEN> <877deqec10.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 51037
Cc: sp1ff@HIDDEN, 51037 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Lars Ingebrigtsen <larsi@HIDDEN>
> Date: Wed, 06 Oct 2021 11:30:03 +0200
> Cc: 51037 <at> debbugs.gnu.org
> 
> Michael <sp1ff@HIDDEN> writes:
> 
> > When running ERT tests in batch mode, the conservative values
> > chosen for `print-level` and `print-length` sometimes make it
> > difficult to see what exactly is wrong.  This patch introduces
> > two new variables (`ert-batch-print-level` &
> > `ert-batch-print-length`) that one can use to customize them;
> > e.g.
> >
> >    emacs -batch -l ert -l my-tests.el \
> >          --eval "(let ((ert-batch-print-level 10) \
> >                        (ert-batch-print-length 120)) \
> >                    (ert-run-tests-batch-and-exit))"
> 
> Sounds like a good idea.

Why do we limit print-length in batch mode?  In interactive session,
one can click or type RET on the ellipsis and get it expanded, but no
such joy in batch.  See

  https://lists.gnu.org/archive/html/emacs-devel/2021-10/msg00395.html

for how that makes debugging more difficult than it has to be.

So how about using huge values in batch?  Are there any downsides?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51037; Package emacs. Full text available.

Message received at 51037 <at> debbugs.gnu.org:


Received: (at 51037) by debbugs.gnu.org; 6 Oct 2021 09:30:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Oct 06 05:30:14 2021
Received: from localhost ([127.0.0.1]:42551 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mY3Fe-0005JK-5j
	for submit <at> debbugs.gnu.org; Wed, 06 Oct 2021 05:30:14 -0400
Received: from quimby.gnus.org ([95.216.78.240]:51628)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1mY3Fc-00059q-6w
 for 51037 <at> debbugs.gnu.org; Wed, 06 Oct 2021 05:30:12 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=VGR5AjuRYay6VS8+Q+KMscDrMxz8sfsAU2umzVnw1tM=; b=FcjxZsppOy/9sKpsAl0CggEk4X
 ERBB+aiTUKX4koEkNew4CRT0tb5J+eeLMOxj8jLonc+LaLSE/CaA93K4tDbWBmvwoJQAYbu5QY4Vz
 LMqYytRfMgEhnhtoNahvIe/X/+H1pl9f+D7xShZQdxoYRh8fMZe6iQdUEayaa2FaHFcg=;
Received: from [84.212.220.105] (helo=elva)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1mY3FU-0000Vp-3k; Wed, 06 Oct 2021 11:30:06 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Michael <sp1ff@HIDDEN>
Subject: Re: bug#51037: [PATCH] Make `print-level` & `print-length`
 customizable in ERT batch tests
References: <86tuhvmtpl.fsf@HIDDEN>
X-Now-Playing: DJ Screw's _All Work, No Play_: "DJ Screw  B-Legit  Lil Keke
 Phaz  Duke Screw Mix  feat  B-Legit  Lil Keke  Phaz  Duke "
Date: Wed, 06 Oct 2021 11:30:03 +0200
In-Reply-To: <86tuhvmtpl.fsf@HIDDEN> (Michael's message of "Tue, 05 Oct
 2021 07:28:38 -0700")
Message-ID: <877deqec10.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: Michael <sp1ff@HIDDEN> writes: > When running ERT tests
 in batch mode,
 the conservative values > chosen for `print-level` and `print-length`
 sometimes make it > difficult to see what exactly is wrong. This patch
 introduces > two ne [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 51037
Cc: 51037 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Michael <sp1ff@HIDDEN> writes:

> When running ERT tests in batch mode, the conservative values
> chosen for `print-level` and `print-length` sometimes make it
> difficult to see what exactly is wrong.  This patch introduces
> two new variables (`ert-batch-print-level` &
> `ert-batch-print-length`) that one can use to customize them;
> e.g.
>
>    emacs -batch -l ert -l my-tests.el \
>          --eval "(let ((ert-batch-print-level 10) \
>                        (ert-batch-print-length 120)) \
>                    (ert-run-tests-batch-and-exit))"

Sounds like a good idea.

> +MESSAGE-FN should normally be nil; it is used for automated
> +self-tests and specify how to display messages."

I don't understand this bit, though.  If you want to test how this
function outputs messages, you can just `cl-letf' like this:

(cl-letf (((symbol-function 'message) ...

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#51037; Package emacs. Full text available.
Severity set to 'wishlist' from 'normal' Request was from Stefan Kangas <stefan@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 5 Oct 2021 14:50:26 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Oct 05 10:50:26 2021
Received: from localhost ([127.0.0.1]:41614 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mXllx-0005F0-Da
	for submit <at> debbugs.gnu.org; Tue, 05 Oct 2021 10:50:26 -0400
Received: from lists.gnu.org ([209.51.188.17]:47572)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <sp1ff@HIDDEN>) id 1mXlR7-0004f0-Mt
 for submit <at> debbugs.gnu.org; Tue, 05 Oct 2021 10:28:56 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:51586)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <sp1ff@HIDDEN>) id 1mXlR7-0007gD-1L
 for bug-gnu-emacs@HIDDEN; Tue, 05 Oct 2021 10:28:53 -0400
Received: from aibo.runbox.com ([91.220.196.211]:50246)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <sp1ff@HIDDEN>) id 1mXlR3-0007zc-Of
 for bug-gnu-emacs@HIDDEN; Tue, 05 Oct 2021 10:28:52 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=runbox.com; 
 s=selector2;
 h=Content-Type:MIME-Version:Message-ID:Date:Subject:To:From; 
 bh=7/3eDTsyjMGNM4OpzE61Iqu+epn8QY/fZpb6fTNGDzM=; b=Qxtj9l4Da9JCvqSGUHCYa8k8I
 p2LoHOfPwzsIni1mYPcqNO5JePu3Q4FMbpdriVM4V93v0gyZZo7oQ9AEaefxR+TIwWJ8AN1F/Wy45
 u+RrHvagZwRoNNxGdjXN6/bZ5BwBjKDo6Uk2/R0YiVXNocvd6g+CuYj9+/FG+N2NSte/OwFs7gvtT
 sJdtT3n4didukhYiebLe3nLSwJTjQF9EiFHYSYnQ8ICoTeVCgNKRamGSlKOOP9aCtS9OD1Yosbqja
 EwoBuHUa9FaXZf4nNUGm3pDW1j44+Kbz/G1to6uBBCCiPHoUdxCRybPn8fybzlTlcuvAV49aMp7Vx
 /R98KEUHQ==;
Received: from [10.9.9.73] (helo=submission02.runbox)
 by mailtransmit02.runbox with esmtp (Exim 4.86_2)
 (envelope-from <sp1ff@HIDDEN>) id 1mXlQz-0003Cn-Lu
 for bug-gnu-emacs@HIDDEN; Tue, 05 Oct 2021 16:28:45 +0200
Received: by submission02.runbox with esmtpsa [Authenticated ID (942723)]
 (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1)
 id 1mXlQw-0008Je-5k
 for bug-gnu-emacs@HIDDEN; Tue, 05 Oct 2021 16:28:42 +0200
User-agent: mu4e 1.4.15; emacs 28.0.50
From: Michael <sp1ff@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: [PATCH] Make `print-level` & `print-length` customizable in ERT
 batch tests
Date: Tue, 05 Oct 2021 07:28:38 -0700
Message-ID: <86tuhvmtpl.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
Received-SPF: pass client-ip=91.220.196.211; envelope-from=sp1ff@HIDDEN;
 helo=aibo.runbox.com
X-Spam_score_int: -27
X-Spam_score: -2.8
X-Spam_bar: --
X-Spam_report: (-2.8 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001,
 SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -0.1 (/)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Tue, 05 Oct 2021 10:50:24 -0400
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.4 (--)

--=-=-=
Content-Type: text/plain; format=flowed

Hello,

When running ERT tests in batch mode, the conservative values
chosen for `print-level` and `print-length` sometimes make it
difficult to see what exactly is wrong.  This patch introduces
two new variables (`ert-batch-print-level` &
`ert-batch-print-length`) that one can use to customize them;
e.g.

    emacs -batch -l ert -l my-tests.el \
          --eval "(let ((ert-batch-print-level 10) \
                        (ert-batch-print-length 120)) \
                    (ert-run-tests-batch-and-exit))"

Please let me know what should be changed.


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0001-Make-print-length-print-level-in-ert-run-tests-batch.patch
Content-Description: 0001-Make-print-length-print-level-in-ert-run-tests-batch.patch

From da7eff94f23f4798df36be2c2bd072038ba01e2d Mon Sep 17 00:00:00 2001
From: Michael Herstine <sp1ff@HIDDEN>
Date: Tue, 5 Oct 2021 06:53:02 -0700
Subject: [PATCH] Make print-length & print-level in ert-run-tests-batch
 configurable

This commit introduces two new ert variables (ert-batch-print-length
and ert-batch-print-level) that make these settings configurable.  It
also adds an optional message-fn parameter to ert-batch-test (in the
style of of ert-run-tests-interactively) to facilitate testing.

* lisp/emacs-lisp/ert.el (ert-batch-print-length, ert-batch-print-level,
ert-batch-test): Added the two variables, added optional message-fn
parameter, set print-level & print-length to these settings when
formatting test results.
* test/lisp/emacs-lisp/ert-tests.el (ert-test-run-tests-batch): new
tests
* doc/misc/ert.texi: document the new variables & their usage
---
 doc/misc/ert.texi                 | 16 ++++++++
 etc/NEWS                          |  5 +++
 lisp/emacs-lisp/ert.el            | 61 +++++++++++++++++++------------
 test/lisp/emacs-lisp/ert-tests.el | 34 +++++++++++++++++
 4 files changed, 93 insertions(+), 23 deletions(-)

diff --git a/doc/misc/ert.texi b/doc/misc/ert.texi
index fafdb8c4eb4..12f1df75fcc 100644
--- a/doc/misc/ert.texi
+++ b/doc/misc/ert.texi
@@ -323,6 +323,22 @@ Running Tests in Batch Mode
 emacs -batch -l ert -f ert-summarize-tests-batch-and-exit output.log
 @end example
 
+@vindex ert-batch-print-level
+@vindex ert-batch-print-length
+ERT attempts to limit the output size for failed tests by choosing
+conservative values for @code{print-level} & @code{print-length}
+when printing Lisp values.  This can in some cases make it difficult
+to see which portions of those values are incorrect.  Use
+@code{ert-batch-print-level} and @code{ert-batch-print-length}
+to customize that:
+
+@example
+emacs -batch -l ert -l my-tests.el \
+      --eval "(let ((ert-batch-print-level 10) \
+                    (ert-batch-print-length 120)) \
+                (ert-run-tests-batch-and-exit))"
+@end example
+
 @vindex ert-quiet
 By default, ERT in batch mode is quite verbose, printing a line with
 result after each test.  This gives you progress information: how many
diff --git a/etc/NEWS b/etc/NEWS
index 17c42ce104d..be102dbc501 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -128,6 +128,11 @@ of files visited via 'C-x C-f' and other commands.
 
 * Changes in Emacs 28.1
 
++++
+** New ERT batch variables 'ert-batch-print-length' & 'ert-batch-print-level'
+These variables will override 'print-length' & 'print-level' when
+printing Lisp values in ERT batch test results.
+
 ---
 ** Emacs now supports Unicode Standard version 14.0.
 
diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el
index 92acfe7246f..2f0b5536d7e 100644
--- a/lisp/emacs-lisp/ert.el
+++ b/lisp/emacs-lisp/ert.el
@@ -76,6 +76,18 @@ ert-batch-backtrace-right-margin
 Use nil for no limit (caution: backtrace lines can be very long)."
   :type '(choice (const :tag "No truncation" nil) integer))
 
+(defvar ert-batch-print-length 10
+  "`print-length' setting used in `ert-run-tests-batch'.
+
+When formatting lists in test results, `print-length' will be
+temporarily set to this value.")
+
+(defvar ert-batch-print-level 5
+  "`print-level' setting used in `ert-run-tests-batch'.
+
+When formatting lists in test results, `print-level' will be
+temporarily set to this value.")
+
 (defface ert-test-result-expected '((((class color) (background light))
                                      :background "green1")
                                     (((class color) (background dark))
@@ -1338,7 +1350,7 @@ ert-quiet
   "Non-nil makes ERT only print important information in batch mode.")
 
 ;;;###autoload
-(defun ert-run-tests-batch (&optional selector)
+(defun ert-run-tests-batch (&optional selector message-fn)
   "Run the tests specified by SELECTOR, printing results to the terminal.
 
 SELECTOR works as described in `ert-select-tests', except if
@@ -1346,8 +1358,12 @@ ert-run-tests-batch
 run; this makes the command line \"emacs -batch -l my-tests.el -f
 ert-run-tests-batch-and-exit\" useful.
 
-Returns the stats object."
+Returns the stats object.
+
+MESSAGE-FN should normally be nil; it is used for automated
+self-tests and specify how to display messages."
   (unless selector (setq selector 't))
+  (unless message-fn (setq message-fn #'message))
   (ert-run-tests
    selector
    (lambda (event-type &rest event-args)
@@ -1355,7 +1371,7 @@ ert-run-tests-batch
        (run-started
         (unless ert-quiet
           (cl-destructuring-bind (stats) event-args
-            (message "Running %s tests (%s, selector `%S')"
+            (funcall message-fn "Running %s tests (%s, selector `%S')"
                      (length (ert--stats-tests stats))
                      (ert--format-time-iso8601 (ert--stats-start-time stats))
                      selector))))
@@ -1364,7 +1380,7 @@ ert-run-tests-batch
           (let ((unexpected (ert-stats-completed-unexpected stats))
                 (skipped (ert-stats-skipped stats))
 		(expected-failures (ert--stats-failed-expected stats)))
-            (message "\n%sRan %s tests, %s results as expected, %s unexpected%s (%s, %f sec)%s\n"
+            (funcall message-fn "\n%sRan %s tests, %s results as expected, %s unexpected%s (%s, %f sec)%s\n"
                      (if (not abortedp)
                          ""
                        "Aborted: ")
@@ -1383,44 +1399,43 @@ ert-run-tests-batch
                          ""
                        (format "\n%s expected failures" expected-failures)))
             (unless (zerop unexpected)
-              (message "%s unexpected results:" unexpected)
+              (funcall message-fn "%s unexpected results:" unexpected)
               (cl-loop for test across (ert--stats-tests stats)
                        for result = (ert-test-most-recent-result test) do
                        (when (not (ert-test-result-expected-p test result))
-                         (message "%9s  %S%s"
+                         (funcall message-fn "%9s  %S%s"
                                   (ert-string-for-test-result result nil)
                                   (ert-test-name test)
                                   (if (getenv "EMACS_TEST_VERBOSE")
                                       (ert-reason-for-test-result result)
                                     ""))))
-              (message "%s" ""))
+              (funcall message-fn "%s" ""))
             (unless (zerop skipped)
-              (message "%s skipped results:" skipped)
+              (funcall message-fn "%s skipped results:" skipped)
               (cl-loop for test across (ert--stats-tests stats)
                        for result = (ert-test-most-recent-result test) do
                        (when (ert-test-result-type-p result :skipped)
-                         (message "%9s  %S%s"
+                         (funcall message-fn "%9s  %S%s"
                                   (ert-string-for-test-result result nil)
                                   (ert-test-name test)
                                   (if (getenv "EMACS_TEST_VERBOSE")
                                       (ert-reason-for-test-result result)
                                     ""))))
-              (message "%s" "")))))
-       (test-started
-        )
+              (funcall message-fn "%s" "")))))
+       (test-started)
        (test-ended
         (cl-destructuring-bind (stats test result) event-args
           (unless (ert-test-result-expected-p test result)
             (cl-etypecase result
               (ert-test-passed
-               (message "Test %S passed unexpectedly" (ert-test-name test)))
+               (funcall message-fn "Test %S passed unexpectedly" (ert-test-name test)))
               (ert-test-result-with-condition
-               (message "Test %S backtrace:" (ert-test-name test))
+               (funcall message-fn "Test %S backtrace:" (ert-test-name test))
                (with-temp-buffer
                  (insert (backtrace-to-string
                           (ert-test-result-with-condition-backtrace result)))
                  (if (not ert-batch-backtrace-right-margin)
-                     (message "%s"
+                     (funcall message-fn "%s"
                               (buffer-substring-no-properties (point-min)
                                                               (point-max)))
                    (goto-char (point-min))
@@ -1430,33 +1445,33 @@ ert-run-tests-batch
                        (setq end (min end
                                       (+ start
                                          ert-batch-backtrace-right-margin)))
-                       (message "%s" (buffer-substring-no-properties
+                       (funcall message-fn "%s" (buffer-substring-no-properties
                                       start end)))
                      (forward-line 1))))
                (with-temp-buffer
                  (ert--insert-infos result)
                  (insert "    ")
                  (let ((print-escape-newlines t)
-                       (print-level 5)
-                       (print-length 10))
+                       (print-level ert-batch-print-level)
+                       (print-length ert-batch-print-length))
                    (ert--pp-with-indentation-and-newline
                     (ert-test-result-with-condition-condition result)))
                  (goto-char (1- (point-max)))
                  (cl-assert (looking-at "\n"))
                  (delete-char 1)
-                 (message "Test %S condition:" (ert-test-name test))
-                 (message "%s" (buffer-string))))
+                 (funcall message-fn "Test %S condition:" (ert-test-name test))
+                 (funcall message-fn "%s" (buffer-string))))
               (ert-test-aborted-with-non-local-exit
-               (message "Test %S aborted with non-local exit"
+               (funcall message-fn "Test %S aborted with non-local exit"
                         (ert-test-name test)))
               (ert-test-quit
-               (message "Quit during %S" (ert-test-name test)))))
+               (funcall message-fn "Quit during %S" (ert-test-name test)))))
           (unless ert-quiet
             (let* ((max (prin1-to-string (length (ert--stats-tests stats))))
                    (format-string (concat "%9s  %"
                                           (prin1-to-string (length max))
                                           "s/" max "  %S (%f sec)")))
-              (message format-string
+              (funcall message-fn format-string
                        (ert-string-for-test-result result
                                                    (ert-test-result-expected-p
                                                     test result))
diff --git a/test/lisp/emacs-lisp/ert-tests.el b/test/lisp/emacs-lisp/ert-tests.el
index 5c9696105e9..d4872e0bab7 100644
--- a/test/lisp/emacs-lisp/ert-tests.el
+++ b/test/lisp/emacs-lisp/ert-tests.el
@@ -551,6 +551,40 @@ ert-test-run-tests-interactively
             (when (get-buffer buffer-name)
               (kill-buffer buffer-name))))))))
 
+(ert-deftest ert-test-run-tests-batch ()
+  (let* ((complex-list '((:1 (:2 (:3 (:4 (:5 (:6 "abc"))))))))
+	 (long-list (make-list 121 1))
+	 (failing-test-1
+          (make-ert-test :name 'failing-test-1
+			 :body (lambda () (should (equal complex-list 1)))))
+	 (failing-test-2
+          (make-ert-test :name 'failing-test-2
+			 :body (lambda () (should (equal long-list 1))))))
+    (let ((ert-debug-on-error nil))
+      (let* ((messages nil)
+             (mock-message-fn
+              (lambda (format-string &rest args)
+                (push (apply #'format format-string args) messages))))
+        (save-window-excursion
+          (unwind-protect
+              (let ((case-fold-search nil)
+		    (ert-batch-print-level nil)
+		    (ert-batch-print-length nil))
+                (ert-run-tests-batch
+                 `(member ,failing-test-1 ,failing-test-2)
+                 mock-message-fn))))
+	(let ((long-text (mapconcat #'identity (make-list 121 "1") " "))
+	      (complex-text "(:6 \"abc\")")
+	      found-complex found-long)
+	  (cl-loop for msg in messages
+		   do
+		   (unless found-long
+		     (setq found-long (cl-search long-text msg :test 'equal)))
+		   (unless found-complex
+		     (setq found-complex (cl-search complex-text msg :test 'equal))))
+	  (should found-complex)
+	  (should found-long))))))
+
 (ert-deftest ert-test-special-operator-p ()
   (should (ert--special-operator-p 'if))
   (should-not (ert--special-operator-p 'car))
-- 
2.33.0


--=-=-=
Content-Type: text/plain; format=flowed


-- 
Michael <sp1ff@HIDDEN>

--=-=-=--




Acknowledgement sent to Michael <sp1ff@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#51037; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 29 Nov 2021 16:30:01 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.