2001-11-15 Simon Josefsson <jas@extundo.com>
[gnus] / lisp / nnml.el
index 408c6e5..517bd1f 100644 (file)
@@ -38,6 +38,9 @@
 (require 'nnoo)
 (eval-when-compile (require 'cl))
 
+(eval-and-compile
+  (autoload 'gnus-article-unpropagatable-p "gnus-sum"))
+
 (nnoo-declare nnml)
 
 (defvoo nnml-directory message-directory
@@ -330,7 +333,9 @@ This variable is a virtual server slot.  See the Gnus manual for details.")
                (let (nnml-current-directory
                      nnml-current-group
                      nnml-article-file-alist)
-                 (nnmail-expiry-target-group nnmail-expiry-target group))))
+                 (nnmail-expiry-target-group nnmail-expiry-target group)))
+             ;; Maybe directory is changed during nnmail-expiry-target-group.
+             (nnml-possibly-change-directory group server))
            (nnheader-message 5 "Deleting article %s in %s"
                              number group)
            (condition-case ()
@@ -974,8 +979,8 @@ Use the nov database for the current group if available."
                                (nnmail-group-pathname group nnml-directory))))
     (if (null (gnus-gethash file nnml-marks-modtime))
        t ;; never looked at marks file, assume it has changed
-      (not (eq (gnus-gethash file nnml-marks-modtime)
-              (nth 5 (file-attributes file)))))))
+      (not (equal (gnus-gethash file nnml-marks-modtime)
+                 (nth 5 (file-attributes file)))))))
 
 (defun nnml-save-marks (group server)
   (let ((file-name-coding-system nnmail-pathname-coding-system)
@@ -986,7 +991,7 @@ Use the nov database for the current group if available."
          (nnml-possibly-create-directory group)
          (with-temp-file file
            (erase-buffer)
-           (princ nnml-marks (current-buffer))
+           (gnus-prin1 nnml-marks (current-buffer))
            (insert "\n"))
          (gnus-sethash file
                        (nth 5 (file-attributes file))
@@ -1000,16 +1005,17 @@ Use the nov database for the current group if available."
               nnml-marks-file-name 
               (nnmail-group-pathname group nnml-directory))))
     (if (file-exists-p file)
-       (setq nnml-marks (condition-case err
-                            (with-temp-buffer
-                              (gnus-sethash file
-                                            (nth 5 (file-attributes file))
-                                            nnml-marks-modtime)
-                              (nnheader-insert-file-contents file)
-                              (read (current-buffer)))
-                          (error (or (gnus-yes-or-no-p
-                                      (format "Error reading nnml marks file %s (%s).  Continuing will use marks from .newsrc.eld.  Continue? " file err))
-                                     (error "Cannot read nnml marks file %s (%s)" file err)))))
+       (condition-case err
+           (with-temp-buffer
+             (gnus-sethash file (nth 5 (file-attributes file))
+                           nnml-marks-modtime)
+             (nnheader-insert-file-contents file)
+             (setq nnml-marks (read (current-buffer)))
+             (dolist (el gnus-article-unpropagated-mark-lists)
+               (setq nnml-marks (gnus-remassoc el nnml-marks))))
+         (error (or (gnus-yes-or-no-p
+                     (format "Error reading nnml marks file %s (%s).  Continuing will use marks from .newsrc.eld.  Continue? " file err))
+                    (error "Cannot read nnml marks file %s (%s)" file err))))
       ;; User didn't have a .marks file.  Probably first time
       ;; user of the .marks stuff.  Bootstrap it from .newsrc.eld.
       (let ((info (gnus-get-info
@@ -1019,6 +1025,8 @@ Use the nov database for the current group if available."
        (nnheader-message 7 "Bootstrapping marks for %s..." group)
        (setq nnml-marks (gnus-info-marks info))
        (push (cons 'read (gnus-info-read info)) nnml-marks)
+       (dolist (el gnus-article-unpropagated-mark-lists)
+         (setq nnml-marks (gnus-remassoc el nnml-marks)))
        (nnml-save-marks group server)))))
 
 (provide 'nnml)