* gnus-art.el (gnus-header-from, gnus-header-subject, gnus-header-name)
[gnus] / lisp / legacy-gnus-agent.el
index e5c2ae4..743f56e 100644 (file)
@@ -1,10 +1,41 @@
+;;; gnus-agent.el --- Legacy unplugged support for Gnus
+
+;; Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+
+;; Author: Kevin Greiner <kgreiner@xpediantsolutions.com>
+;; Keywords: news
+
+;; This file is part of GNU Emacs.
+
+;; 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 2, 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
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.         See the
+;; 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.
+
+;;; Commentary:
+
+;; Conversion functions for the Agent.
+
+;;; Code:
 (require 'gnus-start)
 (require 'gnus-util)
 (require 'gnus-range)
 (require 'gnus-agent)
 
-; Oort Gnus v0.08 - This release updated agent to no longer use
-;                   history file and to support a compressed alist.
+;; Oort Gnus v0.08 - This release updated agent to no longer use
+;;                   history file and to support a compressed alist.
+
+(defvar gnus-agent-compressed-agentview-search-only nil)
 
 (defun gnus-agent-convert-to-compressed-agentview (converting-to)
   "Iterates over all agentview files to ensure that they have been
@@ -23,13 +54,20 @@ converted to the compressed format."
              ((file-directory-p member)
               (push member search-in))
               ((equal (file-name-nondirectory member) ".agentview")
-               (setq converted-something 
+               (setq converted-something
                      (or (gnus-agent-convert-agentview member)
                          converted-something))))))
 
     (if converted-something
         (gnus-message 4 "Successfully converted Gnus %s offline (agent) files to %s" gnus-newsrc-file-version converting-to))))
 
+(defun gnus-agent-convert-to-compressed-agentview-prompt ()
+  (catch 'found-file-to-convert
+    (let ((gnus-agent-compressed-agentview-search-only t))
+      (gnus-agent-convert-to-compressed-agentview nil))))
+
+(gnus-convert-mark-converter-prompt 'gnus-agent-convert-to-compressed-agentview 'gnus-agent-convert-to-compressed-agentview-prompt)
+
 (defun gnus-agent-convert-agentview (file)
   "Load FILE and do a `read' there."
   (with-temp-buffer
@@ -68,6 +106,9 @@ converted to the compressed format."
          (setq changed-version t)))
 
         (when changed-version
+         (when gnus-agent-compressed-agentview-search-only
+           (throw 'found-file-to-convert t))
+
           (erase-buffer)
           (let ((compressed nil))
             (mapcar (lambda (pair)
@@ -109,7 +150,7 @@ converted to the compressed format."
             (set-buffer buffer)
             (erase-buffer)
             (insert "The definition of gnus-agent-expire-days has been changed.\nYou currently have it set to the list:\n  ")
-            (let (print-level print-length) (pp gnus-agent-expire-days (current-buffer)))
+            (gnus-pp gnus-agent-expire-days)
 
             (insert "\nIn order to use version '" converting-to "' of gnus, you will need to set\n")
             (insert "gnus-agent-expire-days to an integer. If you still wish to set different\n")
@@ -163,7 +204,7 @@ converted to the compressed format."
                                   (t
                                    t))))))
         (kill-buffer buffer))
-      (error "Change gnus-agent-expire-days to an integer for gnus to start."))))
+      (error "Change gnus-agent-expire-days to an integer for gnus to start"))))
 
 ;; The gnus-agent-unlist-expire-days has its own conversion prompt.
 ;; Therefore, hide the default prompt.
@@ -186,8 +227,8 @@ possible that the hook was persistently saved."
 
           (when (cond ((eq (type-of func) 'compiled-function)
                        ;; Search def. of compiled function for gnus-agent-do-once string
-                       (let* (definition 
-                               print-level 
+                       (let* (definition
+                               print-level
                                print-length
                                (standard-output
                                 (lambda (char)
@@ -212,4 +253,7 @@ possible that the hook was persistently saved."
 ;; the .newsrc.eld file.
 (gnus-convert-mark-converter-prompt 'gnus-agent-unhook-expire-days t)
 
-;;; arch-tag: 845c7b8a-88f7-4468-b8d7-94e8fc72cf1a
+(provide 'legacy-gnus-agent)
+
+;; arch-tag: 845c7b8a-88f7-4468-b8d7-94e8fc72cf1a
+;;; legacy-gnus-agent.el ends here