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

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

bug#65680: closed (cl-print-to-string-with-limit erroneously imposes a m


From: GNU bug Tracking System
Subject: bug#65680: closed (cl-print-to-string-with-limit erroneously imposes a maximum print-length of 50)
Date: Fri, 29 Sep 2023 16:51:01 +0000

Your message dated Fri, 29 Sep 2023 16:49:57 +0000
with message-id <ZRcANbeyW0j_4LsK@ACM>
and subject line Re: bug#65680: cl-print-to-string-with-limit erroneously 
imposes a maximum print-length of 50
has caused the debbugs.gnu.org bug report #65680,
regarding cl-print-to-string-with-limit erroneously imposes a maximum 
print-length of 50
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
65680: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=65680
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: cl-print-to-string-with-limit erroneously imposes a maximum print-length of 50 Date: Fri, 1 Sep 2023 14:17:12 +0000
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).



--- End Message ---
--- Begin Message --- Subject: Re: bug#65680: cl-print-to-string-with-limit erroneously imposes a maximum print-length of 50 Date: Fri, 29 Sep 2023 16:49:57 +0000
Hello, Eli.

On Fri, Sep 29, 2023 at 15:39:44 +0300, Eli Zaretskii wrote:
> > Date: Wed, 27 Sep 2023 15:12:37 +0000
> > Cc: Eli Zaretskii <eliz@gnu.org>
> > From: Alan Mackenzie <acm@muc.de>

> > I've implemented cl-print-string-length in cl-print.el, but not as a
> > customisable variable (for consistency with print-{length,level}).  I
> > manipulate it in cl-print-string-with-limit by binding it to (- limit
> > 3), then multiplying it by ¾ at each successive trial printing.

> > I haven't yet made any amendment to the CL manual.

> Please do.

It seems that cl-print.el is entirely undocumented in the CL manual.
I've opened bug #66267 for this.  I intend to work on it in the coming
days.

> > Here's the patch I propose to commit:

> OK, modulo Stefan's comment.

I've committed it, and I'm closing bug #65680 with this post.

-- 
Alan Mackenzie (Nuremberg, Germany).


--- End Message ---

reply via email to

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