GNU bug report logs -
#65680
cl-print-to-string-with-limit erroneously imposes a maximum print-length of 50
Previous Next
Reported by: Alan Mackenzie <acm <at> muc.de>
Date: Fri, 1 Sep 2023 14:18:02 UTC
Severity: normal
Done: Alan Mackenzie <acm <at> muc.de>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your message dated Fri, 29 Sep 2023 16:49:57 +0000
with message-id <ZRcANbeyW0j_4LsK <at> 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 <at> gnu.org.)
--
65680: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=65680
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
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).
[Message part 3 (message/rfc822, inline)]
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 <at> gnu.org>
> > From: Alan Mackenzie <acm <at> 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).
This bug report was last modified 1 year and 292 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.