From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Heerdegen via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#70868: 30.0.50; Date: Sun, 12 May 2024 20:11:17 +0200 Message-ID: <87h6f2q4sa.fsf@web.de> References: <663fb841.050a0220.ffcbb.b84f@mx.google.com> <86jzk019u0.fsf@gnu.org> <86h6f419mi.fsf@gnu.org> <87v83jozi7.fsf@web.de> <86ikzjysrh.fsf@gnu.org> <87r0e7oyct.fsf@web.de> <86frunyr3o.fsf@gnu.org> Reply-To: Michael Heerdegen Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19084"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Stefan Monnier , 70868@debbugs.gnu.org, iarchivedmywholelife@gmail.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun May 12 20:11:21 2024 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 1s6DfN-0004ny-C7 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 12 May 2024 20:11:21 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s6Df6-0000Kd-9H; Sun, 12 May 2024 14:11:04 -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 1s6Df4-0000KV-5v for bug-gnu-emacs@gnu.org; Sun, 12 May 2024 14:11:02 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s6Df3-0005Fy-KT for bug-gnu-emacs@gnu.org; Sun, 12 May 2024 14:11:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s6Df3-0007WK-JH for bug-gnu-emacs@gnu.org; Sun, 12 May 2024 14:11:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Heerdegen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 12 May 2024 18:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70868 X-GNU-PR-Package: emacs Original-Received: via spool by 70868-submit@debbugs.gnu.org id=B70868.171553745128902 (code B ref 70868); Sun, 12 May 2024 18:11:01 +0000 Original-Received: (at 70868) by debbugs.gnu.org; 12 May 2024 18:10:51 +0000 Original-Received: from localhost ([127.0.0.1]:55708 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s6Des-0007W6-KW for submit@debbugs.gnu.org; Sun, 12 May 2024 14:10:50 -0400 Original-Received: from mout.web.de ([212.227.15.14]:46045) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s6Deo-0007W0-46 for 70868@debbugs.gnu.org; Sun, 12 May 2024 14:10:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=web.de; s=s29768273; t=1715537434; x=1716142234; i=michael_heerdegen@web.de; bh=NwXoREzaRBiwL+gkuN/jqeqAvTYV+28lw3pd79IjzmI=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=YDMTjGP6LHki1W1qZTu0cwf60PTVuVBYgfurBavw+aCjCWAtmn6ZCf4aoLy2G4pW vS9hQ5ZdQ3U0auBO7WmGXo9qMf82WCQCS2VaMUXaXTA+bd2Q2mUUZkDWVpzQpVwaC 933YeW21EfHfmqnpcpBWtMXlYgAdvu+9/tnOOwTd73otLU5IFbEHsKhcljXCCu9d8 iIeC87L9l+/DSc+xx4j18B8X0QQOsWRUdVeI1gnDoxPC7ymNuYNhKihvFHZGGabsW rOv9ov/6/O3Um7hPbKocwhXmrikGd7raV9Km0iBLilbySEiOahCvG5xeVkEPnhkFr uKlAAQxqjGOAPDO0JA== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Original-Received: from drachen.dragon ([84.57.248.23]) by smtp.web.de (mrweb006 [213.165.67.108]) with ESMTPSA (Nemesis) id 1N6bD0-1sf7zA2lcU-017xiA; Sun, 12 May 2024 20:10:34 +0200 In-Reply-To: <86frunyr3o.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 12 May 2024 18:42:03 +0300") X-Provags-ID: V03:K1:AAYl8Gl8F4EwHg29sz0d/tPRki8eY203coNXytzDXd/sNSEIa7N +tE+uRDF8HAh4V07n40bgCls2uLNKzOIxhN2PSEngFtAyw5C6YeRNpAo6xTDyoaSiSndnZu YYqgRFJ5wjgc7ogwieJDS8+AiQtnMSTNIE/eAHh+Upj/cvzlG2U9q/a9vvaH2FcZ4NafsDk pO0gEkAT2fUGOOBx9PTNw== UI-OutboundReport: notjunk:1;M01:P0:2B6vi+qyM4s=;AiXkD6WDdZ8CC8QGFxefj6ZT00m tJoAeIHbvGzLHQBlV3m6lu8GWsymmTKcLE4a/c9fwweg5+SvshraBYCRxIQutNjXeg5HZnX+5 P0cRp73W3ByDCLkJAwfin6TsaIJJvNEEukR+rb9jifb05XpDDrXnWLtjgligK82jyuyq5YFya 6tstpnTi5lveIBxRtKOvo/BkqoRMZUqzyACWLq0tqNQk/sHRzzOx+MKwSRDJqifBoS4CsR+g+ s0RoQTOo+/NCCO+1ofilUZX6ml8Es10y8honfeLla+clMN2cpwWKFt9T2sqLlnnTVx4OlVpm7 xVH7x8zCM+RfVYKRA3sO4ae1xOVY+GhWNV8rP0ryIW7h+J7LwS+aTniHMm+MylQD5pWSjJA3C uNYO9u1yE9dyNnHjvFAiUnMM8e5xf50Gdxdg0XIpgTULjv91LAWb1iz3nvH+nmNgcHpGscWsr QoyfOiR+hNpQJEroIOLDfxGcP9Fkn+iYHcm8OHEn03zCT2UgvOszTTy3IgXxnvCm7shnsrHrA KX4V84Y1Xn2NM4FBe8ubeA8C23LV/6CGMwSdVFhWq6w45FYnA4umuQ3JrYgvJelZ0AftXz0Xg anvsnJXyhjn1fR563OQd+aVe5SnWlrqDp/TJ+0L30Tv9CNJcAIyR1agSS+iEfWF3bAz/UCGeS HPpcshcMvwGEtiYJIiKdQS68Xw0jNkfplky8w/DRGBvKUgj2wDf/Fvuydp1/vbuegP6yPmxqS MkaWnNTWrk4lhXZ+BEa46wjJXQAJA532R2VRVhxXh3CY9sYu0lqs6tk7V6OfK/X49KoI45q8 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:284938 Archived-At: --=-=-= Content-Type: text/plain Eli Zaretskii writes: > > Yes - but independent of that I think we want to switch printing using > > `prin1'. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-lisp-emacs-lisp-pp.el-pp-insert-lisp-Always-print-wi.patch Content-Transfer-Encoding: quoted-printable =46rom 3024833e9557e2400a83f0e71b474c35d927260d Mon Sep 17 00:00:00 2001 From: Michael Heerdegen Date: Sun, 12 May 2024 19:55:30 +0200 Subject: [PATCH 1/2] * lisp/emacs-lisp/pp.el (pp--insert-lisp): Always pri= nt with prin1 This fixes an aspect of Bug#70868. =2D-- lisp/emacs-lisp/pp.el | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/lisp/emacs-lisp/pp.el b/lisp/emacs-lisp/pp.el index 47805d3dbde..f24b0d55520 100644 =2D-- a/lisp/emacs-lisp/pp.el +++ b/lisp/emacs-lisp/pp.el @@ -494,16 +494,12 @@ pp--insert-lisp (prin1 sexp (current-buffer))))) ;; Print some of the smaller integers as characters, perhaps? (integer - (if (<=3D ?0 sexp ?z) - (let ((print-integers-as-characters t)) - (princ sexp (current-buffer))) - (princ sexp (current-buffer)))) + (let ((print-integers-as-characters (<=3D ?0 sexp ?z))) + (prin1 sexp (current-buffer)))) (string (let ((print-escape-newlines t)) (prin1 sexp (current-buffer)))) - (symbol - (prin1 sexp (current-buffer))) - (otherwise (princ sexp (current-buffer))))) + (otherwise (prin1 sexp (current-buffer))))) (defun pp--format-vector (sexp) (insert "[") =2D- 2.39.2 --=-=-= Content-Type: text/plain And while we talk about these lines: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0002-Don-t-try-to-pretty-print-non-lists-as-binding-list.patch Content-Transfer-Encoding: quoted-printable =46rom d9c32c4bce32838fbe44a0f8bfb4ed04b34d65f7 Mon Sep 17 00:00:00 2001 From: Michael Heerdegen Date: Sun, 12 May 2024 19:58:14 +0200 Subject: [PATCH 2/2] Don't try to pretty print non-lists as binding list * lisp/emacs-lisp/pp.el (pp--format-definition): Avoid barfing for SEXPs like (let X Y) in `pcase' forms: ensure that what we try to print as a list of bindings actually has an appropriate format. =2D-- lisp/emacs-lisp/pp.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/pp.el b/lisp/emacs-lisp/pp.el index f24b0d55520..aae3d2f78bf 100644 =2D-- a/lisp/emacs-lisp/pp.el +++ b/lisp/emacs-lisp/pp.el @@ -576,7 +576,8 @@ pp--format-definition (unless (consp edebug) (setq edebug nil)) (if (and (consp (car edebug)) - (eq (caar edebug) '&rest)) + (eq (caar edebug) '&rest) + (proper-list-p (car sexp))) (pp--insert-binding (pop sexp)) (if (null (car sexp)) (insert "()") =2D- 2.39.2 --=-=-= Content-Type: text/plain > That will probably come with problems of its own... Unless it's clear: keep in mind that we only speak about atomic objects here (no sequences) - this helper function is only intended for simple objects like characters. Also note that - unless I'm missing some aspect - printing with `princ' instead of `prin1' will either produce the same result or a broken result that cannot be `read' - and the function makes the promise to print code. Michael. --=-=-=--