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#72870: [PATCH] Flow fill texts after the last hard newline Date: Sat, 07 Sep 2024 10:51:42 +0300 Message-ID: <867cbnzysx.fsf@gnu.org> References: <87cylr7gmj.fsf@pengjiz.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28931"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 72870@debbugs.gnu.org To: Pengji Zhang Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Sep 07 09:52:27 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 1smqF8-0007OL-8n for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 07 Sep 2024 09:52:26 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1smqEn-0000h9-4e; Sat, 07 Sep 2024 03:52: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 1smqEj-0000fd-Tu for bug-gnu-emacs@gnu.org; Sat, 07 Sep 2024 03:52:02 -0400 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 1smqEj-00014M-KZ for bug-gnu-emacs@gnu.org; Sat, 07 Sep 2024 03:52:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:In-Reply-To:From:Date:To:Subject; bh=O+ZpYaK9EqeT+BlO6xjuF5l9euqE6Ned8Sabyv6xBQ8=; b=KWPuSp29wt43gv5ty+dukh7iv+bVJ5AIVf/WxWa9o+vFm+UM+QpJAjfwapZAnwGzwb0NrDNBEe2/rhAhnDea5MXqzeNMUzembUIJwXTBSBp4diZMwtLMWLXnLt6IIswuQieW/c344XKkeQ4IS0buMJI4trikyhilIW3YDcnJJgKcUi3GK1YX3l+yMYlMJCGdHYVNxJ0qdU0BCVS0lKGU8OqQkUJrZg35N7GG7Kd2J7u63qSgvi3Nd9+9rpMGn+Q7IMN6rKU657bdI/AbKRuR7na3cox5nWZDQy1tQEm3lKfmk0l4v1UyfmdTxH92wpqaeAhGNCzzjmYLKjpmAKXlFA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1smqEk-0002Gd-3J for bug-gnu-emacs@gnu.org; Sat, 07 Sep 2024 03:52: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, 07 Sep 2024 07:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72870 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 72870-submit@debbugs.gnu.org id=B72870.17256955128694 (code B ref 72870); Sat, 07 Sep 2024 07:52:02 +0000 Original-Received: (at 72870) by debbugs.gnu.org; 7 Sep 2024 07:51:52 +0000 Original-Received: from localhost ([127.0.0.1]:54741 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smqEZ-0002G9-Hi for submit@debbugs.gnu.org; Sat, 07 Sep 2024 03:51:51 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:42524) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smqEX-0002Fx-QI for 72870@debbugs.gnu.org; Sat, 07 Sep 2024 03:51:50 -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 1smqER-00013K-OM; Sat, 07 Sep 2024 03:51:43 -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=O+ZpYaK9EqeT+BlO6xjuF5l9euqE6Ned8Sabyv6xBQ8=; b=DcuAX18zLvBX K8gwHpU8X/iSarJqi29/8CXTCaxIflaTDtJ/ITY9ZX4j0h+RjxscgFrtA+hI5QO1e+0pzE4JA6N4U Qmwx5prdhLoXtSWdMh09N1FxQov7DtBU94wyo4k0EQ62fDwxOrKGMIpqwPw0tG3mn2qrmf9LJ7O8i QSq5IkD+gW8JI8mC+gtvopJsuRpyjsiYi7o61GZz6ilu8rh7atLM+vD1yHtXOrrQMzf0qoJyMraek Pq7YOikWL9ti/pFaTXJDuXNpsLj67wnJ4ysXK5ogwxZtlzT4S1WIDZiKcm+GMIMpwVbCZuT7SyTIF WFtJcD49Wh9c9VWEe9pk4A==; In-Reply-To: <87cylr7gmj.fsf@pengjiz.com> (message from Pengji Zhang on Thu, 29 Aug 2024 18:44:36 +0800) 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:291361 Archived-At: > From: Pengji Zhang > Date: Thu, 29 Aug 2024 18:44:36 +0800 > > I found that function `fill-flowed-encode' would not fill texts > after the last hard newline in a buffer. To reproduce, run 'emacs > -Q' and then evaluate the following snippet: > > --8<---------------cut here---------------start------------->8--- > (with-current-buffer (get-buffer-create "*tmp-f=f*") > (use-hard-newlines) > (insert "1\n2") > (fill-flowed-encode) > (display-buffer (current-buffer))) > --8<---------------cut here---------------end--------------->8--- > > The expected output should be '1 2', but the actual is '1\n2'. > > The first patch changes this. > > Besides, I found that the test case > 'fill-flow-tests-fill-flowed-encode' in 'fill-flow-tests' does not > actually test the function 'fill-flowed-encode', which requires > 'use-hard-newlines'[1], and the test input does not cover some > behaviors of the function. The second patch improves it a bit. > > The second patch depends on the first one, without which the new > test will fail. So I decided to submit both together. Please let > me know if it is better to file another report. Thanks. AFAICT, this function exists for the special case of decoding email messages. Can email messages have flowed-encoded text without a hard newline at the end? > PS I have sent an email to assign@gnu.org, but have not got a > response yet. I think I have not finished the copyright assignment > process? No. Please ping them and CC me, so we could get your paperwork process going.