Function: nnspool-retrieve-headers-with-nov

nnspool-retrieve-headers-with-nov is a byte-compiled function defined in nnspool.el.gz.

Signature

(nnspool-retrieve-headers-with-nov ARTICLES &optional FETCH-OLD)

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/nnspool.el.gz
(defun nnspool-retrieve-headers-with-nov (articles &optional fetch-old)
  (if (or gnus-nov-is-evil nnspool-nov-is-evil)
      nil
    (let ((nov (nnheader-group-pathname
		nnspool-current-group nnspool-nov-directory ".overview"))
	  (arts articles)
	  (nnheader-file-coding-system nnspool-file-coding-system)
	  last)
      (if (not (file-exists-p nov))
	  ()
	(with-current-buffer nntp-server-buffer
	  (erase-buffer)
	  (if nnspool-sift-nov-with-sed
	      (nnspool-sift-nov-with-sed articles nov)
	    (nnheader-insert-file-contents nov)
	    (if (and fetch-old
		     (not (numberp fetch-old)))
		t			; We want all the headers.
	      (ignore-errors
		;; Delete unwanted NOV lines.
		(nnheader-nov-delete-outside-range
		 (if fetch-old (max 1 (- (car articles) fetch-old))
		   (car articles))
		 (car (last articles)))
		;; If the buffer is empty, this wasn't very successful.
		(unless (zerop (buffer-size))
		  ;; We check what the last article number was.
		  ;; The NOV file may be out of sync with the articles
		  ;; in the group.
		  (forward-line -1)
		  (setq last (read (current-buffer)))
		  (if (= last (car articles))
		      ;; Yup, it's all there.
		      t
		    ;; Perhaps not.  We try to find the missing articles.
		    (while (and arts
				(<= last (car arts)))
		      (pop arts))
		    ;; The articles in `arts' are missing from the buffer.
		    (mapc #'nnspool-insert-nov-head arts)
		    t))))))))))