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: Tue, 13 Jun 2023 13:55:14 +0300 Message-ID: <83pm5zws19.fsf@gnu.org> References: <83fs799jmi.fsf@gnu.org> <83r0qs74qs.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31190"; 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 Tue Jun 13 13:22:16 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 1q926K-0007rd-0D for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 13 Jun 2023 13:22:16 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q91gx-00041l-C8; Tue, 13 Jun 2023 06:56: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 1q91gw-00041V-Hw for bug-gnu-emacs@gnu.org; Tue, 13 Jun 2023 06:56: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 1q91gw-0001Rd-9L for bug-gnu-emacs@gnu.org; Tue, 13 Jun 2023 06:56:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q91gw-0006kL-51 for bug-gnu-emacs@gnu.org; Tue, 13 Jun 2023 06:56: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: Tue, 13 Jun 2023 10:56: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.168665374025906 (code B ref 63861); Tue, 13 Jun 2023 10:56:02 +0000 Original-Received: (at 63861) by debbugs.gnu.org; 13 Jun 2023 10:55:40 +0000 Original-Received: from localhost ([127.0.0.1]:41439 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q91ga-0006jl-7a for submit@debbugs.gnu.org; Tue, 13 Jun 2023 06:55:40 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:60456) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q91gW-0006jV-1E for 63861@debbugs.gnu.org; Tue, 13 Jun 2023 06:55:39 -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 1q91gQ-0001O7-Q9; Tue, 13 Jun 2023 06:55:30 -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=UeK39kkedwOcsWx0edCU13zZYwesJ/KDMaiCHv0om98=; b=a3ipZUupzu9g +AJMwK3mcavalqChwG1ushlMrZKuNCikX+mc3q+DEOddWUOhZuqqp33lG0+1GkTsREVO5/lOJ4LPD nq5Y2r0hyzxcEoX4KMD/c7geGFKDDGsukT10MxkxyoQEHneP4iLSvWVjjpmYCAycKJFk/4fmU4afJ RBe5zw+QZUFa5L/I7kf2PNiHdoeoy83ibnoC/Kz4b1Gvxb/tq7Vhfk5eZwaw6u72+srmnPVCt+Wae MMNF0mHXA61pNOX5I9KcLeS0wbahphLivxrNZsqYQDV6m3AOo+Vhb2VVQoFefq00QMovdhbdzf0eU tn9VthuaMeEQIdi4mQssGA==; 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 1q91gC-0003BF-Ql; Tue, 13 Jun 2023 06:55:29 -0400 In-Reply-To: (message from Stefan Monnier on Mon, 12 Jun 2023 16:21:50 -0400) 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:263309 Archived-At: > From: Stefan Monnier > Cc: 63861@debbugs.gnu.org > Date: Mon, 12 Jun 2023 16:21:50 -0400 > > > We document "pp" in "Output Functions". Maybe there? > > Haven't looked at that yet: I'm still trying to figure out how the > functionality should be exposed. Well, just don't forget that when you eventually install ;-) > +(defcustom pp-default-function #'pp-fill > + ;; FIXME: The best pretty printer to use depends on the use-case > + ;; so maybe we should allow callers to specify what they want (maybe with > + ;; options like `fast', `compact', `code', `data', ...) and these > + ;; can then be mapped to actual pretty-printing algorithms. > + ;; Then again, callers can just directly call the corresponding function. > + "Function that `pp' should dispatch to for pretty printing. > +That function can be called in one of two ways: > +- with a single argument, which it should insert and pretty-print at point. > +- with two arguments which delimit a region containing Lisp sexps > + which should be pretty-printed. > +In both cases, the function can presume that the buffer is setup for > +Lisp syntax." Perhaps say in the doc string something about when each algorithm is slower/faster? Otherwise LGTM, thanks.