* rfc2047.el (rfc2047-encode-region): Insert a space before encoding.
[gnus] / lisp / nnml.el
index d4a2a58..07fdbc6 100644 (file)
@@ -1,5 +1,6 @@
 ;;; nnml.el --- mail spool access for Gnus
-;; Copyright (C) 1995,96,97,98,99 Free Software Foundation, Inc.
+;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000
+;;        Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;;     Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
   "Spool directory for the nnml mail backend.")
 
 (defvoo nnml-active-file
-  (concat (file-name-as-directory nnml-directory) "active")
+    (expand-file-name "active" nnml-directory)
   "Mail active file.")
 
 (defvoo nnml-newsgroups-file
-  (concat (file-name-as-directory nnml-directory) "newsgroups")
+    (expand-file-name "newsgroups" nnml-directory)
   "Mail newsgroups description file.")
 
 (defvoo nnml-get-new-mail t
@@ -86,7 +87,7 @@ all.  This may very well take some time.")
 
 (defvar nnml-nov-buffer-file-name nil)
 
-(defvoo nnml-file-coding-system nnmail-file-coding-system-1)
+(defvoo nnml-file-coding-system nnmail-file-coding-system)
 
 \f
 
@@ -264,8 +265,7 @@ all.  This may very well take some time.")
   (save-excursion
     (nnmail-find-file nnml-newsgroups-file)))
 
-(deffoo nnml-request-expire-articles (articles group
-                                              &optional server force)
+(deffoo nnml-request-expire-articles (articles group &optional server force)
   (nnml-possibly-change-directory group server)
   (let ((active-articles
         (nnheader-directory-articles nnml-current-directory))
@@ -286,6 +286,13 @@ all.  This may very well take some time.")
                         (nnmail-expired-article-p group mod-time force
                                                   nnml-inhibit-expiry)))
              (progn
+               ;; Allow a special target group.
+               (unless (eq nnmail-expiry-target 'delete)
+                 (with-temp-buffer
+                   (nnml-request-article article group server
+                                         (current-buffer))
+                   (nnmail-expiry-target-group
+                    nnmail-expiry-target group)))
                (nnheader-message 5 "Deleting article %s in %s"
                                  article group)
                (condition-case ()
@@ -305,7 +312,7 @@ all.  This may very well take some time.")
     (nconc rest articles)))
 
 (deffoo nnml-request-move-article
-  (article group server accept-form &optional last)
+    (article group server accept-form &optional last)
   (let ((buf (get-buffer-create " *nnml move*"))
        result)
     (nnml-possibly-change-directory group server)
@@ -313,12 +320,15 @@ all.  This may very well take some time.")
     (and
      (nnml-deletable-article-p group article)
      (nnml-request-article article group server)
-     (save-excursion
-       (set-buffer buf)
-       (insert-buffer-substring nntp-server-buffer)
-       (setq result (eval accept-form))
-       (kill-buffer (current-buffer))
-       result)
+     (let (nnml-current-directory 
+          nnml-current-group 
+          nnml-article-file-alist)
+       (save-excursion
+        (set-buffer buf)
+        (insert-buffer-substring nntp-server-buffer)
+        (setq result (eval accept-form))
+        (kill-buffer (current-buffer))
+        result))
      (progn
        (nnml-possibly-change-directory group server)
        (condition-case ()
@@ -370,8 +380,8 @@ all.  This may very well take some time.")
              (nnmail-write-region
               (point-min) (point-max)
               (or (nnml-article-to-file article)
-                  (concat nnml-current-directory
-                          (int-to-string article)))
+                  (expand-file-name (int-to-string article)
+                                    nnml-current-directory))
               nil (if (nnheader-be-verbose 5) nil 'nomesg))
              t)
        (setq headers (nnml-parse-head chars article))
@@ -475,7 +485,7 @@ all.  This may very well take some time.")
   (nnml-update-file-alist)
   (let (file)
     (if (setq file (cdr (assq article nnml-article-file-alist)))
-       (concat nnml-current-directory file)
+       (expand-file-name file nnml-current-directory)
       ;; Just to make sure nothing went wrong when reading over NFS --
       ;; check once more.
       (when (file-exists-p
@@ -516,8 +526,8 @@ all.  This may very well take some time.")
 
 (defun nnml-find-id (group id)
   (erase-buffer)
-  (let ((nov (concat (nnmail-group-pathname group nnml-directory)
-                    nnml-nov-file-name))
+  (let ((nov (expand-file-name nnml-nov-file-name
+                              (nnmail-group-pathname group nnml-directory)))
        number found)
     (when (file-exists-p nov)
       (nnheader-insert-file-contents nov)
@@ -537,7 +547,7 @@ all.  This may very well take some time.")
 (defun nnml-retrieve-headers-with-nov (articles &optional fetch-old)
   (if (or gnus-nov-is-evil nnml-nov-is-evil)
       nil
-    (let ((nov (concat nnml-current-directory nnml-nov-file-name)))
+    (let ((nov (expand-file-name nnml-nov-file-name nnml-current-directory)))
       (when (file-exists-p nov)
        (save-excursion
          (set-buffer nntp-server-buffer)
@@ -591,7 +601,7 @@ all.  This may very well take some time.")
        (let ((file (concat (nnmail-group-pathname
                             (caar ga) nnml-directory)
                            (int-to-string (cdar ga)))))
-z        (if first
+         (if first
              ;; It was already saved, so we just make a hard link.
              (funcall nnmail-crosspost-link-function first file t)
            ;; Save the article.
@@ -633,8 +643,8 @@ z     (if first
       (push (list group active) nnml-group-alist))
     (setcdr active (1+ (cdr active)))
     (while (file-exists-p
-           (concat (nnmail-group-pathname group nnml-directory)
-                   (int-to-string (cdr active))))
+           (expand-file-name (int-to-string (cdr active))
+                             (nnmail-group-pathname group nnml-directory)))
       (setcdr active (1+ (cdr active))))
     (cdr active)))
 
@@ -674,8 +684,9 @@ z     (if first
        (save-excursion
          (set-buffer buffer)
          (set (make-local-variable 'nnml-nov-buffer-file-name)
-              (concat (nnmail-group-pathname group nnml-directory)
-                      nnml-nov-file-name))
+              (expand-file-name
+               nnml-nov-file-name
+               (nnmail-group-pathname group nnml-directory)))
          (erase-buffer)
          (when (file-exists-p nnml-nov-buffer-file-name)
            (nnheader-insert-file-contents nnml-nov-buffer-file-name)))