+\f
+;;; Internal functions.
+
+(defun nnml-deletable-article-p (group article)
+ "Say whether ARTICLE in GROUP can be deleted."
+ (let (file path)
+ (when (setq file (cdr (assq article nnml-article-file-alist)))
+ (setq path (concat nnml-current-directory file))
+ (and (file-writable-p path)
+ (or (not nnmail-keep-last-article)
+ (not (eq (cdr (nth 1 (assoc group nnml-group-alist)))
+ article)))))))
+
+;; Find an article number in the current group given the Message-ID.
+(defun nnml-find-group-number (id)
+ (save-excursion
+ (set-buffer (get-buffer-create " *nnml id*"))
+ (buffer-disable-undo (current-buffer))
+ (let ((alist nnml-group-alist)
+ number)
+ ;; We want to look through all .overview files, but we want to
+ ;; start with the one in the current directory. It seems most
+ ;; likely that the article we are looking for is in that group.
+ (if (setq number (nnml-find-id nnml-current-group id))
+ (cons nnml-current-group number)
+ ;; It wasn't there, so we look through the other groups as well.
+ (while (and (not number)
+ alist)
+ (or (string= (car (car alist)) nnml-current-group)
+ (setq number (nnml-find-id (car (car alist)) id)))
+ (or number
+ (setq alist (cdr alist))))
+ (and number
+ (cons (car (car alist)) number))))))
+
+(defun nnml-find-id (group id)
+ (erase-buffer)
+ (insert-file-contents
+ (concat (nnmail-group-pathname group nnml-directory)
+ nnml-nov-file-name))
+ (let (number found)
+ (while (and (not found)
+ (search-forward id nil t)) ; We find the ID.
+ ;; And the id is in the fourth field.
+ (if (search-backward
+ "\t" (save-excursion (beginning-of-line) (point)) t 4)
+ (progn
+ (beginning-of-line)
+ (setq found t)
+ ;; We return the article number.
+ (setq number
+ (condition-case ()
+ (read (current-buffer))
+ (error nil))))))
+ number))
+
+(defun nnml-retrieve-headers-with-nov (articles &optional fetch-old)