Synch to No Gnus 200503230048.
[elisp/gnus.git-] / lisp / nnmaildir.el
index 8de58fd..390084e 100644 (file)
@@ -41,6 +41,8 @@
 ;;   copying, restoring, etc.
 ;;
 ;; Todo:
+;; * When moving an article for expiry, copy all the marks except 'expire
+;;   from the original article.
 ;; * Add a hook for when moving messages from new/ to cur/, to support
 ;;   nnmail's duplicate detection.
 ;; * Improve generated Xrefs, so crossposts are detectable.
@@ -310,11 +312,11 @@ by nnmaildir-request-article.")
 
 (defun nnmaildir--emlink-p (err)
   (and (eq (car err) 'file-error)
-       (string= (caddr err) "too many links")))
+       (string= (downcase (caddr err)) "too many links")))
 
 (defun nnmaildir--enoent-p (err)
   (and (eq (car err) 'file-error)
-       (string= (caddr err) "no such file or directory")))
+       (string= (downcase (caddr err)) "no such file or directory")))
 
 (defun nnmaildir--eexist-p (err)
   (eq (car err) 'file-already-exists))
@@ -1303,7 +1305,7 @@ by nnmaildir-request-article.")
       t)))
 
 (defun nnmaildir-request-move-article (article gname server accept-form
-                                              &optional last)
+                                              &optional last move-is-internal)
   (let ((group (nnmaildir--prepare server gname))
        pgname suffix result nnmaildir--file deactivate-mark)
     (catch 'return
@@ -1393,8 +1395,9 @@ by nnmaildir-request-article.")
         (write-region (point-min) (point-max) tmpfile nil 'no-message nil
                       'excl)
         (unix-sync))) ;; no fsync :(
-      (cancel-timer 24h)
-      (condition-case err (add-name-to-file tmpfile curfile)
+      (nnheader-cancel-timer 24h)
+      (condition-case err
+         (add-name-to-file tmpfile curfile)
        (error
         (setf (nnmaildir--srv-error nnmaildir--cur-server)
               (concat "Error linking: " (prin1-to-string err)))
@@ -1517,7 +1520,12 @@ by nnmaildir-request-article.")
                        (not (string-equal target pgname))) ;; Move it.
               (erase-buffer)
               (nnheader-insert-file-contents nnmaildir--file)
-              (gnus-request-accept-article target nil nil 'no-encode))
+              (let ((group-art (gnus-request-accept-article
+                                target nil nil 'no-encode)))
+                (when (consp group-art)
+                  ;; Maybe also copy: dormant forward reply save tick
+                  ;; (gnus-add-mark? gnus-request-set-mark?)
+                  (gnus-group-mark-article-read target (cdr group-art)))))
             (if (equal target pgname)
                 ;; Leave it here.
                 (setq didnt (cons (nnmaildir--art-num article) didnt))