Subject: bug#2941: rmail's new handling of Babyl files is odd

From: Richard M Stallman <[email-masked]>
Date: Sat, 11 Apr 2009 08:27:43 -0400

> There is no way to ask for confirmation when saving a file.

    write-file-functions?

I have doubts that it gives the right behavior
in the case of more than one hook function, etc.

    It seems wrong to me that now I can end up converting a Babyl file to
    mbox with no prompting at all.

Not so.  Any change that causes the buffer to be saved
will also prompt you (unless there's a bug and I overlooked some command).

    > It would be possible to treat changes in "unseen" as minor
    > and changes in "deleted" as major, etc.

    You could easily distinguish user-defined labels from attributes.

Would not help -- deleted and unseen are both attributes.

    Or perhaps you should only treat "unseen" as minor.

Maybe that would be better.  Would you like to try out that behavior?

    It prompts me when I abort an edit, which is inappropriate.
    Aborting an edit does not modify the file.

That is a bug; aborting the edit should not prompt.
Does this fix it?

*** rmailedit.el.~1.58.~	2009-04-10 10:16:48.000000000 -0400
--- rmailedit.el	2009-04-11 07:02:51.000000000 -0400
***************
*** 117,123 ****
  (defun rmail-cease-edit ()
    "Finish editing message; switch back to Rmail proper."
    (interactive)
!   (rmail-modify-format)
    (if (rmail-summary-exists)
        (with-current-buffer rmail-summary-buffer
  	(rmail-summary-enable)))
--- 117,124 ----
  (defun rmail-cease-edit ()
    "Finish editing message; switch back to Rmail proper."
    (interactive)
!   (if (buffer-modified-p)
!       (rmail-modify-format))
    (if (rmail-summary-exists)
        (with-current-buffer rmail-summary-buffer
  	(rmail-summary-enable)))
***************
*** 254,259 ****
--- 255,261 ----
    (widen)
    (delete-region (point-min) (point-max))
    (insert rmail-old-text)
+   (set-buffer-modified-p nil)
    (rmail-cease-edit)
    (rmail-highlight-headers))