Function: gnus-cache-braid-nov

gnus-cache-braid-nov is a byte-compiled function defined in gnus-cache.el.gz.

Signature

(gnus-cache-braid-nov GROUP CACHED &optional FILE)

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/gnus-cache.el.gz
(defun gnus-cache-braid-nov (group cached &optional file)
  (let ((cache-buf (gnus-get-buffer-create " *gnus-cache*"))
	beg end)
    (gnus-cache-save-buffers)
    (with-current-buffer cache-buf
      (erase-buffer)
      (let ((coding-system-for-read gnus-cache-overview-coding-system)
	    (file-name-coding-system nnmail-pathname-coding-system))
	(insert-file-contents
	 (or file (gnus-cache-file-name group ".overview"))))
      (goto-char (point-min))
      (insert "\n")
      (goto-char (point-min)))
    (set-buffer nntp-server-buffer)
    (goto-char (point-min))
    (while cached
      (while (and (not (eobp))
		  (< (read (current-buffer)) (car cached)))
	(forward-line 1))
      (beginning-of-line)
      (set-buffer cache-buf)
      (if (search-forward (concat "\n" (int-to-string (car cached)) "\t")
			  nil t)
          (setq beg (line-beginning-position)
		end (progn (end-of-line) (point)))
	(setq beg nil))
      (set-buffer nntp-server-buffer)
      (when beg
	(insert-buffer-substring cache-buf beg end)
	(insert "\n"))
      (setq cached (cdr cached)))
    (kill-buffer cache-buf)))