diff options
Diffstat (limited to 'lisp/gnus')
-rw-r--r-- | lisp/gnus/gnus-agent.el | 54 | ||||
-rw-r--r-- | lisp/gnus/gnus-cache.el | 11 | ||||
-rw-r--r-- | lisp/gnus/gnus-cloud.el | 3 | ||||
-rw-r--r-- | lisp/gnus/gnus-score.el | 3 | ||||
-rw-r--r-- | lisp/gnus/gnus-start.el | 16 | ||||
-rw-r--r-- | lisp/gnus/gnus-sum.el | 9 | ||||
-rw-r--r-- | lisp/gnus/gnus-util.el | 7 | ||||
-rw-r--r-- | lisp/gnus/mail-source.el | 8 | ||||
-rw-r--r-- | lisp/gnus/nneething.el | 21 | ||||
-rw-r--r-- | lisp/gnus/nnfolder.el | 2 | ||||
-rw-r--r-- | lisp/gnus/nnheader.el | 4 | ||||
-rw-r--r-- | lisp/gnus/nnmail.el | 3 | ||||
-rw-r--r-- | lisp/gnus/nnmaildir.el | 42 | ||||
-rw-r--r-- | lisp/gnus/nnmh.el | 18 | ||||
-rw-r--r-- | lisp/gnus/nnml.el | 3 | ||||
-rw-r--r-- | lisp/gnus/spam-stat.el | 21 |
16 files changed, 131 insertions, 94 deletions
diff --git a/lisp/gnus/gnus-agent.el b/lisp/gnus/gnus-agent.el index 532fd7e7b8e..18e6174fa02 100644 --- a/lisp/gnus/gnus-agent.el +++ b/lisp/gnus/gnus-agent.el @@ -1603,7 +1603,8 @@ downloaded into the agent." (number-to-string have-this))) (size-file (float (or (and gnus-agent-total-fetched-hashtb - (nth 7 (file-attributes file-name))) + (file-attribute-size + (file-attributes file-name))) 0))) (file-name-coding-system nnmail-pathname-coding-system)) @@ -2096,12 +2097,16 @@ doesn't exist, to valid the overview buffer." (let* (alist (file-name-coding-system nnmail-pathname-coding-system) (file-attributes (directory-files-and-attributes - (gnus-agent-article-name "" - gnus-agent-read-agentview) nil "^[0-9]+$" t))) + (gnus-agent-article-name + "" gnus-agent-read-agentview) + nil "^[0-9]+$" t))) (while file-attributes (let ((fa (pop file-attributes))) - (unless (nth 1 fa) - (push (cons (string-to-number (nth 0 fa)) (time-to-days (nth 5 fa))) alist)))) + (unless (file-attribute-type (cdr fa)) + (push (cons (string-to-number (car fa)) + (time-to-days + (file-attribute-access-time (cdr fa)))) + alist)))) alist) (file-error nil)))))) @@ -3347,7 +3352,8 @@ missing NOV entry. Run gnus-agent-regenerate-group to restore it."))) (ignore-errors ; Just being paranoid. (let* ((file-name (nnheader-concat dir (number-to-string article-number))) - (size (float (nth 7 (file-attributes file-name))))) + (size (float (file-attribute-size + (file-attributes file-name))))) (cl-incf bytes-freed size) (cl-incf size-files-deleted size) (cl-incf files-deleted) @@ -3800,7 +3806,7 @@ has been fetched." (buffer-read-only nil) (file-name-coding-system nnmail-pathname-coding-system)) (when (and (file-exists-p file) - (> (nth 7 (file-attributes file)) 0)) + (> (file-attribute-size (file-attributes file)) 0)) (erase-buffer) (gnus-kill-all-overlays) (let ((coding-system-for-read gnus-cache-coding-system)) @@ -3945,9 +3951,11 @@ If REREAD is not nil, downloaded articles are marked as unread." ;; This entry in the overview has been downloaded (push (cons (car downloaded) (time-to-days - (nth 5 (file-attributes - (concat dir (number-to-string - (car downloaded))))))) alist) + (file-attribute-modification-time + (file-attributes + (concat dir (number-to-string + (car downloaded))))))) + alist) (setq downloaded (cdr downloaded)) (setq nov-arts (cdr nov-arts))) (t @@ -4105,19 +4113,21 @@ agent has fetched." (let ((sum 0.0) file) (while (setq file (pop delta)) - (cl-incf sum (float (or (nth 7 (file-attributes - (nnheader-concat - path - (if (numberp file) - (number-to-string file) - file)))) 0)))) + (cl-incf sum (float (or (file-attribute-size + (file-attributes + (nnheader-concat + path + (if (numberp file) + (number-to-string file) + file)))) + 0)))) (setq delta sum)) (let ((sum (- (nth 2 entry))) (info (directory-files-and-attributes path nil "^-?[0-9]+$" t)) file) (while (setq file (pop info)) - (cl-incf sum (float (or (nth 8 file) 0)))) + (cl-incf sum (float (or (file-attribute-size (cdr file)) 0)))) (setq delta sum)))) (setq gnus-agent-need-update-total-fetched-for t) @@ -4138,11 +4148,11 @@ modified." (gnus-sethash path (make-list 3 0) gnus-agent-total-fetched-hashtb))) (file-name-coding-system nnmail-pathname-coding-system) - (size (or (nth 7 (file-attributes - (nnheader-concat - path (if agent-over - ".overview" - ".agentview")))) + (size (or (file-attribute-size (file-attributes + (nnheader-concat + path (if agent-over + ".overview" + ".agentview")))) 0))) (setq gnus-agent-need-update-total-fetched-for t) (setf (nth (if agent-over 1 0) entry) size))))) diff --git a/lisp/gnus/gnus-cache.el b/lisp/gnus/gnus-cache.el index 6afc52c0fce..a16b61a3bd1 100644 --- a/lisp/gnus/gnus-cache.el +++ b/lisp/gnus/gnus-cache.el @@ -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) @@ -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,8 +863,8 @@ supported." (setq size 0.0) (while (setq file (pop files)) (setq attrs (file-attributes file)) - (unless (nth 0 attrs) - (cl-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) @@ -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))) diff --git a/lisp/gnus/gnus-cloud.el b/lisp/gnus/gnus-cloud.el index 16bd80dbfa1..1aa8e71ae1e 100644 --- a/lisp/gnus/gnus-cloud.el +++ b/lisp/gnus/gnus-cloud.el @@ -339,7 +339,8 @@ Use old data if FORCE-OLDER is not nil." (format-time-string "%FT%T%z" time)) (defun gnus-cloud-file-new-p (file full) - (let ((timestamp (gnus-cloud-timestamp (nth 5 (file-attributes file)))) + (let ((timestamp (gnus-cloud-timestamp (file-attribute-modification-time + (file-attributes file)))) (old (cadr (assoc file gnus-cloud-file-timestamps)))) (when (or full (null old) diff --git a/lisp/gnus/gnus-score.el b/lisp/gnus/gnus-score.el index 6878aa69c66..327cc69392d 100644 --- a/lisp/gnus/gnus-score.el +++ b/lisp/gnus/gnus-score.el @@ -2675,7 +2675,8 @@ the score file and its full name, including the directory.") (gnus-file-newer-than gnus-kill-files-directory (car gnus-score-file-list))) (setq gnus-score-file-list - (cons (nth 5 (file-attributes gnus-kill-files-directory)) + (cons (file-attribute-modification-time + (file-attributes gnus-kill-files-directory)) (nreverse (directory-files gnus-kill-files-directory t diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el index 623055e1f65..f15d645a534 100644 --- a/lisp/gnus/gnus-start.el +++ b/lisp/gnus/gnus-start.el @@ -2822,7 +2822,8 @@ If FORCE is non-nil, the .newsrc file is read." ;; Check timestamp of `gnus-current-startup-file'.eld against ;; `gnus-save-newsrc-file-last-timestamp'. (if (let* ((checkfile (concat gnus-current-startup-file ".eld")) - (mtime (nth 5 (file-attributes checkfile)))) + (mtime (file-attribute-modification-time + (file-attributes checkfile)))) (and gnus-save-newsrc-file-last-timestamp (time-less-p gnus-save-newsrc-file-last-timestamp mtime) @@ -2843,7 +2844,8 @@ If FORCE is non-nil, the .newsrc file is read." (gnus-run-hooks 'gnus-save-quick-newsrc-hook) (save-buffer) (setq gnus-save-newsrc-file-last-timestamp - (nth 5 (file-attributes buffer-file-name)))) + (file-attribute-modification-time + (file-attributes buffer-file-name)))) (let ((coding-system-for-write gnus-ding-file-coding-system) (version-control gnus-backup-startup-file) (startup-file (concat gnus-current-startup-file ".eld")) @@ -2880,7 +2882,8 @@ If FORCE is non-nil, the .newsrc file is read." (rename-file working-file startup-file t) (gnus-set-file-modes startup-file setmodes) (setq gnus-save-newsrc-file-last-timestamp - (nth 5 (file-attributes startup-file))))) + (file-attribute-modification-time + (file-attributes startup-file))))) (condition-case nil (delete-file working-file) (file-error nil))))) @@ -3053,11 +3056,12 @@ If FORCE is non-nil, the .newsrc file is read." (with-current-buffer (gnus-get-buffer-create " *gnus slave*") (setq slave-files (sort (mapcar (lambda (file) - (list (nth 5 (file-attributes file)) file)) + (list (file-attribute-modification-time + (file-attributes file)) + file)) slave-files) (lambda (f1 f2) - (or (< (caar f1) (caar f2)) - (< (nth 1 (car f1)) (nth 1 (car f2))))))) + (time-less-p (car f1) (car f2))))) (while slave-files (erase-buffer) (setq file (nth 1 (car slave-files))) diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index ceb98421665..f56b822ac57 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -10340,16 +10340,19 @@ latter case, they will be copied into the relevant groups." (unless (re-search-forward "^date:" nil t) (goto-char (point-max)) (setq atts (file-attributes file)) - (insert "Date: " (message-make-date (nth 5 atts)) "\n"))) + (insert "Date: " (message-make-date + (file-attribute-modification-time atts)) + "\n"))) ;; This doesn't look like an article, so we fudge some headers. (setq atts (file-attributes file) lines (count-lines (point-min) (point-max))) (insert "From: " (read-string "From: ") "\n" "Subject: " (read-string "Subject: ") "\n" - "Date: " (message-make-date (nth 5 atts)) "\n" + "Date: " (message-make-date + (file-attribute-modification-time atts)) "\n" "Message-ID: " (message-make-message-id) "\n" "Lines: " (int-to-string lines) "\n" - "Chars: " (int-to-string (nth 7 atts)) "\n\n")) + "Chars: " (int-to-string (file-attribute-size atts)) "\n\n")) (setq group-art (gnus-request-accept-article group nil t)) (kill-buffer (current-buffer))) (setq gnus-newsgroup-active (gnus-activate-group group)) diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el index b30e4d125b2..2e4b054a9f9 100644 --- a/lisp/gnus/gnus-util.el +++ b/lisp/gnus/gnus-util.el @@ -277,10 +277,7 @@ Symbols are also allowed; their print names are used instead." ;;; Time functions. (defun gnus-file-newer-than (file date) - (let ((fdate (nth 5 (file-attributes file)))) - (or (> (car fdate) (car date)) - (and (= (car fdate) (car date)) - (> (nth 1 fdate) (nth 1 date)))))) + (time-less-p date (file-attribute-modification-time (file-attributes file)))) ;;; Keymap macros. @@ -1434,7 +1431,7 @@ SPEC is a predicate specifier that contains stuff like `or', `and', (defun gnus-cache-file-contents (file variable function) "Cache the contents of FILE in VARIABLE. The contents come from FUNCTION." - (let ((time (nth 5 (file-attributes file))) + (let ((time (file-attribute-modification-time (file-attributes file))) contents value) (if (or (null (setq value (symbol-value variable))) (not (equal (car value) file)) diff --git a/lisp/gnus/mail-source.el b/lisp/gnus/mail-source.el index 0e1c0736363..5af292091e8 100644 --- a/lisp/gnus/mail-source.el +++ b/lisp/gnus/mail-source.el @@ -602,7 +602,8 @@ If CONFIRM is non-nil, ask for confirmation before removing a file." (let* ((ffile (car files)) (bfile (replace-regexp-in-string "\\`.*/\\([^/]+\\)\\'" "\\1" ffile)) - (filetime (nth 5 (file-attributes ffile)))) + (filetime (file-attribute-modification-time + (file-attributes ffile)))) (setq files (cdr files)) (when (and (> (time-to-number-of-days (time-subtract now filetime)) diff) @@ -618,7 +619,8 @@ Deleting old (> %s day(s)) incoming mail file `%s'." diff bfile) (defun mail-source-callback (callback info) "Call CALLBACK on the mail file. Pass INFO on to CALLBACK." (if (or (not (file-exists-p mail-source-crash-box)) - (zerop (nth 7 (file-attributes mail-source-crash-box)))) + (zerop (file-attribute-size + (file-attributes mail-source-crash-box)))) (progn (when (file-exists-p mail-source-crash-box) (delete-file mail-source-crash-box)) @@ -670,7 +672,7 @@ Deleting old (> %s day(s)) incoming mail file `%s'." diff bfile) ((not (file-exists-p from)) ;; There is no inbox. (setq to nil)) - ((zerop (nth 7 (file-attributes from))) + ((zerop (file-attribute-size (file-attributes from))) ;; Empty file. (setq to nil)) (t diff --git a/lisp/gnus/nneething.el b/lisp/gnus/nneething.el index abd17c55086..10ac7025505 100644 --- a/lisp/gnus/nneething.el +++ b/lisp/gnus/nneething.el @@ -215,8 +215,9 @@ included.") (setq nneething-map (mapcar (lambda (n) (list (cdr n) (car n) - (nth 5 (file-attributes - (nneething-file-name (car n)))))) + (file-attribute-modification-time + (file-attributes + (nneething-file-name (car n)))))) nneething-map))) ;; Remove files matching the exclusion regexp. (when nneething-exclude-files @@ -244,7 +245,7 @@ included.") (while map (if (and (member (cadr (car map)) files) ;; We also remove files that have changed mod times. - (equal (nth 5 (file-attributes + (equal (file-attribute-modification-time (file-attributes (nneething-file-name (cadr (car map))))) (cadr (cdar map)))) (progn @@ -262,7 +263,7 @@ included.") (setq touched t) (setcdr nneething-active (1+ (cdr nneething-active))) (push (list (cdr nneething-active) (car files) - (nth 5 (file-attributes + (file-attribute-modification-time (file-attributes (nneething-file-name (car files))))) nneething-map)) (setq files (cdr files))) @@ -318,15 +319,17 @@ included.") "Subject: " (file-name-nondirectory file) (or extra-msg "") "\n" "Message-ID: <nneething-" (nneething-encode-file-name file) "@" (system-name) ">\n" - (if (equal '(0 0) (nth 5 atts)) "" - (concat "Date: " (current-time-string (nth 5 atts)) "\n")) + (if (zerop (float-time (file-attribute-modification-time atts))) "" + (concat "Date: " + (current-time-string (file-attribute-modification-time atts)) + "\n")) (or (when buffer (with-current-buffer buffer (when (re-search-forward "<[a-zA-Z0-9_]@[-a-zA-Z0-9_]>" 1000 t) (concat "From: " (match-string 0) "\n")))) - (nneething-from-line (nth 2 atts) file)) - (if (> (string-to-number (int-to-string (nth 7 atts))) 0) - (concat "Chars: " (int-to-string (nth 7 atts)) "\n") + (nneething-from-line (file-attribute-user-id atts) file)) + (if (> (file-attribute-size atts) 0) + (concat "Chars: " (int-to-string (file-attribute-size atts)) "\n") "") (if buffer (with-current-buffer buffer diff --git a/lisp/gnus/nnfolder.el b/lisp/gnus/nnfolder.el index 11a39866689..8ef6f2a0582 100644 --- a/lisp/gnus/nnfolder.el +++ b/lisp/gnus/nnfolder.el @@ -862,7 +862,7 @@ deleted. Point is left where the deleted region was." (mm-enable-multibyte) ;; Use multibyte buffer for future copying. (buffer-disable-undo) (if (equal (cadr (assoc group nnfolder-scantime-alist)) - (nth 5 (file-attributes file))) + (file-attribute-modification-time (file-attributes file))) ;; This looks up-to-date, so we don't do any scanning. (if (file-exists-p file) buffer diff --git a/lisp/gnus/nnheader.el b/lisp/gnus/nnheader.el index b9ce20413fb..83a9c3f3e17 100644 --- a/lisp/gnus/nnheader.el +++ b/lisp/gnus/nnheader.el @@ -896,7 +896,7 @@ without formatting." (defun nnheader-file-size (file) "Return the file size of FILE or 0." - (or (nth 7 (file-attributes file)) 0)) + (or (file-attribute-size (file-attributes file)) 0)) (defun nnheader-find-etc-directory (package &optional file first) "Go through `load-path' and find the \"../etc/PACKAGE\" directory. @@ -951,7 +951,7 @@ find-file-hook, etc. (mm-insert-file-contents filename visit beg end replace))) (defun nnheader-insert-nov-file (file first) - (let ((size (nth 7 (file-attributes file))) + (let ((size (file-attribute-size (file-attributes file))) (cutoff (* 32 1024))) (when size (if (< size cutoff) diff --git a/lisp/gnus/nnmail.el b/lisp/gnus/nnmail.el index 08db5ab5b69..13c4303291c 100644 --- a/lisp/gnus/nnmail.el +++ b/lisp/gnus/nnmail.el @@ -1534,7 +1534,8 @@ See the documentation for the variable `nnmail-split-fancy' for details." (and (setq file (ignore-errors (symbol-value (intern (format "%s-active-file" backend))))) - (setq file-time (nth 5 (file-attributes file))) + (setq file-time (file-attribute-modification-time + (file-attributes file))) (or (not (setq timestamp (condition-case () diff --git a/lisp/gnus/nnmaildir.el b/lisp/gnus/nnmaildir.el index fbabf573c4f..afaf3dcfcff 100644 --- a/lisp/gnus/nnmaildir.el +++ b/lisp/gnus/nnmaildir.el @@ -318,15 +318,15 @@ This variable is set by `nnmaildir-request-article'.") (setq attr (file-attributes (concat dir (number-to-string number-opened)))) (or attr (throw 'return (1- number-opened))) - (setq ino-opened (nth 10 attr) - nlink (nth 1 attr) + (setq ino-opened (file-attribute-inode-number attr) + nlink (file-attribute-link-number attr) number-linked (+ number-opened nlink)) (if (or (< nlink 1) (< number-linked nlink)) (signal 'error '("Arithmetic overflow"))) (setq attr (file-attributes (concat dir (number-to-string number-linked)))) (or attr (throw 'return (1- number-linked))) - (unless (equal ino-opened (nth 10 attr)) + (unless (equal ino-opened (file-attribute-inode-number attr)) (setq number-opened number-linked)))))) ;; Make the given server, if non-nil, be the current server. Then make the @@ -392,8 +392,8 @@ This variable is set by `nnmaildir-request-article'.") (setq make-new-file nil previous-number-link 0)) (let* ((attr (file-attributes path-open)) - (nlink (nth 1 attr))) - (setq ino-open (nth 10 attr) + (nlink (file-attribute-link-number attr))) + (setq ino-open (file-attribute-inode-number attr) number-link (+ number-open nlink)) (if (or (< nlink 1) (< number-link nlink)) (signal 'error '("Arithmetic overflow")))) @@ -412,7 +412,7 @@ This variable is set by `nnmaildir-request-article'.") number-open number-link)) ((nnmaildir--eexist-p err) (let ((attr (file-attributes path-link))) - (unless (equal (nth 10 attr) ino-open) + (unless (equal (file-attribute-inode-number attr) ino-open) (setq number-open number-link number-link 0)))) (t (signal (car err) (cdr err))))))))) @@ -437,8 +437,8 @@ This variable is set by `nnmaildir-request-article'.") (unless attr (nnmaildir--expired-article group article) (throw 'return nil)) - (setq mtime (nth 5 attr) - attr (nth 7 attr) + (setq mtime (file-attribute-modification-time attr) + attr (file-attribute-size attr) nov (nnmaildir--art-nov article) dir (nnmaildir--nndir dir) novdir (nnmaildir--nov-dir dir) @@ -794,29 +794,33 @@ This variable is set by `nnmaildir-request-article'.") (setq read-only (nnmaildir--param pgname 'read-only) ls (or (nnmaildir--param pgname 'directory-files) srv-ls)) (unless read-only - (setq x (nth 11 (file-attributes tdir))) - (unless (and (equal x (nth 11 nattr)) (equal x (nth 11 cattr))) + (setq x (file-attribute-device-number (file-attributes tdir))) + (unless (and (equal x (file-attribute-device-number nattr)) + (equal x (file-attribute-device-number cattr))) (setf (nnmaildir--srv-error nnmaildir--cur-server) (concat "Maildir spans filesystems: " absdir)) (throw 'return nil)) (dolist (file (funcall ls tdir 'full "\\`[^.]" 'nosort)) (setq x (file-attributes file)) - (if (or (> (cadr x) 1) (time-less-p (nth 4 x) 36h-ago)) + (if (or (> (file-attribute-link-number x) 1) + (time-less-p (file-attribute-access-time x) 36h-ago)) (delete-file file)))) (or scan-msgs isnew (throw 'return t)) - (setq nattr (nth 5 nattr)) + (setq nattr (file-attribute-modification-time nattr)) (if (equal nattr (nnmaildir--grp-new group)) (setq nattr nil)) (if read-only (setq dir (and (or isnew nattr) ndir)) (when (or isnew nattr) (dolist (file (funcall ls ndir nil "\\`[^.]" 'nosort)) (setq x (concat ndir file)) - (and (time-less-p (nth 5 (file-attributes x)) nil) + (and (time-less-p (file-attribute-modification-time + (file-attributes x)) + nil) (rename-file x (concat cdir (nnmaildir--ensure-suffix file))))) (setf (nnmaildir--grp-new group) nattr)) - (setq cattr (nth 5 (file-attributes cdir))) + (setq cattr (file-attribute-modification-time (file-attributes cdir))) (if (equal cattr (nnmaildir--grp-cur group)) (setq cattr nil)) (setq dir (and (or isnew cattr) cdir))) @@ -903,7 +907,7 @@ This variable is set by `nnmaildir-request-article'.") (if (nnmaildir--srv-gnm nnmaildir--cur-server) (nnmail-get-new-mail 'nnmaildir nil nil scan-group)) (unintern scan-group groups)) - (setq x (nth 5 (file-attributes srv-dir)) + (setq x (file-attribute-modification-time (file-attributes srv-dir)) scan-group (null scan-group)) (if (equal x (nnmaildir--srv-mtime nnmaildir--cur-server)) (if scan-group @@ -936,7 +940,7 @@ This variable is set by `nnmaildir-request-article'.") (dolist (grp x) (unintern grp groups)) (setf (nnmaildir--srv-mtime nnmaildir--cur-server) - (nth 5 (file-attributes srv-dir)))) + (file-attribute-modification-time (file-attributes srv-dir)))) (and scan-group (nnmaildir--srv-gnm nnmaildir--cur-server) (nnmail-get-new-mail 'nnmaildir nil nil)))))) @@ -993,7 +997,7 @@ This variable is set by `nnmaildir-request-article'.") (curdir (nnmaildir--cur (nnmaildir--srvgrp-dir (nnmaildir--srv-dir nnmaildir--cur-server) gname))) - (curdir-mtime (nth 5 (file-attributes curdir))) + (curdir-mtime (file-attribute-modification-time (file-attributes curdir))) pgname flist always-marks never-marks old-marks dir all-marks marks ranges markdir read ls old-mmth new-mmth mtime existing missing deactivate-mark) @@ -1046,7 +1050,7 @@ This variable is set by `nnmaildir-request-article'.") ;; a filename flag, get the later of the mtimes for markdir and ;; curdir, otherwise only the markdir counts. (setq mtime - (let ((markdir-mtime (nth 5 (file-attributes markdir)))) + (let ((markdir-mtime (file-attribute-modification-time (file-attributes markdir)))) (cond ((null (nnmaildir--mark-to-flag mark)) markdir-mtime) @@ -1599,7 +1603,7 @@ This variable is set by `nnmaildir-request-article'.") (nnmaildir--expired-article group article)) ((and no-force (progn - (setq time (nth 5 time) + (setq time (file-attribute-modification-time time) bound-iter boundary) (while (and bound-iter time (= (car bound-iter) (car time))) diff --git a/lisp/gnus/nnmh.el b/lisp/gnus/nnmh.el index 33be64fb8d2..d0f8ec256e7 100644 --- a/lisp/gnus/nnmh.el +++ b/lisp/gnus/nnmh.el @@ -210,8 +210,10 @@ as unread by Gnus.") min rdir num subdirectoriesp file) ;; Recurse down directories. (setq subdirectoriesp - ;; nth 1 of file-attributes always 1 on MS Windows :( - (/= (nth 1 (file-attributes (file-truename dir))) 2)) + ;; link number always 1 on MS Windows :( + (/= (file-attribute-link-number + (file-attributes (file-truename dir))) + 2)) (dolist (rdir files) (if (or (not subdirectoriesp) (file-regular-p rdir)) @@ -263,7 +265,8 @@ as unread by Gnus.") (while (and articles is-old) (setq article (concat dir (int-to-string (car articles)))) - (when (setq mod-time (nth 5 (file-attributes article))) + (when (setq mod-time (file-attribute-modification-time + (file-attributes article))) (if (and (nnmh-deletable-article-p newsgroup (car articles)) (setq is-old (nnmail-expired-article-p newsgroup mod-time force))) @@ -534,8 +537,8 @@ as unread by Gnus.") art) (while (setq art (pop arts)) (when (not (equal - (nth 5 (file-attributes - (concat dir (int-to-string (car art))))) + (file-attribute-modification-time + (file-attributes (concat dir (int-to-string (car art))))) (cdr art))) (setq articles (delq art articles)) (push (car art) new)))) @@ -546,8 +549,9 @@ as unread by Gnus.") (mapcar (lambda (art) (cons art - (nth 5 (file-attributes - (concat dir (int-to-string art)))))) + (file-attribute-modification-time + (file-attributes + (concat dir (int-to-string art)))))) new))) ;; Make Gnus mark all new articles as unread. (when new diff --git a/lisp/gnus/nnml.el b/lisp/gnus/nnml.el index 6307e132187..e7a5b99835f 100644 --- a/lisp/gnus/nnml.el +++ b/lisp/gnus/nnml.el @@ -344,7 +344,8 @@ non-nil.") (while (and articles is-old) (if (and (setq article (nnml-article-to-file (setq number (pop articles)))) - (setq mod-time (nth 5 (file-attributes article))) + (setq mod-time (file-attribute-modification-time + (file-attributes article))) (nnml-deletable-article-p group number) (setq is-old (nnmail-expired-article-p group mod-time force nnml-inhibit-expiry))) diff --git a/lisp/gnus/spam-stat.el b/lisp/gnus/spam-stat.el index 92052952605..3625132f8fe 100644 --- a/lisp/gnus/spam-stat.el +++ b/lisp/gnus/spam-stat.el @@ -77,13 +77,13 @@ ;; Learn spam: (spam-stat-process-spam-directory "~/Mail/mail/spam") ;; Learn non-spam: (spam-stat-process-non-spam-directory "~/Mail/mail/misc") ;; Save table: (spam-stat-save) -;; File size: (nth 7 (file-attributes spam-stat-file)) +;; File size: (file-attribute-size (file-attributes spam-stat-file)) ;; Number of words: (hash-table-count spam-stat) ;; Test spam: (spam-stat-test-directory "~/Mail/mail/spam") ;; Test non-spam: (spam-stat-test-directory "~/Mail/mail/misc") ;; Reduce table size: (spam-stat-reduce-size) ;; Save table: (spam-stat-save) -;; File size: (nth 7 (file-attributes spam-stat-file)) +;; File size: (file-attribute-size (file-attributes spam-stat-file)) ;; Number of words: (hash-table-count spam-stat) ;; Test spam: (spam-stat-test-directory "~/Mail/mail/spam") ;; Test non-spam: (spam-stat-test-directory "~/Mail/mail/misc") @@ -424,7 +424,8 @@ spam-stat (spam-stat-to-hash-table '(" spam-stat-ngood spam-stat-nbad)) (insert ")))")))) (message "Saved %s." spam-stat-file) (setq spam-stat-dirty nil - spam-stat-last-saved-at (nth 5 (file-attributes spam-stat-file))))) + spam-stat-last-saved-at (file-attribute-modification-time + (file-attributes spam-stat-file))))) (defun spam-stat-load () "Read the `spam-stat' hash table from disk." @@ -434,12 +435,14 @@ spam-stat (spam-stat-to-hash-table '(" spam-stat-ngood spam-stat-nbad)) ((or (not (boundp 'spam-stat-last-saved-at)) (null spam-stat-last-saved-at) (not (equal spam-stat-last-saved-at - (nth 5 (file-attributes spam-stat-file))))) + (file-attribute-modification-time + (file-attributes spam-stat-file))))) (progn (load-file spam-stat-file) (setq spam-stat-dirty nil spam-stat-last-saved-at - (nth 5 (file-attributes spam-stat-file))))) + (file-attribute-modification-time + (file-attributes spam-stat-file))))) (t (message "Spam stat file not loaded: no change in disk."))))) (defun spam-stat-to-hash-table (entries) @@ -561,8 +564,10 @@ check the variable `spam-stat-score-data'." (dolist (f files) (when (and (file-readable-p f) (file-regular-p f) - (> (nth 7 (file-attributes f)) 0) - (< (time-to-number-of-days (time-since (nth 5 (file-attributes f)))) + (> (file-attribute-size (file-attributes f)) 0) + (< (time-to-number-of-days + (time-since (file-attribute-modification-time + (file-attributes f)))) spam-stat-process-directory-age)) (setq count (1+ count)) (message "Reading %s: %.2f%%" dir (/ count max)) @@ -607,7 +612,7 @@ display non-spam files; otherwise display spam files." (dolist (f files) (when (and (file-readable-p f) (file-regular-p f) - (> (nth 7 (file-attributes f)) 0)) + (> (file-attribute-size (file-attributes f)) 0)) (setq count (1+ count)) (message "Reading %.2f%%, score %.2f" (/ count max) (/ score count)) |