From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#65680: cl-print-to-string-with-limit erroneously imposes a maximum print-length of 50 Date: Tue, 19 Sep 2023 10:32:19 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26478"; mail-complaints-to="usenet@ciao.gmane.io" Cc: acm@muc.de To: 65680-done@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Sep 19 12:33:51 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qiY3C-0006gn-4q for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 19 Sep 2023 12:33:50 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qiY2n-0006Pp-5q; Tue, 19 Sep 2023 06:33:26 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qiY2L-0005wI-Pw for bug-gnu-emacs@gnu.org; Tue, 19 Sep 2023 06:33:02 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qiY2H-0002F4-SM for bug-gnu-emacs@gnu.org; Tue, 19 Sep 2023 06:32:55 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qiY2Q-0007fP-Ae for bug-gnu-emacs@gnu.org; Tue, 19 Sep 2023 06:33:02 -0400 Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Tue, 19 Sep 2023 10:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 65680 X-GNU-PR-Package: emacs Mail-Followup-To: 65680@debbugs.gnu.org, acm@muc.de, acm@muc.de Original-Received: via spool by 65680-done@debbugs.gnu.org id=D65680.169511955929438 (code D ref 65680); Tue, 19 Sep 2023 10:33:02 +0000 Original-Received: (at 65680-done) by debbugs.gnu.org; 19 Sep 2023 10:32:39 +0000 Original-Received: from localhost ([127.0.0.1]:55420 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qiY23-0007ek-1t for submit@debbugs.gnu.org; Tue, 19 Sep 2023 06:32:39 -0400 Original-Received: from mail.muc.de ([193.149.48.3]:26881) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qiY20-0007eR-AR for 65680-done@debbugs.gnu.org; Tue, 19 Sep 2023 06:32:37 -0400 Original-Received: (qmail 95617 invoked by uid 3782); 19 Sep 2023 12:32:21 +0200 Original-Received: from acm.muc.de (p4fe157a7.dip0.t-ipconnect.de [79.225.87.167]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Tue, 19 Sep 2023 12:32:20 +0200 Original-Received: (qmail 19729 invoked by uid 1000); 19 Sep 2023 10:32:19 -0000 Content-Disposition: inline In-Reply-To: X-Submission-Agent: TMDA/1.3.x (Ph3nix) X-Primary-Address: acm@muc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:270862 Archived-At: The bug has been fixed. On Fri, Sep 01, 2023 at 14:17:12 +0000, Alan Mackenzie wrote: > Hello, Emacs. > In cl-print-to-string-with-limit appears the following binding: > (print-length (cond > ((null limit) nil) > ((eq limit t) print-length) > (t (min limit 50)))) > ^^^^^^^^^^^^ > .. This has the effect of ignoring the parameter LIMIT (unless it is > very small) and instead truncating the printed size to 50. There is a > similar mechanism to limit print-level to 8. > Although the doc string doesn't explicitly say it won't truncate like > this, it kind of implies that LIMIT is the size it will truncate to. > This excessive truncation is a bug. > cl-print-to-string-with-limit is used by backtrace--print-to-string with > a LIMIT of 5000 to print the first line of a debug buffer. The error > message gets rudely truncated at 50 characters with an ellipsis, e.g.: > Debugger entered--Lisp error: (error "Invalid call to `edebug-before'. Is your debug sp...") > .. We shouldn't be doing this. It is irritating to the user. Correct > would be to print: > Debugger entered--Lisp error: (error "Invalid call to `edebug-before'. Is your debug spec correct?") > .. I propose fixing this bug by removing these limits on print-length and > print-level in cl-print-to-string-with-limit. -- Alan Mackenzie (Nuremberg, Germany).