From: ShengHuo ZHU Date: Thu, 21 Sep 2000 20:03:21 +0000 (+0000) Subject: Fix nnkiboze bugs. X-Git-Url: http://cgit.sxemacs.org/?a=commitdiff_plain;h=af4835148b7e20c024b9d2619f5a5d772b1ee2f8;hp=07a9ae5dba55d3595fb4a27ea82ff072b5ab2825;p=gnus Fix nnkiboze bugs. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0ad74785d..9dc8db7c0 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,13 @@ +2000-09-21 16:15:25 ShengHuo ZHU + + * gnus-score.el (gnus-score-use-all-scores): New variable. + (gnus-all-score-files): Use it. + * 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. + * gnus-group.el (gnus-group-make-kiboze-group): Use + nnkiboze-score-file. + 2000-07-16 Dmitry Bely * nnheader.el (nnheader-translate-file-chars): Path splitting on NT. diff --git a/lisp/gnus-group.el b/lisp/gnus-group.el index 0aead88df..84ca7426d 100644 --- a/lisp/gnus-group.el +++ b/lisp/gnus-group.el @@ -2337,7 +2337,8 @@ score file entries for articles to include in the group." (push (cons header regexps) scores)) scores))) (gnus-group-make-group group "nnkiboze" address) - (let* ((score-file (gnus-score-file-name (concat "nnkiboze:" group))) + (let* ((nnkiboze-current-group group) + (score-file (car (nnkiboze-score-file ""))) (score-dir (file-name-directory score-file))) (unless (file-exists-p score-dir) (make-directory score-dir)) diff --git a/lisp/gnus-score.el b/lisp/gnus-score.el index 5ee3fd68a..0baed3b75 100644 --- a/lisp/gnus-score.el +++ b/lisp/gnus-score.el @@ -395,6 +395,9 @@ If nil, the user will be asked for a duration." ;; Internal variables. +(defvar gnus-score-use-all-scores t + "If nil, only `gnus-score-find-score-files-function' is used.") + (defvar gnus-adaptive-word-syntax-table (let ((table (copy-syntax-table (standard-syntax-table))) (numbers '(?0 ?1 ?2 ?3 ?4 ?5 ?6 ?7 ?8 ?9))) @@ -2707,19 +2710,20 @@ The list is determined from the variable gnus-score-file-alist." (and funcs (not (listp funcs)) (setq funcs (list funcs))) - ;; Get the initial score files for this group. - (when funcs - (setq score-files (nreverse (gnus-score-find-alist group)))) - ;; Add any home adapt files. - (let ((home (gnus-home-score-file group t))) - (when home - (push home score-files) - (setq gnus-newsgroup-adaptive-score-file home))) - ;; Check whether there is a `adapt-file' group parameter. - (let ((param-file (gnus-group-find-parameter group 'adapt-file))) - (when param-file - (push param-file score-files) - (setq gnus-newsgroup-adaptive-score-file param-file))) + (when gnus-score-use-all-scores + ;; Get the initial score files for this group. + (when funcs + (setq score-files (nreverse (gnus-score-find-alist group)))) + ;; Add any home adapt files. + (let ((home (gnus-home-score-file group t))) + (when home + (push home score-files) + (setq gnus-newsgroup-adaptive-score-file home))) + ;; Check whether there is a `adapt-file' group parameter. + (let ((param-file (gnus-group-find-parameter group 'adapt-file))) + (when param-file + (push param-file score-files) + (setq gnus-newsgroup-adaptive-score-file param-file)))) ;; Go through all the functions for finding score files (or actual ;; scores) and add them to a list. (while funcs @@ -2727,14 +2731,15 @@ The list is determined from the variable gnus-score-file-alist." (setq score-files (nconc score-files (nreverse (funcall (car funcs) group))))) (setq funcs (cdr funcs))) - ;; Add any home score files. - (let ((home (gnus-home-score-file group))) - (when home - (push home score-files))) - ;; Check whether there is a `score-file' group parameter. - (let ((param-file (gnus-group-find-parameter group 'score-file))) - (when param-file - (push param-file score-files))) + (when gnus-score-use-all-scores + ;; Add any home score files. + (let ((home (gnus-home-score-file group))) + (when home + (push home score-files))) + ;; Check whether there is a `score-file' group parameter. + (let ((param-file (gnus-group-find-parameter group 'score-file))) + (when param-file + (push param-file score-files)))) ;; Expand all files names. (let ((files score-files)) (while files diff --git a/lisp/nnkiboze.el b/lisp/nnkiboze.el index 1f85c7957..fb826da25 100644 --- a/lisp/nnkiboze.el +++ b/lisp/nnkiboze.el @@ -207,7 +207,10 @@ Finds out what articles are to be part of the nnkiboze groups." (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 @@ -216,7 +219,7 @@ Finds out what articles are to be part of the nnkiboze groups." (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 @@ -230,6 +233,9 @@ Finds out what articles are to be part of the nnkiboze groups." (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 @@ -332,9 +338,10 @@ Finds out what articles are to be part of the nnkiboze groups." (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) @@ -351,11 +358,11 @@ Finds out what articles are to be part of the nnkiboze groups." (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.