From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Maxim Cournoyer Newsgroups: gmane.emacs.bugs Subject: bug#56197: 28.1; lisp-fill-paragraph result regressed with Emacs 28 Date: Sat, 28 Dec 2024 14:26:32 +0900 Message-ID: <87seq8tm2f.fsf@gmail.com> References: <87zgi2xcgm.fsf@gmail.com> <87y1xlj6wn.fsf@gnus.org> <834k08c3se.fsf@gnu.org> <874k08kj31.fsf@gnus.org> <87y1xkj4co.fsf@gnus.org> <87tu88j3tf.fsf@gnus.org> <87bjwzr027.fsf@lease-up.com> <86v7v7ynf0.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38374"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: larsi@gnus.org, 56197@debbugs.gnu.org, Felix Lechner , stefankangas@gmail.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 28 06:28:22 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 1tRPN8-0009np-FU for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 28 Dec 2024 06:28:22 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tRPMw-00046w-Mf; Sat, 28 Dec 2024 00:28:11 -0500 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 1tRPMq-00046e-6q for bug-gnu-emacs@gnu.org; Sat, 28 Dec 2024 00:28:04 -0500 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 1tRPMo-0006K8-GF for bug-gnu-emacs@gnu.org; Sat, 28 Dec 2024 00:28:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=D5SkTVQjCJOMt+WN1DcII+1/Tna+eWyHxcerRF/cNmc=; b=n7nE+a/UbMrPw92fzm11MEDL5f6ClWdQcyRDqyuAwimz6pthvjfTIUBQusXbc1A0vxMkPKxwNsHMGyy4IFUY3BxmcNs03hV8W/MISxQtkUR0Y7cQFMa+fVFoH8Hw2mPGVMQoDh/lFDRgP9zDtP3l+KvE2DtYp0TNGZJfj7HJqBvc0qjKkIMmnmD4k5BTSzG7pMATk5tJWddFemqmURt8XBu376Ll4bHunk124Ag+QMQgSwXZThjc48ApMSPGNl5J5I4zHWkM392FUS0EqBrjQXANS3ZS6B8W8He+NEbdAtaPLGtYLMhgXZHo/qp4Lv0i9zQ0X0HxswkJ51cet/KrZA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tRPMo-0007PJ-2A for bug-gnu-emacs@gnu.org; Sat, 28 Dec 2024 00:28:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 28 Dec 2024 05:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56197 X-GNU-PR-Package: emacs Original-Received: via spool by 56197-submit@debbugs.gnu.org id=B56197.173536367228449 (code B ref 56197); Sat, 28 Dec 2024 05:28:02 +0000 Original-Received: (at 56197) by debbugs.gnu.org; 28 Dec 2024 05:27:52 +0000 Original-Received: from localhost ([127.0.0.1]:48370 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tRPMe-0007Ok-8Q for submit@debbugs.gnu.org; Sat, 28 Dec 2024 00:27:52 -0500 Original-Received: from mail-pj1-f53.google.com ([209.85.216.53]:51630) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tRPMb-0007OE-N8 for 56197@debbugs.gnu.org; Sat, 28 Dec 2024 00:27:50 -0500 Original-Received: by mail-pj1-f53.google.com with SMTP id 98e67ed59e1d1-2ee709715d9so7728823a91.3 for <56197@debbugs.gnu.org>; Fri, 27 Dec 2024 21:27:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1735363604; x=1735968404; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=D5SkTVQjCJOMt+WN1DcII+1/Tna+eWyHxcerRF/cNmc=; b=KlbU2/qTVWb2wlA+XpOQbJSTzFLcmb8i81U7zArwTZEIZAXAFAEDTwbSlBAIFct6wC 0sw1fvrjsoEGYZ92ksZpAUKcezj2dDpMEk8uh2jaDltOUnVrtyZb93ghGyU+Z95sRB5q B6Tdvod7TYAb+nNFC2yEJO5gzT9lx/w07/uG5BE4B2Asue+F1SzZ9wncGcJDO4gY1YPu znokyTwnx7L9qFyxZmjnlSW5eecL7L3jlwUfqEeCXNjkRaheodOFKj6kZWZKakkiD9tK T101yprQVXHfolR4dgWdhAWS45NgNqo/QBDMqid1PNzp2Wg6FxZj7YcZGKgoo4TMvQls BkeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735363604; x=1735968404; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=D5SkTVQjCJOMt+WN1DcII+1/Tna+eWyHxcerRF/cNmc=; b=kDeWH/8c8bRAiYjVXHcHlHc+e/ThcgHbI9tR8p7NZ+JJeVYFBbVNT/OWbjQ7QaWshV rFCj3A3OWLPg8Xmt0z92v6+Pt/CpStk93d0oIR03QgHr+pMtrSuTWP6MH4D/TGn/O88Z NK6YP3eB43MvTrUluPiv2fALgWBG9JVLPh2edOWyFGgt6BtUr11olL6Z3ttyoypZ+oft iq5LgWiH4CkRpE6f3wr/8Zco88wfMSJo5Iohp80z9oQoCQnfscl9QeXWCariUNEHY7gM LQAt4d54E30U8cvpmfrmTuuXA4fq+CQAZN+DFi5A7XCsuw66slWbZyqVHdIxlljjXVg7 Z92g== X-Forwarded-Encrypted: i=1; AJvYcCWfsbt6RDay6bxSnACroJxnw4aGEIDV8kDTy7BFPzvG6Hj8hZ21Lu1y/l4H7a+t08yhpT3O2A==@debbugs.gnu.org X-Gm-Message-State: AOJu0YyvyY2XFcvFvW1XjpuAdb6nGOfawQPy9n2qqkdBku8UB0Wb9qRW N+8CKjX8eTjFtYHzu2NMSW98awaeP/AX8ZRXLQWo6E5qqO7i4icr X-Gm-Gg: ASbGncv2RNTYc8Mx1RLi4FnnX288sDJutzYkhn6rWMkgALgVdTe/1zzHXj7w6o3JRPI 6jG6TEMKfnVVSPFg8fp7my87a5qyGXw3V3o6pb+AIuRi0q9Zdz6mjSjkI1dB//QhUXQh/oXUs7q FZ+byuDvSjP1lpCC+7QK+j0pkoe3DoTAXNHyqYp2Hde7odY0kkQnl6XcpOy7jkZfPVSOzVLXmLq 8t4ENw8qk/X2dxv6eDOKwfS+va4KShxkJ5GB2yGAzwjsas5S1rTTA== X-Google-Smtp-Source: AGHT+IGVfF3ztsXCM9B3WL/auiH6yik0el1L3PCgTt5eJEcxS5H1pwB+c1Xav/yCAVT+GDEE7z41gg== X-Received: by 2002:a17:90b:1b46:b0:2ee:c4f2:a77d with SMTP id 98e67ed59e1d1-2f452e4ce8amr38560858a91.21.1735363603749; Fri, 27 Dec 2024 21:26:43 -0800 (PST) Original-Received: from terra ([2405:6586:be0:0:c8ff:1707:9b9:af89]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f2ed82d27esm18508337a91.31.2024.12.27.21.26.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Dec 2024 21:26:43 -0800 (PST) In-Reply-To: <86v7v7ynf0.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 26 Dec 2024 08:21:39 +0200") 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:297848 Archived-At: Hello, Eli Zaretskii writes: [...] >> Filling strings in code would be useful, but isn't that a separate, >> don't-break-my-strings feature? > > Not necessarily. I frequently fill stuff in my code, and don't want > to use a separate command if the region I fill includes strings (or > comments, or something other that needs special filling behavior). I agree that having a single way to 'fill text/code/whatever' is nice. [...] > You are quoting text which talks about the _default_ filling. The > default filling is tailored to "uniform" text, i.e. really to Text > mode and its descendants. > > However, Emacs lets major modes customize filling as appropriate for > the mode, by defining mode-specific filling functions. Which is what > happens in this case: lisp-mode.el defines a fill-paragraph function > that is specific to Lisp modes. It is completely legitimate for such > mode-specific functions to special-case strings inside code and do > something special about that. > > So I don't see how what we do now is against the spirit of filling. Maybe it doesn't in general, but in the case of Guix packages, it's strikingly odd compared to the past behavior which was respecting the fill-column in a long multi-line string (refer to the original issue I had detailed in this thread for an example). > (Btw, I think it's high time we closed that bug, since Emacs 28.2 was > released long ago.) It's a change of behavior introduced in version 28 that apparently doesn't make unanimity (though perhaps noticed mostly by Guix developers, where the use of the multi-line strings for package descriptions makes this issue very visible and annoying); the GNU Guix project has been carrying this in its .dir-locals.el file, which simply reverts to the old behavior before commit 9bf367e1848: --8<---------------cut here---------------start------------->8--- ;; Emacs 28 changed the behavior of 'lisp-fill-paragraph', which causes the ;; first line of package descriptions to extrude past 'fill-column', and ;; somehow that is deemed more correct upstream (see: ;; https://issues.guix.gnu.org/56197). (eval . (progn (require 'lisp-mode) (defun emacs27-lisp-fill-paragraph (&optional justify) (interactive "P") (or (fill-comment-paragraph justify) (let ((paragraph-start (concat paragraph-start "\\|\\s-*\\([(;\"]\\|\\s-:\\|`(\\|#'(\\)")) (paragraph-separate (concat paragraph-separate "\\|\\s-*\".*[,\\.]$")) (fill-column (if (and (integerp emacs-lisp-docstring-fill-column) (derived-mode-p 'emacs-lisp-mode)) emacs-lisp-docstring-fill-column fill-column))) (fill-paragraph justify)) ;; Never return nil. t)) (setq-local fill-paragraph-function #'emacs27-lisp-fill-paragraph))) --8<---------------cut here---------------end--------------->8--- I can't say it feels very satisfactory; a switch like one imagined by Felix could be a step in the right direction; it'd be at least more concise in the project .dir-locals. Would a patch implementing that be welcome? Happy New Year, -- Maxim