unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#65680: cl-print-to-string-with-limit erroneously imposes a maximum print-length of 50
@ 2023-09-01 14:17 Alan Mackenzie
  2023-09-19 10:32 ` Alan Mackenzie
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Alan Mackenzie @ 2023-09-01 14:17 UTC (permalink / raw)
  To: 65680

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





^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2023-10-03 23:35 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-01 14:17 bug#65680: cl-print-to-string-with-limit erroneously imposes a maximum print-length of 50 Alan Mackenzie
2023-09-19 10:32 ` Alan Mackenzie
2023-09-21 16:16 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-21 16:36   ` Eli Zaretskii
2023-09-21 17:07   ` Alan Mackenzie
2023-09-21 17:51     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-21 19:22       ` Drew Adams
2023-09-21 20:00         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-21 18:33     ` Eli Zaretskii
     [not found]       ` <ZQ1m766tulSqvuC6@ACM>
     [not found]         ` <83msxe779i.fsf@gnu.org>
     [not found]           ` <ZQ2JVhy-e8NpCJqq@ACM>
     [not found]             ` <837coi74ia.fsf@gnu.org>
     [not found]               ` <jwva5tefif5.fsf-monnier+emacs@gnu.org>
     [not found]                 ` <ZRRGZaRf3WU9z6m_@ACM>
     [not found]                   ` <83v8btywz3.fsf@gnu.org>
2023-09-29 16:49                     ` Alan Mackenzie
2023-09-29 16:53                       ` Eli Zaretskii
2023-10-03  2:11 ` Michael Heerdegen
2023-10-03  9:18   ` Alan Mackenzie
2023-10-03 10:26   ` Alan Mackenzie
2023-10-03 23:35     ` Michael Heerdegen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).