diff options
Diffstat (limited to 'lisp/gnus/mail-source.el')
-rw-r--r-- | lisp/gnus/mail-source.el | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/lisp/gnus/mail-source.el b/lisp/gnus/mail-source.el index abb5e2d1231..5af292091e8 100644 --- a/lisp/gnus/mail-source.el +++ b/lisp/gnus/mail-source.el @@ -26,7 +26,7 @@ (require 'format-spec) (eval-when-compile - (require 'cl) + (require 'cl-lib) (require 'imap)) (autoload 'auth-source-search "auth-source") (autoload 'pop3-movemail "pop3") @@ -439,7 +439,7 @@ the `mail-source-keyword-map' variable." ;; the msname is the mail-source parameter (dolist (msname '(:server :user :port)) ;; the asname is the auth-source parameter - (let* ((asname (case msname + (let* ((asname (cl-case msname (:server :host) ; auth-source uses :host (t msname))) ;; this is the mail-source default @@ -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 @@ -790,7 +792,7 @@ Deleting old (> %s day(s)) incoming mail file `%s'." diff bfile) (when (and (file-regular-p file) (funcall predicate file) (mail-source-movemail file mail-source-crash-box)) - (incf found (mail-source-callback callback file)) + (cl-incf found (mail-source-callback callback file)) (mail-source-run-script postscript (format-spec-make ?t path)) (mail-source-delete-crash-box))) found))) @@ -1045,7 +1047,7 @@ This only works when `display-time' is enabled." (insert "\001\001\001\001\n")) (delete-file file) nil)))) - (incf found (mail-source-callback callback file)) + (cl-incf found (mail-source-callback callback file)) (mail-source-delete-crash-box))))) found))) @@ -1120,7 +1122,7 @@ This only works when `display-time' is enabled." (replace-match ">From ")) (goto-char (point-max)))) (nnheader-ms-strip-cr)) - (incf found (mail-source-callback callback server)) + (cl-incf found (mail-source-callback callback server)) (mail-source-delete-crash-box) (when (and remove fetchflag) (setq remove (nreverse remove)) |