Function: gnus-agent-unread-articles

gnus-agent-unread-articles is a byte-compiled function defined in gnus-agent.el.gz.

Signature

(gnus-agent-unread-articles GROUP)

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/gnus-agent.el.gz
(defun gnus-agent-unread-articles (group)
  (let* ((read (gnus-info-read (gnus-get-info group)))
	 (known (gnus-agent-load-alist group))
	 (unread (list nil))
	 (tail-unread unread))
    (while (and known read)
      (let ((candidate (car (pop known))))
	(while (let* ((range (car read))
		      (min   (if (numberp range) range (car range)))
		      (max   (if (numberp range) range (cdr range))))
		 (cond ((or (not min)
			    (< candidate min))
			(gnus-agent-append-to-list tail-unread candidate)
			nil)
		       ((> candidate max)
			(setq read (cdr read))
                        ;; return t so that I always loop one more
                        ;; time.  If I just iterated off the end of
                        ;; read, min will become nil and the current
                        ;; candidate will be added to the unread list.
                        t))))))
    (while known
      (gnus-agent-append-to-list tail-unread (car (pop known))))
    (cdr unread)))