(defun gnus-agent-read-file (file)
"Load FILE and do a `read' there."
- (nnheader-temp-write nil
+ (with-temp-buffer
(ignore-errors
(nnheader-insert-file-contents file)
(goto-char (point-min))
(defun gnus-agent-write-servers ()
"Write the alist of covered servers."
- (nnheader-temp-write (nnheader-concat gnus-agent-directory "lib/servers")
+ (with-temp-file (nnheader-concat gnus-agent-directory "lib/servers")
(prin1 gnus-agent-covered-methods (current-buffer))))
;;;
(gnus-agent-lib-file "active")
(gnus-agent-lib-file "groups"))))
(gnus-make-directory (file-name-directory file))
- (nnheader-temp-write file
+ (with-temp-file file
(when (file-exists-p file)
(nnheader-insert-file-contents file))
(goto-char (point-min))
;; Fetch the articles from the backend.
(if (gnus-check-backend-function 'retrieve-articles group)
(setq pos (gnus-retrieve-articles articles group))
- (nnheader-temp-write nil
+ (with-temp-file nil
(let ((buf (current-buffer))
article)
(while (setq article (pop articles))
nil 'silent)
(pop gnus-agent-buffer-alist))
(while gnus-agent-group-alist
- (nnheader-temp-write (caar gnus-agent-group-alist)
+ (with-temp-file (caar gnus-agent-group-alist)
(princ (cdar gnus-agent-group-alist))
(insert "\n"))
(pop gnus-agent-group-alist))))
(defun gnus-agent-save-alist (group &optional articles state dir)
"Load the article-state alist for GROUP."
- (nnheader-temp-write (if dir
- (concat dir ".agentview")
- (gnus-agent-article-name ".agentview" group))
+ (with-temp-file (if dir
+ (concat dir ".agentview")
+ (gnus-agent-article-name ".agentview" group))
(princ (setq gnus-agent-article-alist
(nconc gnus-agent-article-alist
(mapcar (lambda (article) (cons article state))
"Write the category alist."
(setq gnus-category-predicate-cache nil
gnus-category-group-cache nil)
- (nnheader-temp-write (nnheader-concat gnus-agent-directory "lib/categories")
+ (with-temp-file (nnheader-concat gnus-agent-directory "lib/categories")
(prin1 gnus-category-alist (current-buffer))))
(defun gnus-category-edit-predicate (category)