(file (gnus-agent-lib-file "active")))
(gnus-make-directory (file-name-directory file))
(nnheader-temp-write file
- (insert-file-contents file)
+ (when (file-exists-p file)
+ (insert-file-contents file))
(goto-char (point-min))
(when (re-search-forward (concat "^" (regexp-quote group) " ") nil t)
(gnus-delete-line))
(gnus-make-directory (nnheader-translate-file-chars
(file-name-directory file)))
(write-region (point-min) (point-max) file nil 'silent)
- (gnus-agent-save-alist group articles nil))
- t))))
+ (gnus-agent-save-alist group articles nil)
+ (gnus-agent-enter-history "last-header-fetched-for-session"
+ (list (cons group (nth (- (length articles) 1) articles)))
+ (gnus-time-to-day (current-time)))
+ t)))))
(defsubst gnus-agent-copy-nov-line (article)
(let (b e)
(interactive)
(let ((methods gnus-agent-covered-methods)
(day (- (gnus-time-to-day (current-time)) gnus-agent-expire-days))
- (expiry-hashtb (gnus-make-hashtable 1023))
gnus-command-method sym group articles
history overview file histories elem art nov-file low info
unreads marked article)
(save-excursion
(setq overview (get-buffer-create " *expire overview*"))
(while (setq gnus-command-method (pop methods))
+ (let ((expiry-hashtb (gnus-make-hashtable 1023)))
(gnus-agent-open-history)
(set-buffer
(setq gnus-agent-current-history
info (gnus-get-info group)
unreads (ignore-errors (gnus-list-of-unread-articles group))
marked (nconc (gnus-uncompress-range
- (cdr (assq 'ticked (gnus-info-marks info))))
+ (cdr (assq 'tick (gnus-info-marks info))))
(gnus-uncompress-range
(cdr (assq 'dormant
(gnus-info-marks info)))))
(< art article)))
(if (file-exists-p
(gnus-agent-article-name
- (number-to-string article) group))
+ (number-to-string art) group))
(forward-line 1)
;; Remove old NOV lines that have no articles.
(gnus-delete-line)))
(setcdr prev (setq alist (cdr alist)))
(setq prev alist
alist (cdr alist))))
- (setq gnus-agent-article-alist (cdr first)))
- (gnus-agent-save-alist group))
+ (setq gnus-agent-article-alist (cdr first))
+ ;;; Mark all articles up to the first article
+ ;;; in `gnus-article-alist' as read.
+ (when (caar gnus-agent-article-alist)
+ (setcar (nthcdr 2 info)
+ (gnus-range-add
+ (nth 2 info)
+ (cons 1 (- (caar gnus-agent-article-alist) 1)))))
+ (gnus-dribble-enter
+ (concat "(gnus-group-set-info '"
+ (gnus-prin1-to-string info)
+ ")"))
+ (gnus-agent-save-alist group)))
expiry-hashtb)
(set-buffer history)
(setq histories (nreverse (sort histories '<)))
(gnus-delete-line))
(gnus-agent-save-history)
(gnus-agent-close-history))
- (gnus-message 4 "Expiry...done")))))
+ (gnus-message 4 "Expiry...done"))))))
;;;###autoload
(defun gnus-agent-batch ()