;;; nnkiboze.el --- select virtual news access for Gnus
-;; Copyright (C) 1995,96,97,98,99 Free Software Foundation, Inc.
+
+;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+;; 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
;; Keywords: news
;; 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 2, 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., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;; article fetching by message-id at all.
(nntp-request-article article newsgroup gnus-nntp-server buffer)
(let* ((header (gnus-summary-article-header article))
- (xref (mail-header-xref header)))
+ (xref (mail-header-xref header))
+ num group)
(unless xref
(error "nnkiboze: No xref"))
(unless (string-match " \\([^ ]+\\):\\([0-9]+\\)" xref)
(error "nnkiboze: Malformed xref"))
- (gnus-request-article (string-to-int (match-string 2 xref))
- (match-string 1 xref)
- buffer))))
+ (setq num (string-to-number (match-string 2 xref))
+ group (match-string 1 xref))
+ (or (with-current-buffer buffer
+ (or (and gnus-use-cache (gnus-cache-request-article num group))
+ (gnus-agent-request-article num group)))
+ (gnus-request-article num group buffer)))))
(deffoo nnkiboze-request-scan (&optional group server)
+ (nnkiboze-possibly-change-group group)
(nnkiboze-generate-group (concat "nnkiboze:" group)))
(deffoo nnkiboze-request-group (group &optional server dont-check)
nnkiboze-remove-read-articles)
(let ((coding-system-for-write nnkiboze-file-coding-system))
(with-temp-file (nnkiboze-nov-file-name)
- (let ((cur (current-buffer))
+ (let ((cur (current-buffer))
(nnheader-file-coding-system nnkiboze-file-coding-system))
(nnheader-insert-file-contents (nnkiboze-nov-file-name))
(goto-char (point-min))
"\"Usage: emacs -batch -l nnkiboze -f nnkiboze-generate-groups\".
Finds out what articles are to be part of the nnkiboze groups."
(interactive)
- (let ((nnmail-spool-file nil)
- (mail-sources nil)
+ (let ((mail-sources nil)
(gnus-use-dribble-file nil)
(gnus-read-active-file t)
(gnus-expert-user t))
"." gnus-score-file-suffix))))))
(defun nnkiboze-generate-group (group &optional inhibit-list-groups)
- (let* ((info (nth 2 (gnus-gethash group gnus-newsrc-hashtb)))
+ (let* ((info (gnus-get-info group))
(newsrc-file (concat nnkiboze-directory
- (nnheader-translate-file-chars
- (concat group ".newsrc"))))
+ (nnheader-translate-file-chars
+ (concat group ".newsrc"))))
(nov-file (concat nnkiboze-directory
- (nnheader-tra