Apply Dave Love's patches.
[gnus] / lisp / nndraft.el
index 4e09515..dd38b82 100644 (file)
@@ -30,6 +30,7 @@
 (require 'gnus-start)
 (require 'nnmh)
 (require 'nnoo)
+(require 'mm-util)
 (eval-when-compile
   (require 'cl)
   ;; This is just to shut up the byte-compiler.
       (when (and (file-exists-p newest)
                 (let ((nnmail-file-coding-system
                        (if (file-newer-than-file-p file auto)
-                           'binary
-                         message-draft-coding-system)))
+                           (if (equal group "drafts")
+                               message-draft-coding-system
+                             mm-text-coding-system)
+                         mm-auto-save-coding-system)))
                   (nnmail-find-file newest)))
        (save-excursion
          (set-buffer nntp-server-buffer)
   (nndraft-possibly-change-group group)
   (let ((gnus-verbose-backends nil)
        (buf (current-buffer))
-        article file)
+       article file)
     (with-temp-buffer
       (insert-buffer-substring buf)
       (setq article (nndraft-request-accept-article
        (let ((auto (nndraft-auto-save-file-name
                     (nndraft-article-filename article))))
          (when (file-exists-p auto)
-           (funcall nnmail-delete-file-function auto)))))
+           (funcall nnmail-delete-file-function auto)))
+       (dolist (backup
+                (let ((kept-new-versions 1)
+                      (kept-old-versions 0))
+                  (find-backup-file-name
+                   (nndraft-article-filename article))))
+         (when (file-exists-p backup)
+           (funcall nnmail-delete-file-function backup)))))
     res))
 
 (deffoo nndraft-request-accept-article (group &optional server last noinsert)