GNU bug report logs - #64535
30.0.50; Spurious newlines in `prin1` output

Previous Next

Package: emacs;

Reported by: Stefan Monnier <monnier <at> iro.umontreal.ca>

Date: Sat, 8 Jul 2023 19:20:01 UTC

Severity: normal

Found in version 30.0.50

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#64535: closed (30.0.50; Spurious newlines in `prin1` output)
Date: Thu, 13 Jul 2023 23:13:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Thu, 13 Jul 2023 19:11:48 -0400
with message-id <jwvsf9rh0h4.fsf-monnier+emacs <at> gnu.org>
and subject line Re: bug#64535: 30.0.50; Spurious newlines in `prin1` output
has caused the debbugs.gnu.org bug report #64535,
regarding 30.0.50; Spurious newlines in `prin1` output
to be marked as done.

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


-- 
64535: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=64535
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.0.50; Spurious newlines in `prin1` output
Date: Sat, 08 Jul 2023 15:19:13 -0400
Package: Emacs
Version: 30.0.50


`prin1` never inserts newlines unless they're within strings (and that
can be controlled with `print-escape-newlines`), right?  Right?

Nope: it does insert newlines inside char-table when reaching the 3rd
level of subtables.  This was done to work around the long lines problem
in redisplay (bug#2866), but it's far from the only case where `prin1`
can emit a long line, and we've significantly improved our handling of
long lines.

Can we get rid of this quirk now, please?


        Stefan


diff --git a/src/print.c b/src/print.c
index 5c95aeb9a20..aae998692fb 100644
--- a/src/print.c
+++ b/src/print.c
@@ -2544,11 +2544,6 @@ print_object (Lisp_Object obj, Lisp_Object printcharfun, bool escapeflag)
 	  }
 	case PVEC_SUB_CHAR_TABLE:
 	  {
-	    /* Make each lowest sub_char_table start a new line.
-	       Otherwise we'll make a line extremely long, which
-	       results in slow redisplay.  */
-	    if (XSUB_CHAR_TABLE (obj)->depth == 3)
-	      printchar ('\n', printcharfun);
 	    print_c_string ("#^^[", printcharfun);
 	    int n = sprintf (buf, "%d %d",
 			     XSUB_CHAR_TABLE (obj)->depth,



[Message part 3 (message/rfc822, inline)]
From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 64535-done <at> debbugs.gnu.org
Subject: Re: bug#64535: 30.0.50; Spurious newlines in `prin1` output
Date: Thu, 13 Jul 2023 19:11:48 -0400
>> Can we get rid of this quirk now, please?
>
> I'm okay with getting rid of it, with two conditions:
>
>   . removing newline insertion in the scenario of bug#2866 leaves
>     Emacs sufficiently performant, even in the unoptimized build, and
>   . we will still insert a newline if long-line-threshold is nil

That means we'd keep the code and make it even larger.

> IOW, I don't want us to bring back regressions as result of
> this cleanup.

That wouldn't be a cleanup, then.  IOW you're asking me to make the
quirk even bigger.  I'd rather keep the quirk as-is, in that case.

Thanks, closing,


        Stefan



This bug report was last modified 1 year and 336 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.