From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Ken Olum Newsgroups: gmane.emacs.bugs Subject: bug#39580: 26.2; missing newline in fcc when output file is in an rmail buffer Date: Wed, 12 Feb 2020 13:43:44 -0500 Message-ID: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="86078"; mail-complaints-to="usenet@ciao.gmane.io" Cc: kdo@cosmos.phy.tufts.edu To: 39580@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Feb 12 19:44:29 2020 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 1j1wzr-000MEt-L4 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 12 Feb 2020 19:44:27 +0100 Original-Received: from localhost ([::1]:41932 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j1wzq-0001Ry-MO for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 12 Feb 2020 13:44:26 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55307) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j1wzV-0001Ri-FY for bug-gnu-emacs@gnu.org; Wed, 12 Feb 2020 13:44:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j1wzS-00045D-6e for bug-gnu-emacs@gnu.org; Wed, 12 Feb 2020 13:44:05 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53070) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j1wzS-000455-3U for bug-gnu-emacs@gnu.org; Wed, 12 Feb 2020 13:44:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1j1wzR-0007vt-UB for bug-gnu-emacs@gnu.org; Wed, 12 Feb 2020 13:44:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Ken Olum Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 12 Feb 2020 18:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 39580 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.158153303630471 (code B ref -1); Wed, 12 Feb 2020 18:44:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 12 Feb 2020 18:43:56 +0000 Original-Received: from localhost ([127.0.0.1]:59043 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j1wzL-0007vP-KD for submit@debbugs.gnu.org; Wed, 12 Feb 2020 13:43:55 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:53086) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j1wzI-0007vE-Q2 for submit@debbugs.gnu.org; Wed, 12 Feb 2020 13:43:53 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55279) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j1wzH-0001RJ-M9 for bug-gnu-emacs@gnu.org; Wed, 12 Feb 2020 13:43:52 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j1wzG-0003zt-Im for bug-gnu-emacs@gnu.org; Wed, 12 Feb 2020 13:43:51 -0500 Original-Received: from cosmos.phy.tufts.edu ([130.64.84.253]:44236) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j1wzG-0003v5-Fl for bug-gnu-emacs@gnu.org; Wed, 12 Feb 2020 13:43:50 -0500 Original-Received: from kdo by cosmos.phy.tufts.edu ([local]:local) with local id 1j1wzA-0003ol-64 - Using Exim-4.92.2 (MandrivaLinux) MTA (return-path ); Wed, 12 Feb 2020 13:43:44 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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" Xref: news.gmane.io gmane.emacs.bugs:175977 Archived-At: The function gnus-output-to-rmail fails to ensure a blank line at the end of the message being output in the case where the output file is an mbox file viewed in an rmail buffer. The needed code is in this function, but triggers only when the output file is not in a buffer. This causes messages in the output file to be merged together. To reproduce: emacs -Q C-x m to compose message edit outgoing message to add a line "Fcc: test-save" (for example) and some body that does not have a blank line at the end. C-c C-c to send message Visit "test-save" M-x rmail-mode Select buffer "*sent mail to ...*" C-c C-c to send message again File "test-save" is now corrupt because it lacks a blank line at the end. To see that it is corrupt: Send the same message yet again. Select the "test-save" buffer. It will look OK, but Kill the "test-save" buffer. Visit "test-save" again M-x rmail-mode Now the last two copies of the message will be concatenated into a single message. I propose fixing this by taking the code for inserting the blank line that starts "(unless babyl ; from gnus-output-to-mail" and moving it before ";; Decide whether to append to a file or to an Emacs buffer." so that it takes place for all mbox files. There is a similar bug in gnus-output-to-mail that occurs when the file is in a non-rmail buffer. It makes the same mistake, but corrects it next time by putting in another newline at the end of what it did before. However, it always adds the newline, so if the file is empty it corrupts it by putting an extra blank line at the front. Ken