(set-buffer buffer)
(if (> (buffer-size) 0)
;; Non-empty overview, write it to a file.
- (let ((coding-system-for-write
- gnus-cache-overview-coding-system))
- (gnus-write-buffer overview-file))
+ (gnus-write-buffer-as-coding-system
+ gnus-cache-overview-coding-system overview-file)
;; Empty overview file, remove it
(when (file-exists-p overview-file)
(delete-file overview-file))
(when (file-exists-p file)
(erase-buffer)
(gnus-kill-all-overlays)
- (insert-file-contents file)
+ (nnheader-insert-file-contents file)
t)))
(defun gnus-cache-possibly-alter-active (group active)
;; unsuccessful), so we use the cached headers exclusively.
(set-buffer nntp-server-buffer)
(erase-buffer)
- (insert-file-contents cache-file)
+ (nnheader-insert-file-contents cache-file)
'nov)
((eq type 'nov)
;; We have both cached and uncached NOV headers, so we
(set-buffer cache-buf)
(buffer-disable-undo (current-buffer))
(erase-buffer)
- (insert-file-contents (or file (gnus-cache-file-name group ".overview")))
+ (nnheader-insert-file-contents (or file (gnus-cache-file-name group ".overview")))
(goto-char (point-min))
(insert "\n")
(goto-char (point-min)))
(save-excursion
(set-buffer cache-buf)
(erase-buffer)
- (insert-file-contents (gnus-cache-file-name group (car cached)))
+ (nnheader-insert-file-contents (gnus-cache-file-name group (car cached)))
(goto-char (point-min))
(insert "220 ")
(princ (car cached) (current-buffer))
;; We simply read the active file.
(save-excursion
(gnus-set-work-buffer)
- (insert-file-contents gnus-cache-active-file)
+ (nnheader-insert-file-contents gnus-cache-active-file)
(gnus-active-to-gnus-format
nil (setq gnus-cache-active-hashtb
(gnus-make-hashtable
(when (or force
(and gnus-cache-active-hashtb
gnus-cache-active-altered))
- (with-temp-file gnus-cache-active-file
+ (nnheader-temp-write gnus-cache-active-file
(mapatoms
(lambda (sym)
(when (and sym (boundp sym))
(when top
(gnus-message 5 "Generating the cache active file...")
(setq gnus-cache-active-hashtb (gnus-make-hashtable 123)))
+ (when (string-match "^\\(nn[^_]+\\)_" group)
+ (setq group (replace-match "\\1:" t t group)))
;; Separate articles from all other files and directories.
(while files
(if (string-match "^[0-9]+$" (file-name-nondirectory (car files)))
;; Go through all the other files.
(while alphs
(when (and (file-directory-p (car alphs))
- (not (string-match "^\\.\\.?$"
+ (not (string-match "^\\."
(file-name-nondirectory (car alphs)))))
;; We descend directories.
(gnus-cache-generate-active (car alphs)))