From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#63861: [PATCH] pp.el: New "pretty printing" code Date: Sat, 03 Jun 2023 08:53:41 +0300 Message-ID: <83fs799jmi.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26238"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 63861@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jun 03 07:53:21 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 1q5KCW-0006hn-VU for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 03 Jun 2023 07:53:21 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q5KCH-0005Ee-2N; Sat, 03 Jun 2023 01:53:05 -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 1q5KCF-0005EO-1b for bug-gnu-emacs@gnu.org; Sat, 03 Jun 2023 01:53:03 -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 1q5KCE-0000O5-Ok for bug-gnu-emacs@gnu.org; Sat, 03 Jun 2023 01:53:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q5KCE-0001ti-H0 for bug-gnu-emacs@gnu.org; Sat, 03 Jun 2023 01:53:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 03 Jun 2023 05:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63861 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 63861-submit@debbugs.gnu.org id=B63861.16857715797283 (code B ref 63861); Sat, 03 Jun 2023 05:53:02 +0000 Original-Received: (at 63861) by debbugs.gnu.org; 3 Jun 2023 05:52:59 +0000 Original-Received: from localhost ([127.0.0.1]:41406 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q5KCA-0001tO-J2 for submit@debbugs.gnu.org; Sat, 03 Jun 2023 01:52:58 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:58428) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q5KC8-0001tA-LR for 63861@debbugs.gnu.org; Sat, 03 Jun 2023 01:52:57 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q5KC2-0000Mr-Rc; Sat, 03 Jun 2023 01:52:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=ROdT8QHL2rTNR5r1l/g5vLc4rvSSxh7Ow2uxtxfjIks=; b=kUxl451vEGiV tNB03QS/TUorySQHAXxLUq3WZOzuymRZq3aA78jnONc58WmCKo5FDKr8NDfOMfGrErO6Wqwnsa2dK SD6lklvUG5ZVT0gP+qfEYVNIWG5/IKSq6MUrqJtLxsM8U53LeZY90Dfwgqapj/jGJkewHEQjOeAsZ wukE9Tv4sVToyhmk3achYiYWDOacfFzc9/RjytmBKLV4vpPxUjZBTEIrYEyDDB7wVlLp0yyefRaBG bWZRvW+jX6Q6P9JN33alaoT4NjvO6GApzC0qLGXP9tJObaDcHHz+KEx92Pgz9MNxR8uAsPalxXnOI 0lsxQpVkxG45FYLiv3jRtA==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q5KC2-00071C-Bg; Sat, 03 Jun 2023 01:52:50 -0400 In-Reply-To: (bug-gnu-emacs@gnu.org) 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:262799 Archived-At: > Date: Fri, 02 Jun 2023 18:50:57 -0400 > From: Stefan Monnier via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > I've often been annoyed by the way `ielm` "pretty prints" data, > so I wrote my own pretty printer, which has evolved over the years. > I believe it has finally reached a state which may be acceptable > to more than just myself. > > The new code is in a new function `pp-region`. > The old code redirects to the new code if `pp-buffer-use-pp-region` is > non-nil, tho I'm not sure we want to bother users with such > a config var. Hopefully, the new code should be good enough that users > don't need to choose. Maybe I should make it a `defvar` and have it > default to t, so new users will complain if it's not good enough? Thanks. I almost never use IELM, so I have no significant comments to this, only minor ones. > +(defun pp-region (beg end) > + "Insert newlines in BEG..END to try and fit within `fill-column'. > +Presumes the current buffer contains Lisp code and has indentation properly > +configured for that. > +Designed under the assumption that the region occupies a single line, > +tho it should also work if that's not the case." The first line should say what this command does. Also, I think this warrants a NEWS entry and should be documented in the ELisp manual. > +(defcustom pp-buffer-use-pp-region nil > + "If non-nil, `pp-buffer' uses the new `pp-region' code." > + :type 'boolean) Please add :version. Also, "the new code" should be rephrased to not use "new" (which doesn't stand the time test). And the new defcustom should probably be mentioned in the manual, perhaps where we mention IELM.