Update copyright year to 2015
[gnus] / lisp / nnvirtual.el
index c94d183..a3d950a 100644 (file)
@@ -1,7 +1,6 @@
 ;;; nnvirtual.el --- virtual newsgroups access for Gnus
 
-;; Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-;;   2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+;; Copyright (C) 1994-2015 Free Software Foundation, Inc.
 
 ;; Author: David Moore <dmoore@ucsd.edu>
 ;;     Lars Magne Ingebrigtsen <larsi@gnus.org>
@@ -93,15 +92,14 @@ component group will show up when you enter the virtual group.")
 (deffoo nnvirtual-retrieve-headers (articles &optional newsgroup
                                             server fetch-old)
   (when (nnvirtual-possibly-change-server server)
-    (save-excursion
-      (set-buffer nntp-server-buffer)
+    (with-current-buffer nntp-server-buffer
       (erase-buffer)
       (if (stringp (car articles))
          'headers
        (let ((vbuf (nnheader-set-temp-buffer
                     (get-buffer-create " *virtual headers*")))
              (carticles (nnvirtual-partition-sequence articles))
-             (system-name (system-name))
+             (sysname (system-name))
              cgroup carticle article result prefix)
          (while carticles
            (setq cgroup (caar carticles))
@@ -153,7 +151,7 @@ component group will show up when you enter the virtual group.")
                  ;; and clean up the xrefs.
                  (princ article nntp-server-buffer)
                  (nnvirtual-update-xref-header cgroup carticle
-                                               prefix system-name)
+                                               prefix sysname)
                  (forward-line 1))
                )
 
@@ -170,8 +168,7 @@ component group will show up when you enter the virtual group.")
          ;; the nntp-server-buffer, which is where Gnus expects to find
          ;; them.
          (prog1
-             (save-excursion
-               (set-buffer nntp-server-buffer)
+             (with-current-buffer nntp-server-buffer
                (erase-buffer)
                (insert-buffer-substring vbuf)
                ;; FIX FIX FIX, we should be able to sort faster than
@@ -197,10 +194,11 @@ component group will show up when you enter the virtual group.")
            (when buffer
              (set-buffer buffer))
            (let* ((gnus-override-method nil)
-                  (method (gnus-find-method-for-group
-                           nnvirtual-last-accessed-component-group)))
-             (funcall (gnus-get-function method 'request-article)
-                      article nil (nth 1 method) buffer)))))
+                  (gnus-command-method
+                   (gnus-find-method-for-group
+                    nnvirtual-last-accessed-component-group)))
+             (funcall (gnus-get-function gnus-command-method 'request-article)
+                      article nil (nth 1 gnus-command-method) buffer)))))
       ;; This is a fetch by number.
       (let* ((amap (nnvirtual-map-article article))
             (cgroup (car amap)))
@@ -215,8 +213,7 @@ component group will show up when you enter the virtual group.")
         (t
          (setq nnvirtual-last-accessed-component-group cgroup)
          (if buffer
-             (save-excursion
-               (set-buffer buffer)
+             (with-current-buffer buffer
                ;; We bind this here to avoid double decoding.
                (let ((gnus-article-decode-hook nil))
                  (gnus-request-article-this-buffer (cdr amap) cgroup)))
@@ -250,7 +247,7 @@ component group will show up when you enter the virtual group.")
       t)))
 
 
-(deffoo nnvirtual-request-group (group &optional server dont-check)
+(deffoo nnvirtual-request-group (group &optional server dont-check info)
   (nnvirtual-possibly-change-server server)
   (setq nnvirtual-component-groups
        (delete (nnvirtual-current-group) nnvirtual-component-groups))
@@ -335,8 +332,7 @@ component group will show up when you enter the virtual group.")
         (when (not (numberp (gnus-group-unread g)))
           (gnus-activate-group g)))
        nnvirtual-component-groups)
-      (save-excursion
-       (set-buffer gnus-group-buffer)
+      (with-current-buffer gnus-group-buffer
        (gnus-group-catchup-current nil all)))))
 
 
@@ -382,7 +378,7 @@ component group will show up when you enter the virtual group.")
       (mapc 'nnheader-insert-nov headers))))
 
 
-(defun nnvirtual-update-xref-header (group article prefix system-name)
+(defun nnvirtual-update-xref-header (group article prefix sysname)
   "Edit current NOV header in current buffer to have an xref to the component group, and also server prefix any existing xref lines."
   ;; Move to beginning of Xref field, creating a slot if needed.
   (beginning-of-line)
@@ -397,7 +393,7 @@ component group will show up when you enter the virtual group.")
     (forward-char -1)
     (delete-char 1))
 
-  (insert "Xref: " system-name " " group ":")
+  (insert "Xref: " sysname " " group ":")
   (princ article (current-buffer))
   (insert " ")