From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Klaus-Dieter Bauer Newsgroups: gmane.emacs.devel Subject: pp.el: `pp-buffer' not pretty when `print-circle' non-nil Date: Mon, 30 Sep 2013 14:37:33 +0200 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=047d7b3a914c76221504e7991bcb X-Trace: ger.gmane.org 1380544691 23861 80.91.229.3 (30 Sep 2013 12:38:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 30 Sep 2013 12:38:11 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Sep 30 14:38:14 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VQcjt-0003ei-Dq for ged-emacs-devel@m.gmane.org; Mon, 30 Sep 2013 14:38:13 +0200 Original-Received: from localhost ([::1]:48654 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VQcjs-0006m1-VB for ged-emacs-devel@m.gmane.org; Mon, 30 Sep 2013 08:38:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42011) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VQcjp-0006l4-Fd for emacs-devel@gnu.org; Mon, 30 Sep 2013 08:38:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VQcjk-00086t-M1 for emacs-devel@gnu.org; Mon, 30 Sep 2013 08:38:09 -0400 Original-Received: from mail-vb0-x22c.google.com ([2607:f8b0:400c:c02::22c]:44257) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VQcjk-00086h-HI for emacs-devel@gnu.org; Mon, 30 Sep 2013 08:38:04 -0400 Original-Received: by mail-vb0-f44.google.com with SMTP id e13so3735689vbg.31 for ; Mon, 30 Sep 2013 05:38:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=9wk047spsgldszG1j44vWX5hHn/BAkUPwU1lX0GyR9o=; b=mJFDO3sEaVpROaOgkDdIKiTfxtmAkl9Axd+LIE/nW3qcqiQdu5XUaFgm+mLfGr/0NB 2zQ2EUaGang8lJZd/AYPjdFQZxnKnpuUvmKpcu7n/k82FJJYN3NGFYEsU2kWfaub+8DF /9/e+ZM8fJWMEaBSCpFHDN/pQA3Tx0d3JctDG7E8H+Ikn3vyyfGbpM3h6EapKblnFb8F 1c/B7yYpJ0tTYlOuT/R2TKKqL63A3lDCbGyI/W14D6Jap2mJdCeUkB652OK39A65Vb7Q mbGbPGnPgiSRj63EffilrKrvCJdGHZTII4hBb0TBIp6yvW/KY16f400wIj2XwQpHFn9y NBrQ== X-Received: by 10.220.43.19 with SMTP id u19mr22098918vce.3.1380544683580; Mon, 30 Sep 2013 05:38:03 -0700 (PDT) Original-Received: by 10.220.229.195 with HTTP; Mon, 30 Sep 2013 05:37:33 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400c:c02::22c X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:163726 Archived-At: --047d7b3a914c76221504e7991bcb Content-Type: multipart/alternative; boundary=047d7b3a914c76221104e7991bc9 --047d7b3a914c76221104e7991bc9 Content-Type: text/plain; charset=UTF-8 Hello! When working on a double-linked list data structure I noticed that in the current implementation `pp-buffer' and therefore `pp-to-string' and `pp' produce not-so-pretty output: ;; ----- [mu-queue 3 #1=[mu-queue--node 1 nil #2=[mu-queue--node 2 #1# #3=[mu-queue--node 3 #2# nil]]] #3#] ;; ----- Applying the attached patch would result in the form: ;; ----- [mu-queue 3 #1=[mu-queue--node 1 nil #2=[mu-queue--node 2 #1# #3=[mu-queue--node 3 #2# nil]]] #3#] ;; ----- which corresponds better to the behaviour withouut `print-circle'. Since there should be whitespace before the #1=(...) forms, the change also should not break existing behaviour. kind regards, Klaus-Dieter Bauer PS: Without `print-circle' the data structure reads [mu-queue 3 [mu-queue--node 1 nil [mu-queue--node 2 #1 [mu-queue--node 3 #2 nil]]] [mu-queue--node 3 [mu-queue--node 2 [mu-queue--node 1 nil #2] #1] nil]] --047d7b3a914c76221104e7991bc9 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hello!

When working on a double-linked = list data structure I noticed that in the current implementation `pp-buffer= ' and therefore `pp-to-string' and `pp' produce not-so-pretty o= utput:

;; -----
[mu-queue 3 #1=3D[mu-queue--nod= e 1 nil #2=3D[mu-queue--node 2 #1# #3=3D[mu-queue--node 3 #2# nil]]]
<= div>=C2=A0 =C2=A0 #3#]
;; -----

Applying the attached patch would result in the form:=C2=A0

;; -----
[mu-queue 3
=C2= =A0 =C2=A0 #1=3D[mu-queue--node 1 nil
=C2=A0 #2=3D[mu-queue--node 2 #1#
=C2=A0#3=3D[mu-queue--node 3= #2# nil]]]
=C2=A0 =C2=A0 #3#]
;; -----

which corresponds better to the behaviour withouut `print-circle'. S= ince there should be whitespace before the #1=3D(...) forms, the change als= o should not break existing behaviour.=C2=A0

kind regards, Klaus-Dieter Bauer


PS: Without `print-circle' the data structure reads

[mu-queue 3
=C2=A0[mu-queue--node 1 = nil
=C2=A0 [mu-queue--node 2 #1
=C2=A0 =C2=A0[mu-queue--node 3 #= 2 nil]]]
=C2=A0[mu-queue--node 3
=C2=A0 [mu-queue--node= 2
=C2=A0 =C2=A0[mu-queue--node 1 nil #2]
=C2=A0 =C2=A0= #1]
=C2=A0 nil]]
--047d7b3a914c76221104e7991bc9-- --047d7b3a914c76221504e7991bcb Content-Type: application/octet-stream; name="20130930-pp.el.patch" Content-Disposition: attachment; filename="20130930-pp.el.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_hm7nfhcw0 LS0tIHBwLmVsLm9yaWcJMjAxMy0wOS0zMCAxMjoxNzo0MS4yOTA4OTIyMDAgKzAyMDAKKysrIHBw LmVsCTIwMTMtMDktMzAgMTI6MTg6NTkuMjMwNDU0MTAwICswMjAwCkBAIC02MCw3ICs2MCw3IEBA CiAgICAgICgoaWdub3JlLWVycm9ycyAoZG93bi1saXN0IDEpIHQpCiAgICAgICAoc2F2ZS1leGN1 cnNpb24KICAgICAgICAgKGJhY2t3YXJkLWNoYXIgMSkKLSAgICAgICAgKHNraXAtY2hhcnMtYmFj a3dhcmQgIidgI14iKQorICAgICAgICAoc2tpcC1jaGFycy1iYWNrd2FyZCAiJ2AjXj0wMTIzNDU2 Nzg5IikKICAgICAgICAgKHdoZW4gKGFuZCAobm90IChib2JwKSkgKG1lbXEgKGNoYXItYmVmb3Jl KSAnKD9ccyA/XHQgP1xuKSkpCiAgICAgICAgICAgKGRlbGV0ZS1yZWdpb24KICAgICAgICAgICAg KHBvaW50KQo= --047d7b3a914c76221504e7991bcb--