unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#39580: 26.2; missing newline in fcc when output file is in an rmail buffer
@ 2020-02-12 18:43 Ken Olum
  2020-10-27 18:14 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: Ken Olum @ 2020-02-12 18:43 UTC (permalink / raw)
  To: 39580; +Cc: kdo

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





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-10-27 18:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-12 18:43 bug#39580: 26.2; missing newline in fcc when output file is in an rmail buffer Ken Olum
2020-10-27 18:14 ` Lars Ingebrigtsen
2020-10-27 18:16   ` Lars Ingebrigtsen
2020-10-27 18:29     ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).