* legacy-gnus-agent.el (gnus-agent-convert-to-compressed-agentview-prompt):
authorKevin Greiner <kevin.greiner@compsol.cc>
Thu, 9 Sep 2004 23:50:14 +0000 (23:50 +0000)
committerKevin Greiner <kevin.greiner@compsol.cc>
Thu, 9 Sep 2004 23:50:14 +0000 (23:50 +0000)
New function. Used internally to only display 'gnus converting
files' message when actually necessary.

lisp/legacy-gnus-agent.el

index 2ddca1f..16b0cf6 100644 (file)
@@ -6,6 +6,8 @@
 ; 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
 converted to the compressed format."
@@ -30,6 +32,13 @@ converted to the compressed format."
     (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 +77,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)