aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorDave Love2000-10-27 18:09:37 +0000
committerDave Love2000-10-27 18:09:37 +0000
commitec4eb560b9e767b3f0757e717082a7a541719417 (patch)
tree3255291157e24dbe03dc331e0d93ec853a553318 /lisp
parent2491844d11f30fb5d599e177aea026b3607a9f6f (diff)
downloademacs-ec4eb560b9e767b3f0757e717082a7a541719417.tar.gz
emacs-ec4eb560b9e767b3f0757e717082a7a541719417.zip
2000-10-27 ShengHuo ZHU <zsh@cs.rochester.edu>
* nnkiboze.el (nnkiboze-generate-group): Use it. Inhibit list groups. (nnkiboze-enter-nov): Fix it when there is no xref. (nnkiboze-generate-groups): List groups. (nnkiboze-request-article): Use gnus-cache-request-article.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/gnus/nnkiboze.el35
1 files changed, 23 insertions, 12 deletions
diff --git a/lisp/gnus/nnkiboze.el b/lisp/gnus/nnkiboze.el
index d93800a5b97..9d11bd93a84 100644
--- a/lisp/gnus/nnkiboze.el
+++ b/lisp/gnus/nnkiboze.el
@@ -1,9 +1,10 @@
1;;; nnkiboze.el --- select virtual news access for Gnus 1;;; nnkiboze.el --- select virtual news access for Gnus
2 2
3;; Copyright (C) 1995, 1996, 1997, 1998, 1999,.2000 3;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000
4;; Free Software Foundation, Inc. 4;; Free Software Foundation, Inc.
5 5
6;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org> 6;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
7;; Maintainer: bugs@gnus.org
7;; Keywords: news 8;; Keywords: news
8 9
9;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
@@ -100,14 +101,17 @@
100 ;; article fetching by message-id at all. 101 ;; article fetching by message-id at all.
101 (nntp-request-article article newsgroup gnus-nntp-server buffer) 102 (nntp-request-article article newsgroup gnus-nntp-server buffer)
102 (let* ((header (gnus-summary-article-header article)) 103 (let* ((header (gnus-summary-article-header article))
103 (xref (mail-header-xref header))) 104 (xref (mail-header-xref header))
105 num group)
104 (unless xref 106 (unless xref
105 (error "nnkiboze: No xref")) 107 (error "nnkiboze: No xref"))
106 (unless (string-match " \\([^ ]+\\):\\([0-9]+\\)" xref) 108 (unless (string-match " \\([^ ]+\\):\\([0-9]+\\)" xref)
107 (error "nnkiboze: Malformed xref")) 109 (error "nnkiboze: Malformed xref"))
108 (gnus-request-article (string-to-int (match-string 2 xref)) 110 (setq num (string-to-int (match-string 2 xref))
109 (match-string 1 xref) 111 group (match-string 1 xref))
110 buffer)))) 112 (or (with-current-buffer buffer
113 (gnus-cache-request-article num group))
114 (gnus-request-article num group buffer)))))
111 115
112(deffoo nnkiboze-request-scan (&optional group server) 116(deffoo nnkiboze-request-scan (&optional group server)
113 (nnkiboze-generate-group (concat "nnkiboze:" group))) 117 (nnkiboze-generate-group (concat "nnkiboze:" group)))
@@ -209,7 +213,10 @@ Finds out what articles are to be part of the nnkiboze groups."
209 (when (string-match "nnkiboze" (gnus-info-group info)) 213 (when (string-match "nnkiboze" (gnus-info-group info))
210 ;; For each kiboze group, we call this function to generate 214 ;; For each kiboze group, we call this function to generate
211 ;; it. 215 ;; it.
212 (nnkiboze-generate-group (gnus-info-group info)))))) 216 (nnkiboze-generate-group (gnus-info-group info) t))))
217 (save-excursion
218 (set-buffer gnus-group-buffer)
219 (gnus-group-list-groups)))
213 220
214(defun nnkiboze-score-file (group) 221(defun nnkiboze-score-file (group)
215 (list (expand-file-name 222 (list (expand-file-name
@@ -218,7 +225,7 @@ Finds out what articles are to be part of the nnkiboze groups."
218 (concat (nnkiboze-prefixed-name nnkiboze-current-group) 225 (concat (nnkiboze-prefixed-name nnkiboze-current-group)
219 "." gnus-score-file-suffix)))))) 226 "." gnus-score-file-suffix))))))
220 227
221(defun nnkiboze-generate-group (group) 228(defun nnkiboze-generate-group (group &optional inhibit-list-groups)
222 (let* ((info (nth 2 (gnus-gethash group gnus-newsrc-hashtb))) 229 (let* ((info (nth 2 (gnus-gethash group gnus-newsrc-hashtb)))
223 (newsrc-file (concat nnkiboze-directory 230 (newsrc-file (concat nnkiboze-directory
224 (nnheader-translate-file-chars 231 (nnheader-translate-file-chars
@@ -232,6 +239,9 @@ Finds out what articles are to be part of the nnkiboze groups."
232 (gnus-expert-user t) 239 (gnus-expert-user t)
233 (gnus-large-newsgroup nil) 240 (gnus-large-newsgroup nil)
234 (gnus-score-find-score-files-function 'nnkiboze-score-file) 241 (gnus-score-find-score-files-function 'nnkiboze-score-file)
242 ;; Use only nnkiboze-score-file!
243 (gnus-score-use-all-scores nil)
244 (gnus-use-scoring t)
235 (gnus-verbose (min gnus-verbose 3)) 245 (gnus-verbose (min gnus-verbose 3))
236 gnus-select-group-hook gnus-summary-prepare-hook 246 gnus-select-group-hook gnus-summary-prepare-hook
237 gnus-thread-sort-functions gnus-show-threads 247 gnus-thread-sort-functions gnus-show-threads
@@ -334,9 +344,10 @@ Finds out what articles are to be part of the nnkiboze groups."
334 (insert "(setq nnkiboze-newsrc '") 344 (insert "(setq nnkiboze-newsrc '")
335 (gnus-prin1 nnkiboze-newsrc) 345 (gnus-prin1 nnkiboze-newsrc)
336 (insert ")\n"))) 346 (insert ")\n")))
337 (save-excursion 347 (unless inhibit-list-groups
338 (set-buffer gnus-group-buffer) 348 (save-excursion
339 (gnus-group-list-groups)) 349 (set-buffer gnus-group-buffer)
350 (gnus-group-list-groups)))
340 t) 351 t)
341 352
342(defun nnkiboze-enter-nov (buffer header group) 353(defun nnkiboze-enter-nov (buffer header group)
@@ -353,11 +364,11 @@ Finds out what articles are to be part of the nnkiboze groups."
353 (setq article 1)) 364 (setq article 1))
354 (mail-header-set-number oheader article) 365 (mail-header-set-number oheader article)
355 (with-temp-buffer 366 (with-temp-buffer
356 (insert (mail-header-xref oheader)) 367 (insert (or (mail-header-xref oheader) ""))
357 (goto-char (point-min)) 368 (goto-char (point-min))
358 (if (re-search-forward " [^ ]+:[0-9]+" nil t) 369 (if (re-search-forward " [^ ]+:[0-9]+" nil t)
359 (goto-char (match-beginning 0)) 370 (goto-char (match-beginning 0))
360 (forward-char 1)) 371 (or (eobp) (forward-char 1)))
361 ;; The first Xref has to be the group this article 372 ;; The first Xref has to be the group this article
362 ;; really came for - this is the article nnkiboze 373 ;; really came for - this is the article nnkiboze
363 ;; will request when it is asked for the article. 374 ;; will request when it is asked for the article.