;;; nnkiboze.el --- select virtual news access for Gnus
-;; Copyright (C) 1995, 1996, 1997, 1998, 1999,.2000
+;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000
;; Free Software Foundation, Inc.
;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
+;; Maintainer: bugs@gnus.org
;; Keywords: news
;; This file is part of GNU Emacs.
;; 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-int (match-string 2 xref))
+ group (match-string 1 xref))
+ (or (with-current-buffer buffer
+ (gnus-cache-request-article num group))
+ (gnus-request-article num group buffer)))))
(deffoo nnkiboze-request-scan (&optional group server)
(nnkiboze-generate-group (concat "nnkiboze:" group)))
(when (string-match "nnkiboze" (gnus-info-group info))
;; For each kiboze group, we call this function to generate
;; it.
- (nnkiboze-generate-group (gnus-info-group info))))))
+ (nnkiboze-generate-group (gnus-info-group info) t))))
+ (save-excursion
+ (set-buffer gnus-group-buffer)
+ (gnus-group-list-groups)))
(defun nnkiboze-score-file (group)
(list (expand-file-name
(concat (nnkiboze-prefixed-name nnkiboze-current-group)
"." gnus-score-file-suffix))))))
-(defun nnkiboze-generate-group (group)
+(defun nnkiboze-generate-group (group &optional inhibit-list-groups)
(let* ((info (nth 2 (gnus-gethash group gnus-newsrc-hashtb)))
(newsrc-file (concat nnkiboze-directory
(nnheader-translate-file-chars
(gnus-expert-user t)
(gnus-large-newsgroup nil)
(gnus-score-find-score-files-function 'nnkiboze-score-file)
+ ;; Use only nnkiboze-score-file!
+ (gnus-score-use-all-scores nil)
+ (gnus-use-scoring t)
(gnus-verbose (min gnus-verbose 3))
gnus-select-group-hook gnus-summary-prepare-hook
gnus-thread-sort-functions gnus-show-threads
(insert "(setq nnkiboze-newsrc '")
(gnus-prin1 nnkiboze-newsrc)
(insert ")\n")))
- (save-excursion
- (set-buffer gnus-group-buffer)
- (gnus-group-list-groups))
+ (unless inhibit-list-groups
+ (save-excursion
+ (set-buffer gnus-group-buffer)
+ (gnus-group-list-groups)))
t)
(defun nnkiboze-enter-nov (buffer header group)
(setq article 1))
(mail-header-set-number oheader article)
(with-temp-buffer
- (insert (mail-header-xref oheader))
+ (insert (or (mail-header-xref oheader) ""))
(goto-char (point-min))
(if (re-search-forward " [^ ]+:[0-9]+" nil t)
(goto-char (match-beginning 0))
- (forward-char 1))
+ (or (eobp) (forward-char 1)))
;; The first Xref has to be the group this article
;; really came for - this is the article nnkiboze
;; will request when it is asked for the article.