Function: nnheader-insert-nov-file

nnheader-insert-nov-file is a byte-compiled function defined in nnheader.el.gz.

Signature

(nnheader-insert-nov-file FILE FIRST)

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/nnheader.el.gz
(defun nnheader-insert-nov-file (file first)
  (let ((size (file-attribute-size (file-attributes file)))
	(cutoff (* 32 1024)))
    (when size
      (if (< size cutoff)
          ;; If the file is small, we just load it.
          (nnheader-insert-file-contents file)
        ;; We start on the assumption that FIRST is pretty recent.  If
        ;; not, we just insert the rest of the file as well.
        (let (current)
          (nnheader-insert-file-contents file nil (- size cutoff) size)
          (goto-char (point-min))
          (delete-region (point) (or (search-forward "\n" nil 'move) (point)))
          (setq current (ignore-errors (read (current-buffer))))
          (if (and (numberp current)
                   (< current first))
              t
            (delete-region (point-min) (point-max))
            (nnheader-insert-file-contents file)))))))