2002-09-25 Bj\e,Av\e(Brn Torkelsson <torkel@acc.umu.se>
[gnus] / lisp / gnus-cache.el
index b2a6823..7e59cc8 100644 (file)
@@ -337,7 +337,7 @@ Returns the list of articles entered."
     (gnus-summary-position-point)
     (nreverse out)))
 
-(defun gnus-cache-remove-article (n)
+(defun gnus-cache-remove-article (&optional n)
   "Remove the next N articles from the cache.
 If not given a prefix, use the process marked articles instead.
 Returns the list of articles removed."
@@ -377,10 +377,10 @@ Returns the list of articles removed."
   (interactive)
   (let ((gnus-verbose (max 6 gnus-verbose)))
     (if gnus-newsgroup-cached
-        (progn
-          (gnus-summary-limit gnus-newsgroup-cached)
-          (gnus-summary-position-point))
-        (gnus-message 3 "No cached articles for this group"))))
+       (progn
+         (gnus-summary-limit gnus-newsgroup-cached)
+         (gnus-summary-position-point))
+      (gnus-message 3 "No cached articles for this group"))))
 
 ;;; Internal functions.
 
@@ -515,13 +515,13 @@ Returns the list of articles removed."
                  (< (read (current-buffer)) (car cached)))
        (forward-line 1))
       (beginning-of-line)
-      (save-excursion
-       (set-buffer cache-buf)
-       (if (search-forward (concat "\n" (int-to-string (car cached)) "\t")
-                           nil t)
-           (setq beg (progn (beginning-of-line) (point))
-                 end (progn (end-of-line) (point)))
-         (setq beg nil)))
+      (set-buffer cache-buf)
+      (if (search-forward (concat "\n" (int-to-string (car cached)) "\t")
+                         nil t)
+         (setq beg (progn (beginning-of-line) (point))
+               end (progn (end-of-line) (point)))
+       (setq beg nil))
+      (set-buffer nntp-server-buffer)
       (when beg
        (insert-buffer-substring cache-buf beg end)
        (insert "\n"))
@@ -543,20 +543,20 @@ Returns the list of articles removed."
                     (car cached)))
        (search-forward "\n.\n" nil 'move))
       (beginning-of-line)
-      (save-excursion
-       (set-buffer cache-buf)
-       (erase-buffer)
-       (let ((coding-system-for-read
-              gnus-cache-coding-system))
-         (insert-file-contents (gnus-cache-file-name group (car cached))))
-       (goto-char (point-min))
-       (insert "220 ")
-       (princ (car cached) (current-buffer))
-       (insert " Article retrieved.\n")
-       (search-forward "\n\n" nil 'move)
-       (delete-region (point) (point-max))
-       (forward-char -1)
-       (insert "."))
+      (set-buffer cache-buf)
+      (erase-buffer)
+      (let ((coding-system-for-read
+            gnus-cache-coding-system))
+       (insert-file-contents (gnus-cache-file-name group (car cached))))
+      (goto-char (point-min))
+      (insert "220 ")
+      (princ (car cached) (current-buffer))
+      (insert " Article retrieved.\n")
+      (search-forward "\n\n" nil 'move)
+      (delete-region (point) (point-max))
+      (forward-char -1)
+      (insert ".")
+      (set-buffer nntp-server-buffer)
       (insert-buffer-substring cache-buf)
       (setq cached (cdr cached)))
     (kill-buffer cache-buf)))
@@ -720,7 +720,6 @@ If GROUP is non-nil, also cater to `gnus-cacheable-groups' and
                  (string-match gnus-cacheable-groups group))
              (or (not gnus-uncacheable-groups)
                  (not (string-match gnus-uncacheable-groups group)))))))
-       
 
 (provide 'gnus-cache)