Merge from emacs--devo--0
[gnus] / lisp / nnfolder.el
index bf82791..629e22c 100644 (file)
@@ -1,7 +1,7 @@
 ;;; nnfolder.el --- mail folder access for Gnus
 
 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-;;   2005, 2006, 2007 Free Software Foundation, Inc.
+;;   2005, 2006, 2007, 2008 Free Software Foundation, Inc.
 
 ;; Author: Simon Josefsson <simon@josefsson.org> (adding MARKS)
 ;;      ShengHuo Zhu <zsh@cs.rochester.edu> (adding NOV)
 
 ;; This file is part of GNU Emacs.
 
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; GNU Emacs is free software: you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
 ;;; Commentary:
 
 ;;; Code:
 
+;; For Emacs < 22.2.
+(eval-and-compile
+  (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
+
 (require 'nnheader)
 (require 'message)
 (require 'nnmail)
@@ -40,9 +42,8 @@
 (require 'gnus-util)
 (require 'gnus-range)
 
-(eval-and-compile
-  (autoload 'gnus-article-unpropagatable-p "gnus-sum")
-  (autoload 'gnus-intersection "gnus-range"))
+;; FIXME not explicitly used in this file.
+(autoload 'gnus-article-unpropagatable-p "gnus-sum")
 
 (nnoo-declare nnfolder)
 
@@ -429,6 +430,10 @@ the group.  Then the marks file will be regenerated properly by Gnus.")
       ;; The article numbers are increasing, so this result is sorted.
        (nreverse numbers)))))
 
+(autoload 'gnus-request-group "gnus-int")
+(declare-function gnus-request-create-group "gnus-int"
+                  (group &optional gnus-command-method args))
+
 (deffoo nnfolder-request-expire-articles (articles newsgroup
                                                   &optional server force)
   (nnfolder-possibly-change-group newsgroup server)
@@ -467,11 +472,11 @@ the group.  Then the marks file will be regenerated properly by Gnus.")
                (let ((nnfolder-current-directory nil))
                  (when (functionp target)
                    (setq target (funcall target newsgroup)))
-                 (if (and target
-                          (or (gnus-request-group target)
-                              (gnus-request-create-group target)))
-                     (nnmail-expiry-target-group target newsgroup)
-                   (setq target nil))))
+                 (when (and target (not (eq target 'delete)))
+                   (if (or (gnus-request-group target)
+                           (gnus-request-create-group target))
+                       (nnmail-expiry-target-group target newsgroup)
+                     (setq target nil)))))
              (nnfolder-possibly-change-group newsgroup server))
            (when target
              (nnheader-message 5 "Deleting article %d in %s..."
@@ -1294,5 +1299,5 @@ This command does not work if you use short group names."
 
 (provide 'nnfolder)
 
-;;; arch-tag: a040d0f4-4f4e-445f-8972-839575c5f7e6
+;; arch-tag: a040d0f4-4f4e-445f-8972-839575c5f7e6
 ;;; nnfolder.el ends here