From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Madhu Newsgroups: gmane.emacs.devel Subject: default pp-fill behaviour Date: Sun, 25 Jun 2023 07:39:47 +0530 (IST) Message-ID: <20230625.073947.546321755111709732.enometh@meer.net> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31342"; mail-complaints-to="usenet@ciao.gmane.io" To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Jun 25 04:11:47 2023 Return-path: Envelope-to: ged-emacs-devel@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 1qDFEB-0007yd-Ae for ged-emacs-devel@m.gmane-mx.org; Sun, 25 Jun 2023 04:11:47 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qDFDm-0000Mk-9y; Sat, 24 Jun 2023 22:11:22 -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 1qDFDk-0000MR-98 for emacs-devel@gnu.org; Sat, 24 Jun 2023 22:11:20 -0400 Original-Received: from smtp3.ctinetworks.com ([205.166.61.187]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qDFDi-0006AA-1l for emacs-devel@gnu.org; Sat, 24 Jun 2023 22:11:19 -0400 Original-Received: from smtp5.ctinetworks.com (smtp5.ctinetworks.com [205.166.61.198]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp3.ctinetworks.com (Postfix) with ESMTPS id 8EB2D306F087 for ; Sat, 24 Jun 2023 22:10:30 -0400 (EDT) Original-Received: from localhost (unknown [117.193.2.126]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: enometh@meer.net) by smtp5.ctinetworks.com (Postfix) with ESMTPSA id 7B2651608BE for ; Sat, 24 Jun 2023 22:11:10 -0400 (EDT) X-Mailer: Mew version 6.9 on Emacs 30.0.50 X-ctinetworks-Information: Please contact the ISP for more information X-ctinetworks-MailScanner-ID: 8EB2D306F087.AEF1D X-ctinetworks-VirusCheck: Found to be clean X-ctinetworks-Watermark: 1688523032.26518@zR7Nh55r8gEVZapAJ95Upw Received-SPF: pass client-ip=205.166.61.187; envelope-from=enometh@meer.net; helo=smtp3.ctinetworks.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-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: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:307197 Archived-At: This is about the state after the series of commits including: * commit 2f181d60323bd9e0196775828de633100479f4c2 |Author: Stefan Monnier |AuthorDate: Fri Jun 16 13:35:06 2023 -0400 |Commit: Stefan Monnier |CommitDate: Sat Jun 17 17:24:38 2023 -0400 | | pp.el (pp-fill): New default pp function | | * lisp/emacs-lisp/pp.el (pp-default-function): Change default. | (pp--within-fill-column-p): New helper function. | (pp-fill): New function. The problem is to print an alist in a buffer one element per line: ``` (setq $alist '((1 . a) (2 . b) (3 . c))) (with-output-to-temp-buffer "*temp*" (let ((print-level nil) (print-length nil)) (pp $alist))) ``` This would give you a temp buffer with this contents ``` ((1 . a) (2 . b) (3 . c)) ``` Emacs-30.0.50 now produces ``` ((1 . a) (2 . b) (3 . c)) ``` If I try to use the new global level variable pp-max-width pp-use-max-width to prevent filling and get back the old behaviour, I can't. ``` (if (fboundp 'pp-28) (let ((pp-default-function 'pp-28)) (pp $alist)) (pp $alist)))) ``` I'd like the old behaviour to be accessible with a global switch. The new pp machinery is complex and ( uses the usual impenetrable undebuggable functional paradims) but if it is not powerful enough produce the old behaviour in one of its code paths, isn't the power is in question.