+2000-09-21 21:54:48 ShengHuo ZHU <zsh@cs.rochester.edu>
+
+ * lpath.el: Bind nnkiboze-score-file.
+
+2000-09-21 16:15:25 ShengHuo ZHU <zsh@cs.rochester.edu>
+
+ * 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.
+
+ * nnkiboze.el (nnkiboze-request-article): Use
+ gnus-cache-request-article.
+ * gnus-group.el (gnus-group-make-kiboze-group): Fix prompt.
+
2000-07-16 Dmitry Bely <dbely@mail.ru>
* nnheader.el (nnheader-translate-file-chars): Path splitting on NT.
"Match on header: " headers nil t))))
(setq regexps nil)
(while (not (equal "" (setq regexp (read-string
- (format "Match on %s (string): "
+ (format "Match on %s (regexp): "
header)))))
(push (list regexp nil nil 'r) regexps))
(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))
;; 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)))
(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
(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
(defun md5 (object &optional start end coding noerror)
)
+(defun nnkiboze-score-file (a)
+ )
+
(provide 'lpath)
;; 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.