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: Fri, 1 Sep 2023 14:17:12 +0000 Message-ID: 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="31115"; mail-complaints-to="usenet@ciao.gmane.io" To: 65680@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Sep 01 16:18:20 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 1qc4yZ-0007uC-Q8 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 01 Sep 2023 16:18:19 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qc4yF-00041p-2l; Fri, 01 Sep 2023 10:17:59 -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 1qc4yB-00041I-52 for bug-gnu-emacs@gnu.org; Fri, 01 Sep 2023 10:17:55 -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 1qc4y9-0001jq-Nr for bug-gnu-emacs@gnu.org; Fri, 01 Sep 2023 10:17:54 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qc4yI-0007Ks-Mh for bug-gnu-emacs@gnu.org; Fri, 01 Sep 2023 10:18:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 01 Sep 2023 14:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 65680 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.169357787128178 (code B ref -1); Fri, 01 Sep 2023 14:18:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 1 Sep 2023 14:17:51 +0000 Original-Received: from localhost ([127.0.0.1]:33562 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qc4y6-0007KQ-KD for submit@debbugs.gnu.org; Fri, 01 Sep 2023 10:17:50 -0400 Original-Received: from lists.gnu.org ([2001:470:142::17]:57088) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qc4y5-0007KC-0S for submit@debbugs.gnu.org; Fri, 01 Sep 2023 10:17:49 -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 1qc4xq-0003CC-2K for bug-gnu-emacs@gnu.org; Fri, 01 Sep 2023 10:17:34 -0400 Original-Received: from mail.muc.de ([193.149.48.3]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qc4xk-0001b3-7Q for bug-gnu-emacs@gnu.org; Fri, 01 Sep 2023 10:17:33 -0400 Original-Received: (qmail 69222 invoked by uid 3782); 1 Sep 2023 16:17:14 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=muc.de; i=@muc.de; q=dns/txt; s=default; t=1693577834; h=date : to : subject : message-id : mime-version : content-type : from : from; bh=t/le7ogOLLMzUKAurhdokvGsBgYCnyNiEq+YjK/Sqq0=; b=oG5mZktkpqC413gVXrau4GbplkX5bwAlmEBO7BePLUcIiibz1SV0OVTM8xXaveoNgmyl1 WAp7YR4b7GKK/tjuzjzlmYRbWah4OKouj1A0f9XTJ8hvM1j4DEp41dMmYcpyMMwQYbubewE 0ihX8Nv083cmumMCq5q+TyeofLdq5Taq7JRWxnw/XsWwnsGYIvYASeWaLQNH7Ka8CXvOK5Q ZOogSXbFKbn1ZW7p9ZWhmDmNCDHXqqDroq6G836O0ayemriEO2rVrTHaSCVVFLF/OB+9Xc5 dkkxvsh5xi/zxjnrZjFbFPyZiZwCVM/2pYRTd/aJaKe+uTpdmVMFY5O2hzbA== Original-Received: from acm.muc.de (pd953a051.dip0.t-ipconnect.de [217.83.160.81]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Fri, 01 Sep 2023 16:17:12 +0200 Original-Received: (qmail 18297 invoked by uid 1000); 1 Sep 2023 14:17:12 -0000 Content-Disposition: inline X-Submission-Agent: TMDA/1.3.x (Ph3nix) X-Primary-Address: acm@muc.de Received-SPF: pass client-ip=193.149.48.3; envelope-from=acm@muc.de; helo=mail.muc.de X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action 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:268883 Archived-At: 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).