From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#64535: 30.0.50; Spurious newlines in `prin1` output Date: Sat, 08 Jul 2023 15:19:13 -0400 Message-ID: Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14073"; mail-complaints-to="usenet@ciao.gmane.io" To: 64535@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jul 08 21:20:10 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qIDTV-0003SN-U6 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 08 Jul 2023 21:20:10 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qIDTP-0006sN-M4; Sat, 08 Jul 2023 15:20:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qIDTO-0006sD-AX for bug-gnu-emacs@gnu.org; Sat, 08 Jul 2023 15:20:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qIDTO-0003XX-2F for bug-gnu-emacs@gnu.org; Sat, 08 Jul 2023 15:20:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qIDTN-000341-LT for bug-gnu-emacs@gnu.org; Sat, 08 Jul 2023 15:20:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 08 Jul 2023 19:20:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 64535 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.168884397811730 (code B ref -1); Sat, 08 Jul 2023 19:20:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 8 Jul 2023 19:19:38 +0000 Original-Received: from localhost ([127.0.0.1]:45224 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qIDT0-000338-1M for submit@debbugs.gnu.org; Sat, 08 Jul 2023 15:19:38 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:56898) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qIDSx-000330-LF for submit@debbugs.gnu.org; Sat, 08 Jul 2023 15:19:36 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qIDSx-0006pu-F2 for bug-gnu-emacs@gnu.org; Sat, 08 Jul 2023 15:19:35 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qIDSv-0003T3-Rm for bug-gnu-emacs@gnu.org; Sat, 08 Jul 2023 15:19:35 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 36C171000C4 for ; Sat, 8 Jul 2023 15:19:31 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 0EBF91000B9 for ; Sat, 8 Jul 2023 15:19:26 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1688843966; bh=VGaA7D8cmH9MwHnjg9Bz0qtsg3Ej7Yojz+vhzDTOXqQ=; h=From:To:Subject:Date:From; b=UD/IGFAvwoncEvbK1DaN92y8tlHHrIHPtajKcjK8Vdd8Ob/ev/oF2SjscauhQT867 qTRm0qkg3UcEDBNX8Ag1L+XHbu8sy5UZJPP+uyuCnf/BOZOjdhRBNc1QKcVWtG84jQ J9EX1WJj2G0Gy0rQfQKUIp/+S65ZRht0ERhWCn8+Xi6JWJk2OncjDOYbUyUxGc7Ly5 LG5hTq4yzGdnrezWqEdPfdKhsIeL9q5VNTd2J2A5d1bSkkBCGcZgVHmOJ9hHVDVsEh m1YUe9Am0mTC28UqI0uShUv1tDyteL6iDw4euwk9CWIidTnqf+oMaZGvqVvMAPRytg 4UZuGLDaeUhRQ== Original-Received: from alfajor (unknown [23.233.149.155]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id EA27912033B for ; Sat, 8 Jul 2023 15:19:25 -0400 (EDT) Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:264790 Archived-At: 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,