emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: documentation of Rmail 23 mailbox format?


From: Chong Yidong
Subject: Re: documentation of Rmail 23 mailbox format?
Date: Sun, 06 Nov 2011 14:43:43 +0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.91 (gnu/linux)

Mark Lillibridge <address@hidden> writes:

> I've found at least one bug (get messages destroys all white space at
> the end of the last message already in the mailbox) in Rmail 23

I think that's coming from this code in rmail-get-new-mail:

      ;; In case of brain damage caused by require-final-newline.
      (goto-char (point-max))
      (skip-chars-backward " \t\n")
      (delete-region (point) (point-max))

Could you try removing these lines and seeing if the problem persists?
The require-final-newline variable is set to nil in rmail mode anyway so
this should not be necessary.

>     Unless told otherwise, I'm going to assume that Rmail 23 is supposed
> be using the mboxo/mboxrd mailbox format (see
> http://homepage.ntlworld.com./jonathan.deboynepollard/FGA/mail-mbox-formats.html).

IIRC, it is supposed to use the mboxrd format.  For instance, the
unquoting of From lines for message display is handled by this code in
rmail-show-message-1:

      ;; Unquote quoted From lines
      (while (re-search-forward "^>+From " nil t)
        (beginning-of-line)
        (delete-char 1)
        (forward-line))

> In particular, this means that:
>
>     Each message is preceded by a From_ line and followed by a blank
>     line. A From_ line is a line that begins with the five characters
>     'F', 'r', 'o', 'm', and ' '.
>
> Rmail 23 does not comply correctly with this.  For example, it fails
> to add a blank line after the last message.

I think that's the purpose of this code from rmail-insert-inbox-text:

      <after inserting the contents of the inbox>
      ;; Determine if a pair of newline message separators need
      ;; to be added to the new collection of messages.  This is
      ;; the case for all new message collections added to a
      ;; non-empty mail file.
      (unless (zerop size)
        (save-restriction
          (let ((start (point-min)))
            (widen)
            (unless (eq start (point-min))
              (goto-char start)
              (insert "\n\n")
              (setq size (+ 2 size))))))
      (goto-char (point-max))
      (or (= (preceding-char) ?\n)
          (zerop size)
          (insert ?\n))

Maybe it's not doing the right thing in some circumstances?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]