GNU bug report logs -
#7743
unrmail loses extra blank line at end of message
Previous Next
Reported by: mark.lillibridge <at> hp.com
Date: Mon, 27 Dec 2010 19:48:02 UTC
Severity: minor
Tags: patch
Fixed in version 24.0.92
Done: Glenn Morris <rgm <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your bug report
#7743: unrmail loses extra blank line at end of message
which was filed against the emacs package, has been closed.
The explanation is attached below, along with your original report.
If you require more details, please reply to 7743 <at> debbugs.gnu.org.
--
7743: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=7743
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
Version: 24.0.92
Mark Lillibridge wrote:
>> So I cannot see that blank lines are going missing (unless going from
>> Babyl to mbox adds one, and going the other way subtracts one?).
>
> You got it! Examine the BABYL file and you will see that Rmail 22.3
> has added an extra blank line after each of your messages. That was a
> recent (pre transformation to 23) RMAIL bug, I believe. My older email
> does not have these extra blank lines.
It sort of makes me wonder if it is worth changing this now, because if
most BABYL files started life as mbox files but were converted by Emacs,
then they have an extra blank line.
But anyway, I installed this.
[Message part 3 (message/rfc822, inline)]
As of at least Emacs 23.1 and still present in version 24, unrmail
throws away the last blank line of a message if present. The offending
code is in unrmail.el:
unrmail.el:235:
;; Make sure the message ends with two newlines
(goto-char (point-max))
(unless (looking-back "\n\n")
(insert "\n"))
This is wrong! Mbox format ends every message with a blank line, which
is not part of the message, so this code by failing to add the necessary
terminator blank line to messages that already end with a blank line
effectively removes the last blank line of such messages.
The fix is easy: just always add the blank line like so:
unrmail.el:235:
;; Add terminator blank line to message
(goto-char (point-max))
(insert "\n")
- Mark
PS, the patch for this change hopefully is:
ts-rhel5 [106]% diff original-unrmail.el new-unrmail.el
235c235
< ;; Make sure the message ends with two newlines
---
> ;; Add terminator blank line to message
237,238c237
< (unless (looking-back "\n\n")
< (insert "\n"))
---
> (insert "\n")
This bug report was last modified 13 years and 236 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.