summaryrefslogtreecommitdiff
path: root/lisp/gnus/gnus-cache.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/gnus/gnus-cache.el')
-rw-r--r--lisp/gnus/gnus-cache.el17
1 files changed, 9 insertions, 8 deletions
diff --git a/lisp/gnus/gnus-cache.el b/lisp/gnus/gnus-cache.el
index c3e77ca59b0..a16b61a3bd1 100644
--- a/lisp/gnus/gnus-cache.el
+++ b/lisp/gnus/gnus-cache.el
@@ -24,7 +24,7 @@
;;; Code:
-(eval-when-compile (require 'cl))
+(eval-when-compile (require 'cl-lib))
(require 'gnus)
(require 'gnus-sum)
@@ -642,7 +642,8 @@ $ emacs -batch -l ~/.emacs -l gnus -f gnus-jog-cache"
"Read the cache active file."
(gnus-make-directory gnus-cache-directory)
(if (or (not (file-exists-p gnus-cache-active-file))
- (zerop (nth 7 (file-attributes gnus-cache-active-file)))
+ (zerop (file-attribute-size
+ (file-attributes gnus-cache-active-file)))
force)
;; There is no active file, so we generate one.
(gnus-cache-generate-active)
@@ -735,7 +736,7 @@ If LOW, update the lower bound instead."
;; `gnus-cache-unified-group-names' needless.
(gnus-sethash (or (cdr (assoc group gnus-cache-unified-group-names))
group)
- (cons (car nums) (gnus-last-element nums))
+ (cons (car nums) (car (last nums)))
gnus-cache-active-hashtb))
;; Go through all the other files.
(dolist (file alphs)
@@ -854,7 +855,7 @@ supported."
size)
(if file
- (setq size (or (nth 7 (file-attributes file)) 0))
+ (setq size (or (file-attribute-size (file-attributes file)) 0))
(let* ((file-name-coding-system nnmail-pathname-coding-system)
(files (directory-files (gnus-cache-file-name group "")
t nil t))
@@ -862,12 +863,12 @@ supported."
(setq size 0.0)
(while (setq file (pop files))
(setq attrs (file-attributes file))
- (unless (nth 0 attrs)
- (incf size (float (nth 7 attrs)))))))
+ (unless (file-attribute-type attrs)
+ (cl-incf size (float (file-attribute-size attrs)))))))
(setq gnus-cache-need-update-total-fetched-for t)
- (incf (nth 1 entry) (if subtract (- size) size))))))
+ (cl-incf (nth 1 entry) (if subtract (- size) size))))))
(defun gnus-cache-update-overview-total-fetched-for (group file)
(when gnus-cache-total-fetched-hashtb
@@ -877,7 +878,7 @@ supported."
(gnus-sethash group (make-list 2 0)
gnus-cache-total-fetched-hashtb)))
(file-name-coding-system nnmail-pathname-coding-system)
- (size (or (nth 7 (file-attributes
+ (size (or (file-attribute-size (file-attributes
(or file
(gnus-cache-file-name group ".overview"))))
0)))