bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#65680: cl-print-to-string-with-limit erroneously imposes a maximum p


From: Alan Mackenzie
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

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).





reply via email to

[Prev in Thread] Current Thread [Next in Thread]