- method nnkiboze-newsrc nov-buffer gname newsrc active
- ginfo lowest)
- (setq nnkiboze-current-score-group group)
- (or info (error "No such group: %s" group))
- (and (file-exists-p newsrc-file) (load newsrc-file))
- (save-excursion
- (set-buffer (setq nov-buffer (find-file-noselect nov-file)))
- (buffer-disable-undo (current-buffer)))
- (mapatoms
- (lambda (group)
- (if (and (string-match regexp (setq gname (symbol-name group)))
- (not (assoc gname nnkiboze-newsrc)))
- (setq nnkiboze-newsrc
- (cons (cons gname (1- (car (symbol-value group))))
- nnkiboze-newsrc))))
- gnus-active-hashtb)
- (setq newsrc nnkiboze-newsrc)
- (while newsrc
- (if (not (setq active (gnus-gethash
- (car (car newsrc)) gnus-active-hashtb)))
- (setq nnkiboze-newsrc (delq (car newsrc) nnkiboze-newsrc))
- (switch-to-buffer gnus-group-buffer)
- (gnus-group-jump-to-group (car (car newsrc)))
- (if (and (setq ginfo (nth 2 (gnus-gethash (gnus-group-group-name)
+ ;; 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
+ gnus-visual gnus-suppress-duplicates num-unread)
+ (unless info
+ (error "No such group: %s" group))
+ ;; Load the kiboze newsrc file for this group.
+ (mm-with-unibyte
+ (when (file-exists-p newsrc-file)
+ (load newsrc-file))
+ (let ((coding-system-for-write nnkiboze-file-coding-system))
+ (gnus-make-directory (file-name-directory nov-file))
+ (with-temp-file nov-file
+ (when (file-exists-p nov-file)
+ (insert-file-contents nov-file))
+ (setq nov-buffer (current-buffer))
+ ;; Go through the active hashtb and add new all groups that match the
+ ;; kiboze regexp.
+ (mapatoms
+ (lambda (group)
+ (and (string-match nnkiboze-regexp
+ (setq gname (symbol-name group))) ; Match
+ (not (assoc gname nnkiboze-newsrc)) ; It isn't registered
+ (numberp (car (symbol-value group))) ; It is active
+ (or (> nnkiboze-level 7)
+ (and (setq glevel
+ (nth 1 (nth 2 (gnus-gethash
+ gname gnus-newsrc-hashtb))))
+ (>= nnkiboze-level glevel)))
+ (not (string-match "^nnkiboze:" gname)) ; Exclude kibozes
+ (push (cons gname (1- (car (symbol-value group))))
+ nnkiboze-newsrc)))
+ gnus-active-hashtb)
+ ;; `newsrc' is set to the list of groups that possibly are
+ ;; component groups to this kiboze group. This list has elements
+ ;; on the form `(GROUP . NUMBER)', where NUMBER is the highest
+ ;; number that has been kibozed in GROUP in this kiboze group.
+ (setq newsrc nnkiboze-newsrc)
+ (while newsrc
+ (if (not (setq active (gnus-gethash
+ (caar newsrc) gnus-active-hashtb)))
+ ;; This group isn't active after all, so we remove it from
+ ;; the list of component groups.
+ (setq nnkiboze-newsrc (delq (car newsrc) nnkiboze-newsrc))
+ (setq lowest (cdar newsrc))
+ ;; Ok, we have a valid component group, so we jump to it.
+ (switch-to-buffer gnus-group-buffer)
+ (gnus-group-jump-to-group (caar newsrc))
+ (gnus-message 3 "nnkiboze: Checking %s..." (caar newsrc))
+ (setq ginfo (gnus-get-info (gnus-group-group-name))
+ orig-info (gnus-copy-sequence ginfo)
+ num-unread (car (gnus-gethash (caar newsrc)