Importing Oort Gnus v0.04.
[elisp/gnus.git-] / lisp / nnbabyl.el
index f26fe4f..b9acfe6 100644 (file)
@@ -1,5 +1,7 @@
 ;;; nnbabyl.el --- rmail mbox access for Gnus
-;; Copyright (C) 1995,96,97,98,99 Free Software Foundation, Inc.
+
+;; Copyright (C) 1995, 1996, 1997, 1998, 1099, 2000, 2001
+;;     Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;;     Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
@@ -49,6 +51,7 @@
 (defvoo nnbabyl-get-new-mail t
   "If non-nil, nnbabyl will check the incoming mail file and split the mail.")
 
+
 (defvoo nnbabyl-prepare-save-mail-hook nil
   "Hook run narrowed to an article before saving.")
 
   (nnheader-report 'nnbabyl "nnbabyl: LIST NEWSGROUPS is not implemented."))
 
 (deffoo nnbabyl-request-expire-articles
-  (articles newsgroup &optional server force)
+    (articles newsgroup &optional server force)
   (nnbabyl-possibly-change-newsgroup newsgroup server)
   (let* ((is-old t)
         rest)
                     (buffer-substring
                      (point) (progn (end-of-line) (point))) force))
              (progn
+               (unless (eq nnmail-expiry-target 'delete)
+                 (with-temp-buffer
+                   (nnbabyl-request-article (car articles)
+                                            newsgroup server
+                                            (current-buffer))
+                   (let ((nnml-current-directory nil))
+                     (nnmail-expiry-target-group
+                      nnmail-expiry-target newsgroup)))
+                 (nnbabyl-possibly-change-newsgroup newsgroup server))
                (nnheader-message 5 "Deleting article %d in %s..."
                                  (car articles) newsgroup)
                (nnbabyl-delete-mail))
       (nconc rest articles))))
 
 (deffoo nnbabyl-request-move-article
-  (article group server accept-form &optional last)
+    (article group server accept-form &optional last)
   (let ((buf (get-buffer-create " *nnbabyl move*"))
        result)
     (and
       (widen)
       (narrow-to-region
        (save-excursion
-       (unless (re-search-backward (concat "^" nnbabyl-mail-delimiter) nil t)
-         (goto-char (point-min))
-         (end-of-line))
+        (unless (re-search-backward (concat "^" nnbabyl-mail-delimiter) nil t)
+          (goto-char (point-min))
+          (end-of-line))
         (if leave-delim (progn (forward-line 1) (point))
           (match-beginning 0)))
        (progn
   (nnbabyl-create-mbox)
 
   (unless (and nnbabyl-mbox-buffer
-          (buffer-name nnbabyl-mbox-buffer)
-          (save-excursion
-            (set-buffer nnbabyl-mbox-buffer)
-            (= (buffer-size) (nnheader-file-size nnbabyl-mbox-file))))
+              (buffer-name nnbabyl-mbox-buffer)
+              (save-excursion
+                (set-buffer nnbabyl-mbox-buffer)
+                (= (buffer-size) (nnheader-file-size nnbabyl-mbox-file))))
     ;; This buffer has changed since we read it last.  Possibly.
     (save-excursion
       (let ((delim (concat "^" nnbabyl-mail-delimiter))