diff options
| author | Paul Eggert | 2018-09-23 18:30:46 -0700 |
|---|---|---|
| committer | Paul Eggert | 2018-09-23 18:32:59 -0700 |
| commit | 662bee7d70ccd3903e123b08c7ec9108a1a2ce0b (patch) | |
| tree | 416de288b7f995a05f620c5a6e72cb5a30168551 | |
| parent | c2dee17e19e1cf80c2263f8de276cceb0252b76d (diff) | |
| download | emacs-662bee7d70ccd3903e123b08c7ec9108a1a2ce0b.tar.gz emacs-662bee7d70ccd3903e123b08c7ec9108a1a2ce0b.zip | |
file-attributes cleanup
Mostly, this replaces magic-number calls like (nth 4 A) with
more-informative calls like (file-attribute-access-time A).
It also fixes some documentation and minor timestamp coding
issues that I noticed while looking into this.
* doc/lispref/files.texi (File Attributes):
* lisp/files.el (file-attribute-size)
(file-attribute-inode-number, file-attribute-device-number):
* src/dired.c (Fdirectory_files_and_attributes)
(Ffile_attributes):
Mention which attributes must be integers, or nonnegative integers,
as opposed to merely being numbers. Remove no-longer-correct
talk about representing large integers as conses of integers.
* doc/lispref/files.texi (Magic File Names):
* doc/misc/gnus.texi (Low-level interface to the spam-stat dictionary):
* lisp/autorevert.el (auto-revert-find-file-function)
(auto-revert-tail-mode, auto-revert-handler):
* lisp/auth-source.el (auth-source-netrc-parse):
* lisp/cedet/ede/files.el (ede--inode-for-dir):
* lisp/cedet/semantic/db-file.el (object-write):
* lisp/cedet/semantic/db-mode.el (semanticdb-kill-hook):
* lisp/cedet/semantic/db.el (semanticdb-needs-refresh-p)
(semanticdb-synchronize):
* lisp/cedet/srecode/table.el (srecode-mode-table-new):
* lisp/desktop.el (desktop-save, desktop-read):
* lisp/dired-aux.el (dired-file-set-difference)
(dired-do-chxxx, dired-do-chmod, dired-copy-file-recursive)
(dired-create-files):
* lisp/dired.el (dired-directory-changed-p, dired-readin):
* lisp/dos-w32.el (w32-direct-print-region-helper):
* lisp/emacs-lisp/autoload.el (autoload-generate-file-autoloads)
(autoload-find-destination, update-directory-autoloads):
* lisp/emacs-lisp/shadow.el (load-path-shadows-same-file-or-nonexistent):
* lisp/epg.el (epg--start, epg-wait-for-completion):
* lisp/eshell/em-ls.el (eshell-ls-filetype-p)
(eshell-ls-applicable, eshell-ls-size-string)
(eshell-ls-file, eshell-ls-dir, eshell-ls-files)
(eshell-ls-entries):
* lisp/eshell/em-pred.el (eshell-predicate-alist)
(eshell-pred-file-type, eshell-pred-file-links)
(eshell-pred-file-size):
* lisp/eshell/em-unix.el (eshell-shuffle-files, eshell/cat)
(eshell-du-sum-directory, eshell/du):
* lisp/eshell/esh-util.el (eshell-read-passwd)
(eshell-read-hosts):
* lisp/files.el (remote-file-name-inhibit-cache)
(find-file-noselect, insert-file-1, dir-locals-find-file)
(dir-locals-read-from-dir, backup-buffer)
(file-ownership-preserved-p, copy-directory)
(read-file-modes):
* lisp/find-lisp.el (find-lisp-format):
* lisp/gnus/gnus-agent.el (gnus-agent-unfetch-articles)
(gnus-agent-read-agentview, gnus-agent-expire-group-1)
(gnus-agent-request-article, gnus-agent-regenerate-group)
(gnus-agent-update-files-total-fetched-for)
(gnus-agent-update-view-total-fetched-for):
* lisp/gnus/gnus-cache.el (gnus-cache-read-active)
(gnus-cache-update-file-total-fetched-for)
(gnus-cache-update-overview-total-fetched-for):
* lisp/gnus/gnus-cloud.el (gnus-cloud-file-new-p):
* lisp/gnus/gnus-score.el (gnus-score-score-files):
* lisp/gnus/gnus-start.el (gnus-save-newsrc-file)
(gnus-master-read-slave-newsrc):
* lisp/gnus/gnus-sum.el (gnus-summary-import-article):
* lisp/gnus/gnus-util.el (gnus-file-newer-than)
(gnus-cache-file-contents):
* lisp/gnus/mail-source.el (mail-source-delete-old-incoming)
(mail-source-callback, mail-source-movemail):
* lisp/gnus/nneething.el (nneething-create-mapping)
(nneething-make-head):
* lisp/gnus/nnfolder.el (nnfolder-read-folder):
* lisp/gnus/nnheader.el (nnheader-file-size)
(nnheader-insert-nov-file):
* lisp/gnus/nnmail.el (nnmail-activate):
* lisp/gnus/nnmaildir.el (nnmaildir--group-maxnum)
(nnmaildir--new-number, nnmaildir--update-nov)
(nnmaildir--scan, nnmaildir-request-scan)
(nnmaildir-request-update-info)
(nnmaildir-request-expire-articles):
* lisp/gnus/nnmh.el (nnmh-request-list-1)
(nnmh-request-expire-articles, nnmh-update-gnus-unreads):
* lisp/gnus/nnml.el (nnml-request-expire-articles):
* lisp/gnus/spam-stat.el (spam-stat-save, spam-stat-load)
(spam-stat-process-directory, spam-stat-test-directory):
* lisp/ido.el (ido-directory-too-big-p)
(ido-file-name-all-completions):
* lisp/image-dired.el (image-dired-get-thumbnail-image)
(image-dired-create-thumb-1):
* lisp/info.el (info-insert-file-contents):
* lisp/ls-lisp.el (ls-lisp-insert-directory)
(ls-lisp-handle-switches, ls-lisp-classify-file)
(ls-lisp-format):
* lisp/mail/blessmail.el:
* lisp/mail/feedmail.el (feedmail-default-date-generator)
(feedmail-default-message-id-generator):
* lisp/mail/mailabbrev.el (mail-abbrevs-sync-aliases)
(mail-abbrevs-setup):
* lisp/mail/mspools.el (mspools-size-folder):
* lisp/mail/rmail.el (rmail-insert-inbox-text):
* lisp/mail/sendmail.el (sendmail-sync-aliases):
* lisp/mh-e/mh-alias.el (mh-alias-tstamp):
* lisp/net/ange-ftp.el (ange-ftp-parse-netrc)
(ange-ftp-write-region, ange-ftp-file-newer-than-file-p)
(ange-ftp-cf1):
* lisp/net/eudcb-mab.el (eudc-mab-query-internal):
* lisp/net/eww.el (eww-read-bookmarks):
* lisp/net/netrc.el (netrc-parse):
* lisp/net/newst-backend.el (newsticker--image-get):
* lisp/nxml/rng-loc.el (rng-get-parsed-schema-locating-file):
* lisp/obsolete/fast-lock.el (fast-lock-save-cache):
* lisp/obsolete/vc-arch.el (vc-arch-state)
(vc-arch-diff3-rej-p):
* lisp/org/ob-eval.el (org-babel--shell-command-on-region):
* lisp/org/org-attach.el (org-attach-commit):
* lisp/org/org-macro.el (org-macro-initialize-templates):
* lisp/org/org.el (org-babel-load-file)
(org-file-newer-than-p):
* lisp/org/ox-html.el (org-html-format-spec):
* lisp/org/ox-publish.el (org-publish-find-date)
(org-publish-cache-ctime-of-src):
* lisp/pcmpl-gnu.el (pcomplete/tar):
* lisp/pcmpl-rpm.el (pcmpl-rpm-packages):
* lisp/play/cookie1.el (cookie-snarf):
* lisp/progmodes/cmacexp.el (c-macro-expansion):
* lisp/ps-bdf.el (bdf-file-mod-time):
* lisp/server.el (server-ensure-safe-dir):
* lisp/simple.el (shell-command-on-region):
* lisp/speedbar.el (speedbar-item-info-file-helper)
(speedbar-check-obj-this-line):
* lisp/thumbs.el (thumbs-cleanup-thumbsdir):
* lisp/time.el (display-time-mail-check-directory)
(display-time-file-nonempty-p):
* lisp/url/url-cache.el (url-is-cached):
* lisp/url/url-file.el (url-file-asynch-callback):
* lisp/vc/diff-mode.el (diff-delete-if-empty):
* lisp/vc/pcvs-info.el (cvs-fileinfo-from-entries):
* lisp/vc/vc-bzr.el (vc-bzr-state-heuristic):
* lisp/vc/vc-cvs.el (vc-cvs-checkout-model)
(vc-cvs-state-heuristic, vc-cvs-merge-news)
(vc-cvs-retrieve-tag, vc-cvs-parse-status, vc-cvs-parse-entry):
* lisp/vc/vc-hg.el (vc-hg--slurp-hgignore-1)
(vc-hg--ignore-patterns-valid-p)
(vc-hg--cached-dirstate-search, vc-hg-state-fast):
* lisp/vc/vc-hooks.el (vc-after-save):
* lisp/vc/vc-rcs.el (vc-rcs-workfile-is-newer):
* lisp/vc/vc-svn.el (vc-svn-merge-news, vc-svn-parse-status):
* lisp/vc/vc.el (vc-checkout, vc-checkin, vc-revert-file):
* lisp/xdg.el (xdg-mime-apps):
Prefer (file-attribute-size A) to (nth 7 A), and similarly
for other file attributes accessors.
* doc/lispref/files.texi (File Attributes):
* doc/lispref/intro.texi (Version Info):
* doc/lispref/os.texi (Idle Timers):
* lisp/erc/erc.el (erc-string-to-emacs-time):
* lisp/files.el (file-attribute-access-time)
(file-attribute-modification-time)
(file-attribute-status-change-time):
* lisp/net/tramp-compat.el:
(tramp-compat-file-attribute-modification-time)
(tramp-compat-file-attribute-size):
* src/buffer.c (syms_of_buffer):
* src/editfns.c (Fget_internal_run_time):
* src/fileio.c (Fvisited_file_modtime)
(Fset_visited_file_modtime):
* src/keyboard.c (Fcurrent_idle_time):
* src/process.c (Fprocess_attributes):
Defer implementation details about timestamp format to the
section that talks about timestamp format, to make it easier
to change the documentation later if timestamp formats are
extended.
* lisp/gnus/gnus-util.el (gnus-file-newer-than):
* lisp/speedbar.el (speedbar-check-obj-this-line):
* lisp/vc/vc-rcs.el (vc-rcs-workfile-is-newer):
Prefer time-less-p to doing it by hand.
* lisp/ls-lisp.el (ls-lisp-format): Inode numbers are no longer conses.
* lisp/vc/vc-bzr.el (vc-bzr-state-heuristic):
Use eql, not eq, to compare integers that might be bignums.
* lisp/org/ox-publish.el (org-publish-cache-ctime-of-src):
Prefer float-time to doing time arithmetic by hand.
95 files changed, 544 insertions, 462 deletions
diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi index c50e358beb5..5682919b645 100644 --- a/doc/lispref/files.texi +++ b/doc/lispref/files.texi | |||
| @@ -1299,28 +1299,27 @@ Alternate names, also known as hard links, can be created by using the | |||
| 1299 | @item | 1299 | @item |
| 1300 | The file's @acronym{UID}, normally as a string | 1300 | The file's @acronym{UID}, normally as a string |
| 1301 | (@code{file-attribute-user-id}). However, if it does not correspond | 1301 | (@code{file-attribute-user-id}). However, if it does not correspond |
| 1302 | to a named user, the value is a number. | 1302 | to a named user, the value is an integer. |
| 1303 | 1303 | ||
| 1304 | @item | 1304 | @item |
| 1305 | The file's @acronym{GID}, likewise (@code{file-attribute-group-id}). | 1305 | The file's @acronym{GID}, likewise (@code{file-attribute-group-id}). |
| 1306 | 1306 | ||
| 1307 | @item | 1307 | @item |
| 1308 | The time of last access, as a list of four integers | 1308 | The time of last access as a Lisp timestamp |
| 1309 | @code{(@var{sec-high} @var{sec-low} @var{microsec} @var{picosec})} | 1309 | (@code{file-attribute-status-change-time}). The timestamp is in the |
| 1310 | (@code{file-attribute-access-time}). (This is similar to the value of | 1310 | style of @code{current-time} (@pxref{Time of Day}) and is truncated |
| 1311 | @code{current-time}; see @ref{Time of Day}.) The value is truncated | ||
| 1312 | to that of the filesystem's timestamp resolution; for example, on some | 1311 | to that of the filesystem's timestamp resolution; for example, on some |
| 1313 | FAT-based filesystems, only the date of last access is recorded, so | 1312 | FAT-based filesystems, only the date of last access is recorded, so |
| 1314 | this time will always hold the midnight of the day of the last access. | 1313 | this time will always hold the midnight of the day of the last access. |
| 1315 | 1314 | ||
| 1316 | @cindex modification time of file | 1315 | @cindex modification time of file |
| 1317 | @item | 1316 | @item |
| 1318 | The time of last modification as a list of four integers (as above) | 1317 | The time of last modification as a Lisp timestamp |
| 1319 | (@code{file-attribute-modification-time}). This is the last time when | 1318 | (@code{file-attribute-modification-time}). This is the last time when |
| 1320 | the file's contents were modified. | 1319 | the file's contents were modified. |
| 1321 | 1320 | ||
| 1322 | @item | 1321 | @item |
| 1323 | The time of last status change as a list of four integers (as above) | 1322 | The time of last status change as a Lisp timestamp |
| 1324 | (@code{file-attribute-status-change-time}). This is the time of the | 1323 | (@code{file-attribute-status-change-time}). This is the time of the |
| 1325 | last change to the file's access mode bits, its owner and group, and | 1324 | last change to the file's access mode bits, its owner and group, and |
| 1326 | other information recorded in the filesystem for the file, beyond the | 1325 | other information recorded in the filesystem for the file, beyond the |
| @@ -1337,11 +1336,12 @@ The file's modes, as a string of ten letters or dashes, as in | |||
| 1337 | An unspecified value, present for backward compatibility. | 1336 | An unspecified value, present for backward compatibility. |
| 1338 | 1337 | ||
| 1339 | @item | 1338 | @item |
| 1340 | The file's inode number (@code{file-attribute-inode-number}). | 1339 | The file's inode number (@code{file-attribute-inode-number}), |
| 1340 | a nonnegative integer. | ||
| 1341 | 1341 | ||
| 1342 | @item | 1342 | @item |
| 1343 | The filesystem number of the device that the file is on | 1343 | The filesystem number of the device that the file is on |
| 1344 | @code{file-attribute-device-number}). | 1344 | @code{file-attribute-device-number}), an integer. |
| 1345 | This element and the file's inode number | 1345 | This element and the file's inode number |
| 1346 | together give enough information to distinguish any two files on the | 1346 | together give enough information to distinguish any two files on the |
| 1347 | system---no two files can have the same values for both of these | 1347 | system---no two files can have the same values for both of these |
| @@ -2918,7 +2918,7 @@ are included. | |||
| 2918 | This is similar to @code{directory-files} in deciding which files | 2918 | This is similar to @code{directory-files} in deciding which files |
| 2919 | to report on and how to report their names. However, instead | 2919 | to report on and how to report their names. However, instead |
| 2920 | of returning a list of file names, it returns for each file a | 2920 | of returning a list of file names, it returns for each file a |
| 2921 | list @code{(@var{filename} @var{attributes})}, where @var{attributes} | 2921 | list @code{(@var{filename} . @var{attributes})}, where @var{attributes} |
| 2922 | is what @code{file-attributes} returns for that file. | 2922 | is what @code{file-attributes} returns for that file. |
| 2923 | The optional argument @var{id-format} has the same meaning as the | 2923 | The optional argument @var{id-format} has the same meaning as the |
| 2924 | corresponding argument to @code{file-attributes} (@pxref{Definition | 2924 | corresponding argument to @code{file-attributes} (@pxref{Definition |
| @@ -3410,8 +3410,9 @@ between consecutive checks. For example: | |||
| 3410 | (let ((remote-file-name-inhibit-cache | 3410 | (let ((remote-file-name-inhibit-cache |
| 3411 | (- display-time-interval 5))) | 3411 | (- display-time-interval 5))) |
| 3412 | (and (file-exists-p file) | 3412 | (and (file-exists-p file) |
| 3413 | (< 0 (nth 7 (file-attributes | 3413 | (< 0 (file-attribute-size |
| 3414 | (file-chase-links file))))))) | 3414 | (file-attributes |
| 3415 | (file-chase-links file))))))) | ||
| 3415 | @end example | 3416 | @end example |
| 3416 | @end defopt | 3417 | @end defopt |
| 3417 | 3418 | ||
diff --git a/doc/lispref/intro.texi b/doc/lispref/intro.texi index f421f3b3efb..197f54ecc52 100644 --- a/doc/lispref/intro.texi +++ b/doc/lispref/intro.texi | |||
| @@ -493,7 +493,7 @@ giving a prefix argument makes @var{here} non-@code{nil}. | |||
| 493 | 493 | ||
| 494 | @defvar emacs-build-time | 494 | @defvar emacs-build-time |
| 495 | The value of this variable indicates the time at which Emacs was | 495 | The value of this variable indicates the time at which Emacs was |
| 496 | built. It is a list of four integers, like the value of | 496 | built. It uses the style of |
| 497 | @code{current-time} (@pxref{Time of Day}), or is @code{nil} | 497 | @code{current-time} (@pxref{Time of Day}), or is @code{nil} |
| 498 | if the information is not available. | 498 | if the information is not available. |
| 499 | 499 | ||
diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi index 43ca9ede00b..8481fea8062 100644 --- a/doc/lispref/os.texi +++ b/doc/lispref/os.texi | |||
| @@ -1991,8 +1991,7 @@ the idleness time, as described below. | |||
| 1991 | 1991 | ||
| 1992 | @defun current-idle-time | 1992 | @defun current-idle-time |
| 1993 | If Emacs is idle, this function returns the length of time Emacs has | 1993 | If Emacs is idle, this function returns the length of time Emacs has |
| 1994 | been idle, as a list of four integers: @code{(@var{sec-high} | 1994 | been idle, using the same format as |
| 1995 | @var{sec-low} @var{microsec} @var{picosec})}, using the same format as | ||
| 1996 | @code{current-time} (@pxref{Time of Day}). | 1995 | @code{current-time} (@pxref{Time of Day}). |
| 1997 | 1996 | ||
| 1998 | When Emacs is not idle, @code{current-idle-time} returns @code{nil}. | 1997 | When Emacs is not idle, @code{current-idle-time} returns @code{nil}. |
diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index 6ccb9e55f31..40cc44a12e7 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi | |||
| @@ -25889,13 +25889,13 @@ Reset: (setq spam-stat (make-hash-table :test 'equal)) | |||
| 25889 | Learn spam: (spam-stat-process-spam-directory "~/Mail/mail/spam") | 25889 | Learn spam: (spam-stat-process-spam-directory "~/Mail/mail/spam") |
| 25890 | Learn non-spam: (spam-stat-process-non-spam-directory "~/Mail/mail/misc") | 25890 | Learn non-spam: (spam-stat-process-non-spam-directory "~/Mail/mail/misc") |
| 25891 | Save table: (spam-stat-save) | 25891 | Save table: (spam-stat-save) |
| 25892 | File size: (nth 7 (file-attributes spam-stat-file)) | 25892 | File size: (file-attribute-size (file-attributes spam-stat-file)) |
| 25893 | Number of words: (hash-table-count spam-stat) | 25893 | Number of words: (hash-table-count spam-stat) |
| 25894 | Test spam: (spam-stat-test-directory "~/Mail/mail/spam") | 25894 | Test spam: (spam-stat-test-directory "~/Mail/mail/spam") |
| 25895 | Test non-spam: (spam-stat-test-directory "~/Mail/mail/misc") | 25895 | Test non-spam: (spam-stat-test-directory "~/Mail/mail/misc") |
| 25896 | Reduce table size: (spam-stat-reduce-size) | 25896 | Reduce table size: (spam-stat-reduce-size) |
| 25897 | Save table: (spam-stat-save) | 25897 | Save table: (spam-stat-save) |
| 25898 | File size: (nth 7 (file-attributes spam-stat-file)) | 25898 | File size: (file-attribute-size (file-attributes spam-stat-file)) |
| 25899 | Number of words: (hash-table-count spam-stat) | 25899 | Number of words: (hash-table-count spam-stat) |
| 25900 | Test spam: (spam-stat-test-directory "~/Mail/mail/spam") | 25900 | Test spam: (spam-stat-test-directory "~/Mail/mail/spam") |
| 25901 | Test non-spam: (spam-stat-test-directory "~/Mail/mail/misc") | 25901 | Test non-spam: (spam-stat-test-directory "~/Mail/mail/misc") |
diff --git a/lisp/auth-source.el b/lisp/auth-source.el index 261e9726131..eb262a13df4 100644 --- a/lisp/auth-source.el +++ b/lisp/auth-source.el | |||
| @@ -956,7 +956,8 @@ Note that the MAX parameter is used so we can exit the parse early." | |||
| 956 | 956 | ||
| 957 | (if (and (functionp cached-secrets) | 957 | (if (and (functionp cached-secrets) |
| 958 | (equal cached-mtime | 958 | (equal cached-mtime |
| 959 | (nth 5 (file-attributes file)))) | 959 | (file-attribute-modification-time |
| 960 | (file-attributes file)))) | ||
| 960 | (progn | 961 | (progn |
| 961 | (auth-source-do-trivia | 962 | (auth-source-do-trivia |
| 962 | "auth-source-netrc-parse: using CACHED file data for %s" | 963 | "auth-source-netrc-parse: using CACHED file data for %s" |
| @@ -968,7 +969,8 @@ Note that the MAX parameter is used so we can exit the parse early." | |||
| 968 | ;; (note for the irony-impaired: they are just obfuscated) | 969 | ;; (note for the irony-impaired: they are just obfuscated) |
| 969 | (auth-source--aput | 970 | (auth-source--aput |
| 970 | auth-source-netrc-cache file | 971 | auth-source-netrc-cache file |
| 971 | (list :mtime (nth 5 (file-attributes file)) | 972 | (list :mtime (file-attribute-modification-time |
| 973 | (file-attributes file)) | ||
| 972 | :secret (let ((v (mapcar #'1+ (buffer-string)))) | 974 | :secret (let ((v (mapcar #'1+ (buffer-string)))) |
| 973 | (lambda () (apply #'string (mapcar #'1- v))))))) | 975 | (lambda () (apply #'string (mapcar #'1- v))))))) |
| 974 | (goto-char (point-min)) | 976 | (goto-char (point-min)) |
diff --git a/lisp/autorevert.el b/lisp/autorevert.el index c60fe010a3b..fc3469e03df 100644 --- a/lisp/autorevert.el +++ b/lisp/autorevert.el | |||
| @@ -321,7 +321,7 @@ the list of old buffers.") | |||
| 321 | 321 | ||
| 322 | (defun auto-revert-find-file-function () | 322 | (defun auto-revert-find-file-function () |
| 323 | (setq-local auto-revert-tail-pos | 323 | (setq-local auto-revert-tail-pos |
| 324 | (nth 7 (file-attributes buffer-file-name)))) | 324 | (file-attribute-size (file-attributes buffer-file-name)))) |
| 325 | 325 | ||
| 326 | (add-hook 'find-file-hook | 326 | (add-hook 'find-file-hook |
| 327 | #'auto-revert-find-file-function) | 327 | #'auto-revert-find-file-function) |
| @@ -434,7 +434,8 @@ Perform a full revert? ") | |||
| 434 | (add-hook 'before-save-hook (lambda () (auto-revert-tail-mode 0)) nil t) | 434 | (add-hook 'before-save-hook (lambda () (auto-revert-tail-mode 0)) nil t) |
| 435 | (or (local-variable-p 'auto-revert-tail-pos) ; don't lose prior position | 435 | (or (local-variable-p 'auto-revert-tail-pos) ; don't lose prior position |
| 436 | (setq-local auto-revert-tail-pos | 436 | (setq-local auto-revert-tail-pos |
| 437 | (nth 7 (file-attributes buffer-file-name)))) | 437 | (file-attribute-size |
| 438 | (file-attributes buffer-file-name)))) | ||
| 438 | ;; let auto-revert-mode set up the mechanism for us if it isn't already | 439 | ;; let auto-revert-mode set up the mechanism for us if it isn't already |
| 439 | (or auto-revert-mode | 440 | (or auto-revert-mode |
| 440 | (let ((auto-revert-tail-mode t)) | 441 | (let ((auto-revert-tail-mode t)) |
| @@ -656,8 +657,8 @@ This is an internal function used by Auto-Revert Mode." | |||
| 656 | (and (file-readable-p buffer-file-name) | 657 | (and (file-readable-p buffer-file-name) |
| 657 | (/= auto-revert-tail-pos | 658 | (/= auto-revert-tail-pos |
| 658 | (setq size | 659 | (setq size |
| 659 | (nth 7 (file-attributes | 660 | (file-attribute-size |
| 660 | buffer-file-name))))) | 661 | (file-attributes buffer-file-name))))) |
| 661 | (funcall (or buffer-stale-function | 662 | (funcall (or buffer-stale-function |
| 662 | #'buffer-stale--default-function) | 663 | #'buffer-stale--default-function) |
| 663 | t))) | 664 | t))) |
diff --git a/lisp/cedet/ede/files.el b/lisp/cedet/ede/files.el index c95402e365d..2c474814786 100644 --- a/lisp/cedet/ede/files.el +++ b/lisp/cedet/ede/files.el | |||
| @@ -113,7 +113,7 @@ of the anchor file for the project." | |||
| 113 | (if ede--disable-inode | 113 | (if ede--disable-inode |
| 114 | (ede--put-inode-dir-hash dir 0) | 114 | (ede--put-inode-dir-hash dir 0) |
| 115 | (let ((fattr (file-attributes dir))) | 115 | (let ((fattr (file-attributes dir))) |
| 116 | (ede--put-inode-dir-hash dir (nth 10 fattr)) | 116 | (ede--put-inode-dir-hash dir (file-attribute-inode-number fattr)) |
| 117 | ))))) | 117 | ))))) |
| 118 | 118 | ||
| 119 | (cl-defmethod ede--project-inode ((proj ede-project-placeholder)) | 119 | (cl-defmethod ede--project-inode ((proj ede-project-placeholder)) |
diff --git a/lisp/cedet/semantic/db-file.el b/lisp/cedet/semantic/db-file.el index 7035939c382..2d55c274cda 100644 --- a/lisp/cedet/semantic/db-file.el +++ b/lisp/cedet/semantic/db-file.el | |||
| @@ -307,8 +307,8 @@ Argument OBJ is the object to write." | |||
| 307 | ;; Make sure that the file size and other attributes are | 307 | ;; Make sure that the file size and other attributes are |
| 308 | ;; up to date. | 308 | ;; up to date. |
| 309 | (let ((fattr (file-attributes (semanticdb-full-filename obj)))) | 309 | (let ((fattr (file-attributes (semanticdb-full-filename obj)))) |
| 310 | (oset obj fsize (nth 7 fattr)) | 310 | (oset obj fsize (file-attribute-size fattr)) |
| 311 | (oset obj lastmodtime (nth 5 fattr)) | 311 | (oset obj lastmodtime (file-attribute-modification-time fattr)) |
| 312 | ) | 312 | ) |
| 313 | 313 | ||
| 314 | ;; Do it! | 314 | ;; Do it! |
diff --git a/lisp/cedet/semantic/db-mode.el b/lisp/cedet/semantic/db-mode.el index 638f2915f09..e61eb7183ad 100644 --- a/lisp/cedet/semantic/db-mode.el +++ b/lisp/cedet/semantic/db-mode.el | |||
| @@ -178,8 +178,9 @@ handle it later if need be." | |||
| 178 | (let ((fattr (file-attributes | 178 | (let ((fattr (file-attributes |
| 179 | (semanticdb-full-filename | 179 | (semanticdb-full-filename |
| 180 | semanticdb-current-table)))) | 180 | semanticdb-current-table)))) |
| 181 | (oset semanticdb-current-table fsize (nth 7 fattr)) | 181 | (oset semanticdb-current-table fsize (file-attribute-size fattr)) |
| 182 | (oset semanticdb-current-table lastmodtime (nth 5 fattr)) | 182 | (oset semanticdb-current-table lastmodtime |
| 183 | (file-attribute-modification-time fattr)) | ||
| 183 | (oset semanticdb-current-table buffer nil) | 184 | (oset semanticdb-current-table buffer nil) |
| 184 | )) | 185 | )) |
| 185 | ;; If this messes up, just clear the system | 186 | ;; If this messes up, just clear the system |
diff --git a/lisp/cedet/semantic/db.el b/lisp/cedet/semantic/db.el index 491752e4398..05484fccc0d 100644 --- a/lisp/cedet/semantic/db.el +++ b/lisp/cedet/semantic/db.el | |||
| @@ -611,8 +611,8 @@ The file associated with OBJ does not need to be in a buffer." | |||
| 611 | ;; Buffer isn't loaded. The only clue we have is if the file | 611 | ;; Buffer isn't loaded. The only clue we have is if the file |
| 612 | ;; is somehow different from our mark in the semanticdb table. | 612 | ;; is somehow different from our mark in the semanticdb table. |
| 613 | (let* ((stats (file-attributes ff)) | 613 | (let* ((stats (file-attributes ff)) |
| 614 | (actualsize (nth 7 stats)) | 614 | (actualsize (file-attribute-size stats)) |
| 615 | (actualmod (nth 5 stats)) | 615 | (actualmod (file-attribute-modification-time stats)) |
| 616 | ) | 616 | ) |
| 617 | 617 | ||
| 618 | (or (not (slot-boundp obj 'tags)) | 618 | (or (not (slot-boundp obj 'tags)) |
| @@ -631,8 +631,8 @@ The file associated with OBJ does not need to be in a buffer." | |||
| 631 | (oset table tags new-tags) | 631 | (oset table tags new-tags) |
| 632 | (oset table pointmax (point-max)) | 632 | (oset table pointmax (point-max)) |
| 633 | (let ((fattr (file-attributes (semanticdb-full-filename table)))) | 633 | (let ((fattr (file-attributes (semanticdb-full-filename table)))) |
| 634 | (oset table fsize (nth 7 fattr)) | 634 | (oset table fsize (file-attribute-size fattr)) |
| 635 | (oset table lastmodtime (nth 5 fattr)) | 635 | (oset table lastmodtime (file-attribute-modification-time fattr)) |
| 636 | ) | 636 | ) |
| 637 | ;; Assume it is now up to date. | 637 | ;; Assume it is now up to date. |
| 638 | (oset table unmatched-syntax semantic-unmatched-syntax-cache) | 638 | (oset table unmatched-syntax semantic-unmatched-syntax-cache) |
diff --git a/lisp/cedet/srecode/table.el b/lisp/cedet/srecode/table.el index ac968a6f9c4..af2e8b178aa 100644 --- a/lisp/cedet/srecode/table.el +++ b/lisp/cedet/srecode/table.el | |||
| @@ -187,8 +187,8 @@ INIT are the initialization parameters for the new template table." | |||
| 187 | (new (apply 'srecode-template-table | 187 | (new (apply 'srecode-template-table |
| 188 | (file-name-nondirectory file) | 188 | (file-name-nondirectory file) |
| 189 | :file file | 189 | :file file |
| 190 | :filesize (nth 7 attr) | 190 | :filesize (file-attribute-size attr) |
| 191 | :filedate (nth 5 attr) | 191 | :filedate (file-attribute-modification-time attr) |
| 192 | :major-mode mode | 192 | :major-mode mode |
| 193 | init | 193 | init |
| 194 | ))) | 194 | ))) |
diff --git a/lisp/desktop.el b/lisp/desktop.el index a9fa2873b3b..1346fa3241e 100644 --- a/lisp/desktop.el +++ b/lisp/desktop.el | |||
| @@ -1031,7 +1031,8 @@ without further confirmation." | |||
| 1031 | (setq desktop-dirname (file-name-as-directory (expand-file-name dirname))) | 1031 | (setq desktop-dirname (file-name-as-directory (expand-file-name dirname))) |
| 1032 | (save-excursion | 1032 | (save-excursion |
| 1033 | (let ((eager desktop-restore-eager) | 1033 | (let ((eager desktop-restore-eager) |
| 1034 | (new-modtime (nth 5 (file-attributes (desktop-full-file-name))))) | 1034 | (new-modtime (file-attribute-modification-time |
| 1035 | (file-attributes (desktop-full-file-name))))) | ||
| 1035 | (when | 1036 | (when |
| 1036 | (or (not new-modtime) ; nothing to overwrite | 1037 | (or (not new-modtime) ; nothing to overwrite |
| 1037 | (equal desktop-file-modtime new-modtime) | 1038 | (equal desktop-file-modtime new-modtime) |
| @@ -1134,7 +1135,9 @@ without further confirmation." | |||
| 1134 | (write-region (point-min) (point-max) (desktop-full-file-name) nil 'nomessage)) | 1135 | (write-region (point-min) (point-max) (desktop-full-file-name) nil 'nomessage)) |
| 1135 | (setq desktop-file-checksum checksum) | 1136 | (setq desktop-file-checksum checksum) |
| 1136 | ;; We remember when it was modified (which is presumably just now). | 1137 | ;; We remember when it was modified (which is presumably just now). |
| 1137 | (setq desktop-file-modtime (nth 5 (file-attributes (desktop-full-file-name))))))))))) | 1138 | (setq desktop-file-modtime (file-attribute-modification-time |
| 1139 | (file-attributes | ||
| 1140 | (desktop-full-file-name))))))))))) | ||
| 1138 | 1141 | ||
| 1139 | ;; ---------------------------------------------------------------------------- | 1142 | ;; ---------------------------------------------------------------------------- |
| 1140 | ;;;###autoload | 1143 | ;;;###autoload |
| @@ -1238,7 +1241,9 @@ Using it may cause conflicts. Use it anyway? " owner))))) | |||
| 1238 | 'window-configuration-change-hook))) | 1241 | 'window-configuration-change-hook))) |
| 1239 | (desktop-auto-save-disable) | 1242 | (desktop-auto-save-disable) |
| 1240 | ;; Evaluate desktop buffer and remember when it was modified. | 1243 | ;; Evaluate desktop buffer and remember when it was modified. |
| 1241 | (setq desktop-file-modtime (nth 5 (file-attributes (desktop-full-file-name)))) | 1244 | (setq desktop-file-modtime (file-attribute-modification-time |
| 1245 | (file-attributes | ||
| 1246 | (desktop-full-file-name)))) | ||
| 1242 | (load (desktop-full-file-name) t t t) | 1247 | (load (desktop-full-file-name) t t t) |
| 1243 | ;; If it wasn't already, mark it as in-use, to bother other | 1248 | ;; If it wasn't already, mark it as in-use, to bother other |
| 1244 | ;; desktop instances. | 1249 | ;; desktop instances. |
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index ce2ed13ad06..1f13204b7cf 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el | |||
| @@ -200,9 +200,12 @@ Examples of PREDICATE: | |||
| 200 | 200 | ||
| 201 | (> mtime1 mtime2) - mark newer files | 201 | (> mtime1 mtime2) - mark newer files |
| 202 | (not (= size1 size2)) - mark files with different sizes | 202 | (not (= size1 size2)) - mark files with different sizes |
| 203 | (not (string= (nth 8 fa1) (nth 8 fa2))) - mark files with different modes | 203 | (not (string= (file-attribute-modes fa1) - mark files with different modes |
| 204 | (not (and (= (nth 2 fa1) (nth 2 fa2)) - mark files with different UID | 204 | (file-attribute-modes fa2))) |
| 205 | (= (nth 3 fa1) (nth 3 fa2)))) and GID." | 205 | (not (and (= (file-attribute-user-id fa1) - mark files with different UID |
| 206 | (file-attribute-user-id fa2)) | ||
| 207 | (= (file-attribute-group-id fa1) - and GID. | ||
| 208 | (file-attribute-group-id fa2))))" | ||
| 206 | (interactive | 209 | (interactive |
| 207 | (list | 210 | (list |
| 208 | (let* ((target-dir (dired-dwim-target-directory)) | 211 | (let* ((target-dir (dired-dwim-target-directory)) |
| @@ -269,12 +272,12 @@ condition. Two file items are considered to match if they are equal | |||
| 269 | (eval predicate | 272 | (eval predicate |
| 270 | `((fa1 . ,fa1) | 273 | `((fa1 . ,fa1) |
| 271 | (fa2 . ,fa2) | 274 | (fa2 . ,fa2) |
| 272 | (size1 . ,(nth 7 fa1)) | 275 | (size1 . ,(file-attribute-size fa1)) |
| 273 | (size2 . ,(nth 7 fa2)) | 276 | (size2 . ,(file-attribute-size fa2)) |
| 274 | (mtime1 | 277 | (mtime1 |
| 275 | . ,(float-time (nth 5 fa1))) | 278 | . ,(float-time (file-attribute-modification-time fa1))) |
| 276 | (mtime2 | 279 | (mtime2 |
| 277 | . ,(float-time (nth 5 fa2))) | 280 | . ,(float-time (file-attribute-modification-time fa2))) |
| 278 | ))))) | 281 | ))))) |
| 279 | (setq list (cdr list))) | 282 | (setq list (cdr list))) |
| 280 | list) | 283 | list) |
| @@ -308,11 +311,14 @@ List has a form of (file-name full-file-name (attribute-list))." | |||
| 308 | (cond ((eq op-symbol 'touch) | 311 | (cond ((eq op-symbol 'touch) |
| 309 | (format-time-string | 312 | (format-time-string |
| 310 | "%Y%m%d%H%M.%S" | 313 | "%Y%m%d%H%M.%S" |
| 311 | (nth 5 (file-attributes default-file)))) | 314 | (file-attribute-modification-time |
| 315 | (file-attributes default-file)))) | ||
| 312 | ((eq op-symbol 'chown) | 316 | ((eq op-symbol 'chown) |
| 313 | (nth 2 (file-attributes default-file 'string))) | 317 | (file-attribute-user-id |
| 318 | (file-attributes default-file 'string))) | ||
| 314 | ((eq op-symbol 'chgrp) | 319 | ((eq op-symbol 'chgrp) |
| 315 | (nth 3 (file-attributes default-file 'string)))))) | 320 | (file-attribute-group-id |
| 321 | (file-attributes default-file 'string)))))) | ||
| 316 | (prompt (concat "Change " attribute-name " of %s to" | 322 | (prompt (concat "Change " attribute-name " of %s to" |
| 317 | (if (eq op-symbol 'touch) | 323 | (if (eq op-symbol 'touch) |
| 318 | " (default now): " | 324 | " (default now): " |
| @@ -365,7 +371,7 @@ into the minibuffer." | |||
| 365 | ;; The source of default file attributes is the file at point. | 371 | ;; The source of default file attributes is the file at point. |
| 366 | (default-file (dired-get-filename t t)) | 372 | (default-file (dired-get-filename t t)) |
| 367 | (modestr (when default-file | 373 | (modestr (when default-file |
| 368 | (nth 8 (file-attributes default-file)))) | 374 | (file-attribute-modes (file-attributes default-file)))) |
| 369 | (default | 375 | (default |
| 370 | (and (stringp modestr) | 376 | (and (stringp modestr) |
| 371 | (string-match "^.\\(...\\)\\(...\\)\\(...\\)$" modestr) | 377 | (string-match "^.\\(...\\)\\(...\\)\\(...\\)$" modestr) |
| @@ -1571,20 +1577,20 @@ If `ask', ask for user confirmation." | |||
| 1571 | 1577 | ||
| 1572 | (defun dired-copy-file-recursive (from to ok-flag &optional | 1578 | (defun dired-copy-file-recursive (from to ok-flag &optional |
| 1573 | preserve-time top recursive) | 1579 | preserve-time top recursive) |
| 1574 | (when (and (eq t (car (file-attributes from))) | 1580 | (when (and (eq t (file-attribute-type (file-attributes from))) |
| 1575 | (file-in-directory-p to from)) | 1581 | (file-in-directory-p to from)) |
| 1576 | (error "Cannot copy `%s' into its subdirectory `%s'" from to)) | 1582 | (error "Cannot copy `%s' into its subdirectory `%s'" from to)) |
| 1577 | (let ((attrs (file-attributes from))) | 1583 | (let ((attrs (file-attributes from))) |
| 1578 | (if (and recursive | 1584 | (if (and recursive |
| 1579 | (eq t (car attrs)) | 1585 | (eq t (file-attribute-type attrs)) |
| 1580 | (or (eq recursive 'always) | 1586 | (or (eq recursive 'always) |
| 1581 | (yes-or-no-p (format "Recursive copies of %s? " from)))) | 1587 | (yes-or-no-p (format "Recursive copies of %s? " from)))) |
| 1582 | (copy-directory from to preserve-time) | 1588 | (copy-directory from to preserve-time) |
| 1583 | (or top (dired-handle-overwrite to)) | 1589 | (or top (dired-handle-overwrite to)) |
| 1584 | (condition-case err | 1590 | (condition-case err |
| 1585 | (if (stringp (car attrs)) | 1591 | (if (stringp (file-attribute-type attrs)) |
| 1586 | ;; It is a symlink | 1592 | ;; It is a symlink |
| 1587 | (make-symbolic-link (car attrs) to ok-flag) | 1593 | (make-symbolic-link (file-attribute-type attrs) to ok-flag) |
| 1588 | (dired-maybe-create-dirs (file-name-directory to)) | 1594 | (dired-maybe-create-dirs (file-name-directory to)) |
| 1589 | (copy-file from to ok-flag preserve-time)) | 1595 | (copy-file from to ok-flag preserve-time)) |
| 1590 | (file-date-error | 1596 | (file-date-error |
| @@ -1765,7 +1771,7 @@ ESC or `q' to not overwrite any of the remaining files, | |||
| 1765 | (setq to destname)) | 1771 | (setq to destname)) |
| 1766 | ;; If DESTNAME is a subdirectory of FROM, not a symlink, | 1772 | ;; If DESTNAME is a subdirectory of FROM, not a symlink, |
| 1767 | ;; and the method in use is copying, signal an error. | 1773 | ;; and the method in use is copying, signal an error. |
| 1768 | (and (eq t (car (file-attributes destname))) | 1774 | (and (eq t (file-attribute-type (file-attributes destname))) |
| 1769 | (eq file-creator 'dired-copy-file) | 1775 | (eq file-creator 'dired-copy-file) |
| 1770 | (file-in-directory-p destname from) | 1776 | (file-in-directory-p destname from) |
| 1771 | (error "Cannot copy `%s' into its subdirectory `%s'" | 1777 | (error "Cannot copy `%s' into its subdirectory `%s'" |
diff --git a/lisp/dired.el b/lisp/dired.el index 0ed1a4f602d..5c7bb9599c5 100644 --- a/lisp/dired.el +++ b/lisp/dired.el | |||
| @@ -850,8 +850,8 @@ If DIRNAME is already in a Dired buffer, that buffer is used without refresh." | |||
| 850 | (not (let ((attributes (file-attributes dirname)) | 850 | (not (let ((attributes (file-attributes dirname)) |
| 851 | (modtime (visited-file-modtime))) | 851 | (modtime (visited-file-modtime))) |
| 852 | (or (eq modtime 0) | 852 | (or (eq modtime 0) |
| 853 | (not (eq (car attributes) t)) | 853 | (not (eq (file-attribute-type attributes) t)) |
| 854 | (equal (nth 5 attributes) modtime))))) | 854 | (equal (file-attribute-modification-time attributes) modtime))))) |
| 855 | 855 | ||
| 856 | (defvar auto-revert-remote-files) | 856 | (defvar auto-revert-remote-files) |
| 857 | 857 | ||
| @@ -1092,7 +1092,8 @@ wildcards, erases the buffer, and builds the subdir-alist anew | |||
| 1092 | (dired-build-subdir-alist) | 1092 | (dired-build-subdir-alist) |
| 1093 | (let ((attributes (file-attributes dirname))) | 1093 | (let ((attributes (file-attributes dirname))) |
| 1094 | (if (eq (car attributes) t) | 1094 | (if (eq (car attributes) t) |
| 1095 | (set-visited-file-modtime (nth 5 attributes)))) | 1095 | (set-visited-file-modtime (file-attribute-modification-time |
| 1096 | attributes)))) | ||
| 1096 | (set-buffer-modified-p nil) | 1097 | (set-buffer-modified-p nil) |
| 1097 | ;; No need to narrow since the whole buffer contains just | 1098 | ;; No need to narrow since the whole buffer contains just |
| 1098 | ;; dired-readin's output, nothing else. The hook can | 1099 | ;; dired-readin's output, nothing else. The hook can |
diff --git a/lisp/dos-w32.el b/lisp/dos-w32.el index a45a9d1026b..c19aa440165 100644 --- a/lisp/dos-w32.el +++ b/lisp/dos-w32.el | |||
| @@ -342,7 +342,7 @@ filesystem mounted on drive Z:, FILESYSTEM could be \"Z:\"." | |||
| 342 | w32-direct-print-region-use-command-dot-com | 342 | w32-direct-print-region-use-command-dot-com |
| 343 | ;; file-attributes fails on LPT ports on Windows 9x but | 343 | ;; file-attributes fails on LPT ports on Windows 9x but |
| 344 | ;; not on NT, so handle both cases for safety. | 344 | ;; not on NT, so handle both cases for safety. |
| 345 | (eq (or (nth 7 (file-attributes printer)) 0) 0)) | 345 | (eq (or (file-attribute-size (file-attributes printer)) 0) 0)) |
| 346 | (write-region start end tempfile nil 0) | 346 | (write-region start end tempfile nil 0) |
| 347 | (let ((w32-quote-process-args nil)) | 347 | (let ((w32-quote-process-args nil)) |
| 348 | (call-process "command.com" nil errbuf nil "/c" | 348 | (call-process "command.com" nil errbuf nil "/c" |
diff --git a/lisp/emacs-lisp/autoload.el b/lisp/emacs-lisp/autoload.el index efeb056204c..3d733519111 100644 --- a/lisp/emacs-lisp/autoload.el +++ b/lisp/emacs-lisp/autoload.el | |||
| @@ -813,7 +813,8 @@ FILE's modification time." | |||
| 813 | (marker-buffer other-output-start) | 813 | (marker-buffer other-output-start) |
| 814 | "actual autoloads are elsewhere" load-name relfile | 814 | "actual autoloads are elsewhere" load-name relfile |
| 815 | (if autoload-timestamps | 815 | (if autoload-timestamps |
| 816 | (nth 5 (file-attributes absfile)) | 816 | (file-attribute-modification-time |
| 817 | (file-attributes absfile)) | ||
| 817 | autoload--non-timestamp)) | 818 | autoload--non-timestamp)) |
| 818 | (insert ";;; Generated autoloads from " relfile "\n"))) | 819 | (insert ";;; Generated autoloads from " relfile "\n"))) |
| 819 | (insert generate-autoload-section-trailer))))))) | 820 | (insert generate-autoload-section-trailer))))))) |
| @@ -849,7 +850,8 @@ FILE's modification time." | |||
| 849 | ;; `emacs-internal' instead. | 850 | ;; `emacs-internal' instead. |
| 850 | nil nil 'emacs-mule-unix) | 851 | nil nil 'emacs-mule-unix) |
| 851 | (if autoload-timestamps | 852 | (if autoload-timestamps |
| 852 | (nth 5 (file-attributes relfile)) | 853 | (file-attribute-modification-time |
| 854 | (file-attributes relfile)) | ||
| 853 | autoload--non-timestamp))) | 855 | autoload--non-timestamp))) |
| 854 | (insert ";;; Generated autoloads from " relfile "\n"))) | 856 | (insert ";;; Generated autoloads from " relfile "\n"))) |
| 855 | (insert generate-autoload-section-trailer)))) | 857 | (insert generate-autoload-section-trailer)))) |
| @@ -862,7 +864,7 @@ FILE's modification time." | |||
| 862 | ;; If the entries were added to some other buffer, then the file | 864 | ;; If the entries were added to some other buffer, then the file |
| 863 | ;; doesn't add entries to OUTFILE. | 865 | ;; doesn't add entries to OUTFILE. |
| 864 | otherbuf)) | 866 | otherbuf)) |
| 865 | (nth 5 (file-attributes absfile)))) | 867 | (file-attribute-modification-time (file-attributes absfile)))) |
| 866 | (error | 868 | (error |
| 867 | ;; Probably unbalanced parens in forward-sexp. In that case, the | 869 | ;; Probably unbalanced parens in forward-sexp. In that case, the |
| 868 | ;; condition is scan-error, and the signal data includes point | 870 | ;; condition is scan-error, and the signal data includes point |
| @@ -943,7 +945,8 @@ removes any prior now out-of-date autoload entries." | |||
| 943 | (existing-buffer (if buffer-file-name buf)) | 945 | (existing-buffer (if buffer-file-name buf)) |
| 944 | (output-file (autoload-generated-file)) | 946 | (output-file (autoload-generated-file)) |
| 945 | (output-time (if (file-exists-p output-file) | 947 | (output-time (if (file-exists-p output-file) |
| 946 | (nth 5 (file-attributes output-file)))) | 948 | (file-attribute-modification-time |
| 949 | (file-attributes output-file)))) | ||
| 947 | (found nil)) | 950 | (found nil)) |
| 948 | (with-current-buffer (autoload-find-generated-file) | 951 | (with-current-buffer (autoload-find-generated-file) |
| 949 | ;; This is to make generated-autoload-file have Unix EOLs, so | 952 | ;; This is to make generated-autoload-file have Unix EOLs, so |
| @@ -965,7 +968,8 @@ removes any prior now out-of-date autoload entries." | |||
| 965 | ;; Check if it is up to date. | 968 | ;; Check if it is up to date. |
| 966 | (let ((begin (match-beginning 0)) | 969 | (let ((begin (match-beginning 0)) |
| 967 | (last-time (nth 4 form)) | 970 | (last-time (nth 4 form)) |
| 968 | (file-time (nth 5 (file-attributes file)))) | 971 | (file-time (file-attribute-modification-time |
| 972 | (file-attributes file)))) | ||
| 969 | (if (and (or (null existing-buffer) | 973 | (if (and (or (null existing-buffer) |
| 970 | (not (buffer-modified-p existing-buffer))) | 974 | (not (buffer-modified-p existing-buffer))) |
| 971 | (cond | 975 | (cond |
| @@ -1058,7 +1062,8 @@ write its autoloads into the specified file instead." | |||
| 1058 | generated-autoload-file)) | 1062 | generated-autoload-file)) |
| 1059 | (output-time | 1063 | (output-time |
| 1060 | (if (file-exists-p generated-autoload-file) | 1064 | (if (file-exists-p generated-autoload-file) |
| 1061 | (nth 5 (file-attributes generated-autoload-file))))) | 1065 | (file-attribute-modification-time |
| 1066 | (file-attributes generated-autoload-file))))) | ||
| 1062 | 1067 | ||
| 1063 | (with-current-buffer (autoload-find-generated-file) | 1068 | (with-current-buffer (autoload-find-generated-file) |
| 1064 | (save-excursion | 1069 | (save-excursion |
| @@ -1079,7 +1084,8 @@ write its autoloads into the specified file instead." | |||
| 1079 | (if (member last-time (list t autoload--non-timestamp)) | 1084 | (if (member last-time (list t autoload--non-timestamp)) |
| 1080 | (setq last-time output-time)) | 1085 | (setq last-time output-time)) |
| 1081 | (dolist (file file) | 1086 | (dolist (file file) |
| 1082 | (let ((file-time (nth 5 (file-attributes file)))) | 1087 | (let ((file-time (file-attribute-modification-time |
| 1088 | (file-attributes file)))) | ||
| 1083 | (when (and file-time | 1089 | (when (and file-time |
| 1084 | (not (time-less-p last-time file-time))) | 1090 | (not (time-less-p last-time file-time))) |
| 1085 | ;; file unchanged | 1091 | ;; file unchanged |
| @@ -1098,7 +1104,8 @@ write its autoloads into the specified file instead." | |||
| 1098 | t autoload--non-timestamp)) | 1104 | t autoload--non-timestamp)) |
| 1099 | output-time | 1105 | output-time |
| 1100 | oldtime)) | 1106 | oldtime)) |
| 1101 | (nth 5 (file-attributes file)))) | 1107 | (file-attribute-modification-time |
| 1108 | (file-attributes file)))) | ||
| 1102 | ;; File hasn't changed. | 1109 | ;; File hasn't changed. |
| 1103 | nil) | 1110 | nil) |
| 1104 | (t | 1111 | (t |
diff --git a/lisp/emacs-lisp/shadow.el b/lisp/emacs-lisp/shadow.el index 2e53382fa87..260ac3683dd 100644 --- a/lisp/emacs-lisp/shadow.el +++ b/lisp/emacs-lisp/shadow.el | |||
| @@ -161,8 +161,8 @@ See the documentation for `list-load-path-shadows' for further information." | |||
| 161 | (or (equal (file-truename f1) (file-truename f2)) | 161 | (or (equal (file-truename f1) (file-truename f2)) |
| 162 | ;; As a quick test, avoiding spawning a process, compare file | 162 | ;; As a quick test, avoiding spawning a process, compare file |
| 163 | ;; sizes. | 163 | ;; sizes. |
| 164 | (and (= (nth 7 (file-attributes f1)) | 164 | (and (= (file-attribute-size (file-attributes f1)) |
| 165 | (nth 7 (file-attributes f2))) | 165 | (file-attribute-size (file-attributes f2))) |
| 166 | (eq 0 (call-process "cmp" nil nil nil "-s" f1 f2)))))))) | 166 | (eq 0 (call-process "cmp" nil nil nil "-s" f1 f2)))))))) |
| 167 | 167 | ||
| 168 | (defvar load-path-shadows-font-lock-keywords | 168 | (defvar load-path-shadows-font-lock-keywords |
diff --git a/lisp/epg.el b/lisp/epg.el index f79f2046ded..8f26cd34ee4 100644 --- a/lisp/epg.el +++ b/lisp/epg.el | |||
| @@ -608,7 +608,9 @@ callback data (if any)." | |||
| 608 | ;; for more details. | 608 | ;; for more details. |
| 609 | (when (and agent-info (string-match "\\(.*\\):[0-9]+:[0-9]+" agent-info)) | 609 | (when (and agent-info (string-match "\\(.*\\):[0-9]+:[0-9]+" agent-info)) |
| 610 | (setq agent-file (match-string 1 agent-info) | 610 | (setq agent-file (match-string 1 agent-info) |
| 611 | agent-mtime (or (nth 5 (file-attributes agent-file)) '(0 0 0 0)))) | 611 | agent-mtime (or (file-attribute-modification-time |
| 612 | (file-attributes agent-file)) | ||
| 613 | '(0 0 0 0)))) | ||
| 612 | (if epg-debug | 614 | (if epg-debug |
| 613 | (save-excursion | 615 | (save-excursion |
| 614 | (unless epg-debug-buffer | 616 | (unless epg-debug-buffer |
| @@ -735,7 +737,9 @@ callback data (if any)." | |||
| 735 | (if (with-current-buffer (process-buffer (epg-context-process context)) | 737 | (if (with-current-buffer (process-buffer (epg-context-process context)) |
| 736 | (and epg-agent-file | 738 | (and epg-agent-file |
| 737 | (time-less-p epg-agent-mtime | 739 | (time-less-p epg-agent-mtime |
| 738 | (or (nth 5 (file-attributes epg-agent-file)) 0)))) | 740 | (or (file-attribute-modification-time |
| 741 | (file-attributes epg-agent-file)) | ||
| 742 | 0)))) | ||
| 739 | (redraw-frame)) | 743 | (redraw-frame)) |
| 740 | (epg-context-set-result-for | 744 | (epg-context-set-result-for |
| 741 | context 'error | 745 | context 'error |
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index fc510096419..a7e27424f29 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el | |||
| @@ -6040,8 +6040,7 @@ non-nil value is found. | |||
| 6040 | ;; time routines | 6040 | ;; time routines |
| 6041 | 6041 | ||
| 6042 | (defun erc-string-to-emacs-time (string) | 6042 | (defun erc-string-to-emacs-time (string) |
| 6043 | "Convert the long number represented by STRING into an Emacs format. | 6043 | "Convert the long number represented by STRING into an Emacs timestamp." |
| 6044 | Returns a list of the form (HIGH LOW), compatible with Emacs time format." | ||
| 6045 | (let* ((n (string-to-number (concat string ".0")))) | 6044 | (let* ((n (string-to-number (concat string ".0")))) |
| 6046 | (list (truncate (/ n 65536)) | 6045 | (list (truncate (/ n 65536)) |
| 6047 | (truncate (mod n 65536))))) | 6046 | (truncate (mod n 65536))))) |
diff --git a/lisp/eshell/em-ls.el b/lisp/eshell/em-ls.el index 2b568a991a2..53de7f7ec63 100644 --- a/lisp/eshell/em-ls.el +++ b/lisp/eshell/em-ls.el | |||
| @@ -183,9 +183,9 @@ really need to stick around for very long." | |||
| 183 | "The face used for highlighting junk file names.") | 183 | "The face used for highlighting junk file names.") |
| 184 | 184 | ||
| 185 | (defsubst eshell-ls-filetype-p (attrs type) | 185 | (defsubst eshell-ls-filetype-p (attrs type) |
| 186 | "Test whether ATTRS specifies a directory." | 186 | "Test whether ATTRS specifies a file of type TYPE." |
| 187 | (if (nth 8 attrs) | 187 | (if (file-attribute-modes attrs) |
| 188 | (eq (aref (nth 8 attrs) 0) type))) | 188 | (eq (aref (file-attribute-modes attrs) 0) type))) |
| 189 | 189 | ||
| 190 | (defmacro eshell-ls-applicable (attrs index func file) | 190 | (defmacro eshell-ls-applicable (attrs index func file) |
| 191 | "Test whether, for ATTRS, the user can do what corresponds to INDEX. | 191 | "Test whether, for ATTRS, the user can do what corresponds to INDEX. |
| @@ -193,8 +193,8 @@ ATTRS is a string of file modes. See `file-attributes'. | |||
| 193 | If we cannot determine the answer using ATTRS (e.g., if we need | 193 | If we cannot determine the answer using ATTRS (e.g., if we need |
| 194 | to know what group the user is in), compute the return value by | 194 | to know what group the user is in), compute the return value by |
| 195 | calling FUNC with FILE as an argument." | 195 | calling FUNC with FILE as an argument." |
| 196 | `(let ((owner (nth 2 ,attrs)) | 196 | `(let ((owner (file-attribute-user-id ,attrs)) |
| 197 | (modes (nth 8 ,attrs))) | 197 | (modes (file-attribute-modes ,attrs))) |
| 198 | (cond ((cond ((numberp owner) | 198 | (cond ((cond ((numberp owner) |
| 199 | (= owner (user-uid))) | 199 | (= owner (user-uid))) |
| 200 | ((stringp owner) | 200 | ((stringp owner) |
| @@ -437,7 +437,7 @@ Sort entries alphabetically across.") | |||
| 437 | 437 | ||
| 438 | (defsubst eshell-ls-size-string (attrs size-width) | 438 | (defsubst eshell-ls-size-string (attrs size-width) |
| 439 | "Return the size string for ATTRS length, using SIZE-WIDTH." | 439 | "Return the size string for ATTRS length, using SIZE-WIDTH." |
| 440 | (let* ((str (eshell-ls-printable-size (nth 7 attrs) t)) | 440 | (let* ((str (eshell-ls-printable-size (file-attribute-size attrs) t)) |
| 441 | (len (length str))) | 441 | (len (length str))) |
| 442 | (if (< len size-width) | 442 | (if (< len size-width) |
| 443 | (concat (make-string (- size-width len) ? ) str) | 443 | (concat (make-string (- size-width len) ? ) str) |
| @@ -503,19 +503,19 @@ whose cdr is the list of file attributes." | |||
| 503 | (if numeric-uid-gid | 503 | (if numeric-uid-gid |
| 504 | "%s%4d %-8s %-8s " | 504 | "%s%4d %-8s %-8s " |
| 505 | "%s%4d %-14s %-8s ") | 505 | "%s%4d %-14s %-8s ") |
| 506 | (or (nth 8 attrs) "??????????") | 506 | (or (file-attribute-modes attrs) "??????????") |
| 507 | (or (nth 1 attrs) 0) | 507 | (or (file-attribute-link-number attrs) 0) |
| 508 | (or (let ((user (nth 2 attrs))) | 508 | (or (let ((user (file-attribute-user-id attrs))) |
| 509 | (and (stringp user) | 509 | (and (stringp user) |
| 510 | (eshell-substring user 14))) | 510 | (eshell-substring user 14))) |
| 511 | (nth 2 attrs) | 511 | (file-attribute-user-id attrs) |
| 512 | "") | 512 | "") |
| 513 | (or (let ((group (nth 3 attrs))) | 513 | (or (let ((group (file-attribute-group-id attrs))) |
| 514 | (and (stringp group) | 514 | (and (stringp group) |
| 515 | (eshell-substring group 8))) | 515 | (eshell-substring group 8))) |
| 516 | (nth 3 attrs) | 516 | (file-attribute-group-id attrs) |
| 517 | "")) | 517 | "")) |
| 518 | (let* ((str (eshell-ls-printable-size (nth 7 attrs))) | 518 | (let* ((str (eshell-ls-printable-size (file-attribute-size attrs))) |
| 519 | (len (length str))) | 519 | (len (length str))) |
| 520 | ;; Let file sizes shorter than 9 align neatly. | 520 | ;; Let file sizes shorter than 9 align neatly. |
| 521 | (if (< len (or size-width 8)) | 521 | (if (< len (or size-width 8)) |
| @@ -585,12 +585,12 @@ relative to that directory." | |||
| 585 | (let ((total 0.0)) | 585 | (let ((total 0.0)) |
| 586 | (setq size-width 0) | 586 | (setq size-width 0) |
| 587 | (dolist (e entries) | 587 | (dolist (e entries) |
| 588 | (if (nth 7 (cdr e)) | 588 | (if (file-attribute-size (cdr e)) |
| 589 | (setq total (+ total (nth 7 (cdr e))) | 589 | (setq total (+ total (file-attribute-size (cdr e))) |
| 590 | size-width | 590 | size-width |
| 591 | (max size-width | 591 | (max size-width |
| 592 | (length (eshell-ls-printable-size | 592 | (length (eshell-ls-printable-size |
| 593 | (nth 7 (cdr e)) | 593 | (file-attribute-size (cdr e)) |
| 594 | (not | 594 | (not |
| 595 | ;; If we are under -l, count length | 595 | ;; If we are under -l, count length |
| 596 | ;; of sizes in bytes, not in blocks. | 596 | ;; of sizes in bytes, not in blocks. |
| @@ -700,7 +700,7 @@ Each member of FILES is either a string or a cons cell of the form | |||
| 700 | (if (not show-size) | 700 | (if (not show-size) |
| 701 | (setq display-files (mapcar 'eshell-ls-annotate files)) | 701 | (setq display-files (mapcar 'eshell-ls-annotate files)) |
| 702 | (dolist (file files) | 702 | (dolist (file files) |
| 703 | (let* ((str (eshell-ls-printable-size (nth 7 (cdr file)) t)) | 703 | (let* ((str (eshell-ls-printable-size (file-attribute-size (cdr file)) t)) |
| 704 | (len (length str))) | 704 | (len (length str))) |
| 705 | (if (< len size-width) | 705 | (if (< len size-width) |
| 706 | (setq str (concat (make-string (- size-width len) ? ) str))) | 706 | (setq str (concat (make-string (- size-width len) ? ) str))) |
| @@ -766,14 +766,14 @@ need to be printed." | |||
| 766 | (if show-size | 766 | (if show-size |
| 767 | (max size-width | 767 | (max size-width |
| 768 | (length (eshell-ls-printable-size | 768 | (length (eshell-ls-printable-size |
| 769 | (nth 7 (cdr entry)) t)))))) | 769 | (file-attribute-size (cdr entry)) t)))))) |
| 770 | (setq dirs (cons entry dirs))) | 770 | (setq dirs (cons entry dirs))) |
| 771 | (setq files (cons entry files) | 771 | (setq files (cons entry files) |
| 772 | size-width | 772 | size-width |
| 773 | (if show-size | 773 | (if show-size |
| 774 | (max size-width | 774 | (max size-width |
| 775 | (length (eshell-ls-printable-size | 775 | (length (eshell-ls-printable-size |
| 776 | (nth 7 (cdr entry)) t))))))) | 776 | (file-attribute-size (cdr entry)) t))))))) |
| 777 | (when files | 777 | (when files |
| 778 | (eshell-ls-files (eshell-ls-sort-entries files) | 778 | (eshell-ls-files (eshell-ls-sort-entries files) |
| 779 | size-width show-recursive) | 779 | size-width show-recursive) |
diff --git a/lisp/eshell/em-pred.el b/lisp/eshell/em-pred.el index b3b16d909ba..c3b942d25a7 100644 --- a/lisp/eshell/em-pred.el +++ b/lisp/eshell/em-pred.el | |||
| @@ -89,10 +89,12 @@ ordinary strings." | |||
| 89 | (?t . (eshell-pred-file-mode 1000)) ; sticky bit | 89 | (?t . (eshell-pred-file-mode 1000)) ; sticky bit |
| 90 | (?U . #'(lambda (file) ; owned by effective uid | 90 | (?U . #'(lambda (file) ; owned by effective uid |
| 91 | (if (file-exists-p file) | 91 | (if (file-exists-p file) |
| 92 | (= (nth 2 (file-attributes file)) (user-uid))))) | 92 | (= (file-attribute-user-id (file-attributes file)) |
| 93 | (user-uid))))) | ||
| 93 | ;; (?G . #'(lambda (file) ; owned by effective gid | 94 | ;; (?G . #'(lambda (file) ; owned by effective gid |
| 94 | ;; (if (file-exists-p file) | 95 | ;; (if (file-exists-p file) |
| 95 | ;; (= (nth 2 (file-attributes file)) (user-uid))))) | 96 | ;; (= (file-attribute-user-id (file-attributes file)) |
| 97 | ;; (user-uid))))) | ||
| 96 | (?* . #'(lambda (file) | 98 | (?* . #'(lambda (file) |
| 97 | (and (file-regular-p file) | 99 | (and (file-regular-p file) |
| 98 | (not (file-symlink-p file)) | 100 | (not (file-symlink-p file)) |
| @@ -460,7 +462,7 @@ that `ls -l' will show in the first column of its display. " | |||
| 460 | `(lambda (file) | 462 | `(lambda (file) |
| 461 | (let ((attrs (eshell-file-attributes (directory-file-name file)))) | 463 | (let ((attrs (eshell-file-attributes (directory-file-name file)))) |
| 462 | (if attrs | 464 | (if attrs |
| 463 | (memq (aref (nth 8 attrs) 0) | 465 | (memq (aref (file-attribute-modes attrs) 0) |
| 464 | ,(if (eq type ?%) | 466 | ,(if (eq type ?%) |
| 465 | '(?b ?c) | 467 | '(?b ?c) |
| 466 | (list 'quote (list type)))))))) | 468 | (list 'quote (list type)))))))) |
| @@ -489,7 +491,8 @@ that `ls -l' will show in the first column of its display. " | |||
| 489 | '< | 491 | '< |
| 490 | (if (eq qual ?+) | 492 | (if (eq qual ?+) |
| 491 | '> | 493 | '> |
| 492 | '=)) (nth 1 attrs) ,amount)))))) | 494 | '=)) |
| 495 | (file-attribute-link-number attrs) ,amount)))))) | ||
| 493 | 496 | ||
| 494 | (defun eshell-pred-file-size () | 497 | (defun eshell-pred-file-size () |
| 495 | "Return a predicate to test whether a file is of a given size." | 498 | "Return a predicate to test whether a file is of a given size." |
| @@ -518,7 +521,8 @@ that `ls -l' will show in the first column of its display. " | |||
| 518 | '< | 521 | '< |
| 519 | (if (eq qual ?+) | 522 | (if (eq qual ?+) |
| 520 | '> | 523 | '> |
| 521 | '=)) (nth 7 attrs) ,amount)))))) | 524 | '=)) |
| 525 | (file-attribute-size attrs) ,amount)))))) | ||
| 522 | 526 | ||
| 523 | (defun eshell-pred-substitute (&optional repeat) | 527 | (defun eshell-pred-substitute (&optional repeat) |
| 524 | "Return a modifier function that will substitute matches." | 528 | "Return a modifier function that will substitute matches." |
diff --git a/lisp/eshell/em-unix.el b/lisp/eshell/em-unix.el index 9a99c53571c..3aecebc2ebf 100644 --- a/lisp/eshell/em-unix.el +++ b/lisp/eshell/em-unix.el | |||
| @@ -370,12 +370,14 @@ Remove the DIRECTORY(ies), if they are empty.") | |||
| 370 | (or (not (eshell-under-windows-p)) | 370 | (or (not (eshell-under-windows-p)) |
| 371 | (eq system-type 'ms-dos)) | 371 | (eq system-type 'ms-dos)) |
| 372 | (setq attr (eshell-file-attributes (car files))) | 372 | (setq attr (eshell-file-attributes (car files))) |
| 373 | (nth 10 attr-target) (nth 10 attr) | 373 | (file-attribute-inode-number attr-target) |
| 374 | ;; Use equal, not -, since the inode and the device could | 374 | (file-attribute-inode-number attr) |
| 375 | ;; cons cells. | 375 | (equal (file-attribute-inode-number attr-target) |
| 376 | (equal (nth 10 attr-target) (nth 10 attr)) | 376 | (file-attribute-inode-number attr)) |
| 377 | (nth 11 attr-target) (nth 11 attr) | 377 | (file-attribute-device-number attr-target) |
| 378 | (equal (nth 11 attr-target) (nth 11 attr))) | 378 | (file-attribute-device-number attr) |
| 379 | (equal (file-attribute-device-number attr-target) | ||
| 380 | (file-attribute-device-number attr))) | ||
| 379 | (eshell-error (format-message "%s: `%s' and `%s' are the same file\n" | 381 | (eshell-error (format-message "%s: `%s' and `%s' are the same file\n" |
| 380 | command (car files) target))) | 382 | command (car files) target))) |
| 381 | (t | 383 | (t |
| @@ -397,16 +399,16 @@ Remove the DIRECTORY(ies), if they are empty.") | |||
| 397 | (let (eshell-warn-dot-directories) | 399 | (let (eshell-warn-dot-directories) |
| 398 | (if (and (not deep) | 400 | (if (and (not deep) |
| 399 | (eq func 'rename-file) | 401 | (eq func 'rename-file) |
| 400 | ;; Use equal, since the device might be a | 402 | (equal (file-attribute-device-number |
| 401 | ;; cons cell. | 403 | (eshell-file-attributes |
| 402 | (equal (nth 11 (eshell-file-attributes | 404 | (file-name-directory |
| 403 | (file-name-directory | 405 | (directory-file-name |
| 404 | (directory-file-name | 406 | (expand-file-name source))))) |
| 405 | (expand-file-name source))))) | 407 | (file-attribute-device-number |
| 406 | (nth 11 (eshell-file-attributes | 408 | (eshell-file-attributes |
| 407 | (file-name-directory | 409 | (file-name-directory |
| 408 | (directory-file-name | 410 | (directory-file-name |
| 409 | (expand-file-name target))))))) | 411 | (expand-file-name target))))))) |
| 410 | (apply 'eshell-funcalln func source target args) | 412 | (apply 'eshell-funcalln func source target args) |
| 411 | (unless (file-directory-p target) | 413 | (unless (file-directory-p target) |
| 412 | (if em-verbose | 414 | (if em-verbose |
| @@ -612,7 +614,8 @@ symlink, then revert to the system's definition of cat." | |||
| 612 | (> (length arg) 0) | 614 | (> (length arg) 0) |
| 613 | (eq (aref arg 0) ?-)) | 615 | (eq (aref arg 0) ?-)) |
| 614 | (let ((attrs (eshell-file-attributes arg))) | 616 | (let ((attrs (eshell-file-attributes arg))) |
| 615 | (and attrs (memq (aref (nth 8 attrs) 0) | 617 | (and attrs |
| 618 | (memq (aref (file-attribute-modes attrs) 0) | ||
| 616 | '(?d ?l ?-))))) | 619 | '(?d ?l ?-))))) |
| 617 | (throw 'special t))))) | 620 | (throw 'special t))))) |
| 618 | (let ((ext-cat (eshell-search-path "cat"))) | 621 | (let ((ext-cat (eshell-search-path "cat"))) |
| @@ -843,19 +846,19 @@ external command." | |||
| 843 | (unless (string-match "\\`\\.\\.?\\'" (caar entries)) | 846 | (unless (string-match "\\`\\.\\.?\\'" (caar entries)) |
| 844 | (let* ((entry (concat path "/" | 847 | (let* ((entry (concat path "/" |
| 845 | (caar entries))) | 848 | (caar entries))) |
| 846 | (symlink (and (stringp (cadr (car entries))) | 849 | (symlink (and (stringp (file-attribute-type (cdar entries))) |
| 847 | (cadr (car entries))))) | 850 | (file-attribute-type (cdar entries))))) |
| 848 | (unless (or (and symlink (not dereference-links)) | 851 | (unless (or (and symlink (not dereference-links)) |
| 849 | (and only-one-filesystem | 852 | (and only-one-filesystem |
| 850 | (/= only-one-filesystem | 853 | (/= only-one-filesystem |
| 851 | (nth 12 (car entries))))) | 854 | (file-attribute-device-number (cdar entries))))) |
| 852 | (if symlink | 855 | (if symlink |
| 853 | (setq entry symlink)) | 856 | (setq entry symlink)) |
| 854 | (setq size | 857 | (setq size |
| 855 | (+ size | 858 | (+ size |
| 856 | (if (eq t (cadr (car entries))) | 859 | (if (eq t (car (cdar entries))) |
| 857 | (eshell-du-sum-directory entry (1+ depth)) | 860 | (eshell-du-sum-directory entry (1+ depth)) |
| 858 | (let ((file-size (nth 8 (car entries)))) | 861 | (let ((file-size (file-attribute-size (cdar entries)))) |
| 859 | (prog1 | 862 | (prog1 |
| 860 | file-size | 863 | file-size |
| 861 | (if show-all | 864 | (if show-all |
| @@ -926,7 +929,7 @@ Summarize disk usage of each FILE, recursively for directories.") | |||
| 926 | (while args | 929 | (while args |
| 927 | (if only-one-filesystem | 930 | (if only-one-filesystem |
| 928 | (setq only-one-filesystem | 931 | (setq only-one-filesystem |
| 929 | (nth 11 (eshell-file-attributes | 932 | (file-attribute-device-number (eshell-file-attributes |
| 930 | (file-name-as-directory (car args)))))) | 933 | (file-name-as-directory (car args)))))) |
| 931 | (setq size (+ size (eshell-du-sum-directory | 934 | (setq size (+ size (eshell-du-sum-directory |
| 932 | (directory-file-name (car args)) 0))) | 935 | (directory-file-name (car args)) 0))) |
diff --git a/lisp/eshell/esh-util.el b/lisp/eshell/esh-util.el index 5ef1ae41297..8fe8c461fdb 100644 --- a/lisp/eshell/esh-util.el +++ b/lisp/eshell/esh-util.el | |||
| @@ -447,7 +447,7 @@ list." | |||
| 447 | (not (symbol-value timestamp-var)) | 447 | (not (symbol-value timestamp-var)) |
| 448 | (time-less-p | 448 | (time-less-p |
| 449 | (symbol-value timestamp-var) | 449 | (symbol-value timestamp-var) |
| 450 | (nth 5 (file-attributes file)))) | 450 | (file-attribute-modification-time (file-attributes file)))) |
| 451 | (progn | 451 | (progn |
| 452 | (set result-var (eshell-read-passwd-file file)) | 452 | (set result-var (eshell-read-passwd-file file)) |
| 453 | (set timestamp-var (current-time)))) | 453 | (set timestamp-var (current-time)))) |
| @@ -501,7 +501,7 @@ list." | |||
| 501 | (not (symbol-value timestamp-var)) | 501 | (not (symbol-value timestamp-var)) |
| 502 | (time-less-p | 502 | (time-less-p |
| 503 | (symbol-value timestamp-var) | 503 | (symbol-value timestamp-var) |
| 504 | (nth 5 (file-attributes file)))) | 504 | (file-attribute-modification-time (file-attributes file)))) |
| 505 | (progn | 505 | (progn |
| 506 | (set result-var (eshell-read-hosts-file file)) | 506 | (set result-var (eshell-read-hosts-file file)) |
| 507 | (set timestamp-var (current-time)))) | 507 | (set timestamp-var (current-time)))) |
diff --git a/lisp/files.el b/lisp/files.el index da4f2cd78fe..7efbf05b1a6 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -1152,7 +1152,8 @@ consecutive checks. For example: | |||
| 1152 | (defun display-time-file-nonempty-p (file) | 1152 | (defun display-time-file-nonempty-p (file) |
| 1153 | (let ((remote-file-name-inhibit-cache (- display-time-interval 5))) | 1153 | (let ((remote-file-name-inhibit-cache (- display-time-interval 5))) |
| 1154 | (and (file-exists-p file) | 1154 | (and (file-exists-p file) |
| 1155 | (< 0 (nth 7 (file-attributes (file-chase-links file)))))))" | 1155 | (< 0 (file-attribute-size |
| 1156 | (file-attributes (file-chase-links file)))))))" | ||
| 1156 | :group 'files | 1157 | :group 'files |
| 1157 | :version "24.1" | 1158 | :version "24.1" |
| 1158 | :type `(choice | 1159 | :type `(choice |
| @@ -2155,10 +2156,10 @@ the various files." | |||
| 2155 | ;; Check to see if the file looks uncommonly large. | 2156 | ;; Check to see if the file looks uncommonly large. |
| 2156 | (when (not (or buf nowarn)) | 2157 | (when (not (or buf nowarn)) |
| 2157 | (when (eq (abort-if-file-too-large | 2158 | (when (eq (abort-if-file-too-large |
| 2158 | (nth 7 attributes) "open" filename t) | 2159 | (file-attribute-size attributes) "open" filename t) |
| 2159 | 'raw) | 2160 | 'raw) |
| 2160 | (setf rawfile t)) | 2161 | (setf rawfile t)) |
| 2161 | (warn-maybe-out-of-memory (nth 7 attributes))) | 2162 | (warn-maybe-out-of-memory (file-attribute-size attributes))) |
| 2162 | (if buf | 2163 | (if buf |
| 2163 | ;; We are using an existing buffer. | 2164 | ;; We are using an existing buffer. |
| 2164 | (let (nonexistent) | 2165 | (let (nonexistent) |
| @@ -2372,7 +2373,8 @@ This function ensures that none of these modifications will take place." | |||
| 2372 | (signal 'file-error (list "Opening input file" "Is a directory" | 2373 | (signal 'file-error (list "Opening input file" "Is a directory" |
| 2373 | filename))) | 2374 | filename))) |
| 2374 | ;; Check whether the file is uncommonly large | 2375 | ;; Check whether the file is uncommonly large |
| 2375 | (abort-if-file-too-large (nth 7 (file-attributes filename)) "insert" filename) | 2376 | (abort-if-file-too-large (file-attribute-size (file-attributes filename)) |
| 2377 | "insert" filename) | ||
| 2376 | (let* ((buffer (find-buffer-visiting (abbreviate-file-name (file-truename filename)) | 2378 | (let* ((buffer (find-buffer-visiting (abbreviate-file-name (file-truename filename)) |
| 2377 | #'buffer-modified-p)) | 2379 | #'buffer-modified-p)) |
| 2378 | (tem (funcall insert-func filename))) | 2380 | (tem (funcall insert-func filename))) |
| @@ -3856,8 +3858,8 @@ Each element in this list has the form (DIR CLASS MTIME). | |||
| 3856 | DIR is the name of the directory. | 3858 | DIR is the name of the directory. |
| 3857 | CLASS is the name of a variable class (a symbol). | 3859 | CLASS is the name of a variable class (a symbol). |
| 3858 | MTIME is the recorded modification time of the directory-local | 3860 | MTIME is the recorded modification time of the directory-local |
| 3859 | variables file associated with this entry. This time is a list | 3861 | variables file associated with this entry. This time is a Lisp |
| 3860 | of integers (the same format as `file-attributes'), and is | 3862 | timestamp (the same format as `current-time'), and is |
| 3861 | used to test whether the cache entry is still valid. | 3863 | used to test whether the cache entry is still valid. |
| 3862 | Alternatively, MTIME can be nil, which means the entry is always | 3864 | Alternatively, MTIME can be nil, which means the entry is always |
| 3863 | considered valid.") | 3865 | considered valid.") |
| @@ -4061,7 +4063,9 @@ This function returns either: | |||
| 4061 | (equal (nth 2 dir-elt) | 4063 | (equal (nth 2 dir-elt) |
| 4062 | (let ((latest 0)) | 4064 | (let ((latest 0)) |
| 4063 | (dolist (f cached-files latest) | 4065 | (dolist (f cached-files latest) |
| 4064 | (let ((f-time (nth 5 (file-attributes f)))) | 4066 | (let ((f-time |
| 4067 | (file-attribute-modification-time | ||
| 4068 | (file-attributes f)))) | ||
| 4065 | (if (time-less-p latest f-time) | 4069 | (if (time-less-p latest f-time) |
| 4066 | (setq latest f-time))))))))) | 4070 | (setq latest f-time))))))))) |
| 4067 | ;; This cache entry is OK. | 4071 | ;; This cache entry is OK. |
| @@ -4093,7 +4097,8 @@ Return the new class name, which is a symbol named DIR." | |||
| 4093 | (variables)) | 4097 | (variables)) |
| 4094 | (with-demoted-errors "Error reading dir-locals: %S" | 4098 | (with-demoted-errors "Error reading dir-locals: %S" |
| 4095 | (dolist (file files) | 4099 | (dolist (file files) |
| 4096 | (let ((file-time (nth 5 (file-attributes file)))) | 4100 | (let ((file-time (file-attribute-modification-time |
| 4101 | (file-attributes file)))) | ||
| 4097 | (if (time-less-p latest file-time) | 4102 | (if (time-less-p latest file-time) |
| 4098 | (setq latest file-time))) | 4103 | (setq latest file-time))) |
| 4099 | (with-temp-buffer | 4104 | (with-temp-buffer |
| @@ -4445,7 +4450,7 @@ BACKUPNAME is the backup file name, which is the old file renamed." | |||
| 4445 | (let ((attr (file-attributes | 4450 | (let ((attr (file-attributes |
| 4446 | real-file-name | 4451 | real-file-name |
| 4447 | 'integer))) | 4452 | 'integer))) |
| 4448 | (<= (nth 2 attr) | 4453 | (<= (file-attribute-user-id attr) |
| 4449 | copy-when-priv-mismatch)))) | 4454 | copy-when-priv-mismatch)))) |
| 4450 | (not (file-ownership-preserved-p real-file-name | 4455 | (not (file-ownership-preserved-p real-file-name |
| 4451 | t))))) | 4456 | t))))) |
| @@ -4537,32 +4542,36 @@ the group would be preserved too." | |||
| 4537 | ;; Return t if the file doesn't exist, since it's true that no | 4542 | ;; Return t if the file doesn't exist, since it's true that no |
| 4538 | ;; information would be lost by an (attempted) delete and create. | 4543 | ;; information would be lost by an (attempted) delete and create. |
| 4539 | (or (null attributes) | 4544 | (or (null attributes) |
| 4540 | (and (or (= (nth 2 attributes) (user-uid)) | 4545 | (and (or (= (file-attribute-user-id attributes) (user-uid)) |
| 4541 | ;; Files created on Windows by Administrator (RID=500) | 4546 | ;; Files created on Windows by Administrator (RID=500) |
| 4542 | ;; have the Administrators group (RID=544) recorded as | 4547 | ;; have the Administrators group (RID=544) recorded as |
| 4543 | ;; their owner. Rewriting them will still preserve the | 4548 | ;; their owner. Rewriting them will still preserve the |
| 4544 | ;; owner. | 4549 | ;; owner. |
| 4545 | (and (eq system-type 'windows-nt) | 4550 | (and (eq system-type 'windows-nt) |
| 4546 | (= (user-uid) 500) (= (nth 2 attributes) 544))) | 4551 | (= (user-uid) 500) |
| 4552 | (= (file-attribute-user-id attributes) 544))) | ||
| 4547 | (or (not group) | 4553 | (or (not group) |
| 4548 | ;; On BSD-derived systems files always inherit the parent | 4554 | ;; On BSD-derived systems files always inherit the parent |
| 4549 | ;; directory's group, so skip the group-gid test. | 4555 | ;; directory's group, so skip the group-gid test. |
| 4550 | (memq system-type '(berkeley-unix darwin gnu/kfreebsd)) | 4556 | (memq system-type '(berkeley-unix darwin gnu/kfreebsd)) |
| 4551 | (= (nth 3 attributes) (group-gid))) | 4557 | (= (file-attribute-group-id attributes) (group-gid))) |
| 4552 | (let* ((parent (or (file-name-directory file) ".")) | 4558 | (let* ((parent (or (file-name-directory file) ".")) |
| 4553 | (parent-attributes (file-attributes parent 'integer))) | 4559 | (parent-attributes (file-attributes parent 'integer))) |
| 4554 | (and parent-attributes | 4560 | (and parent-attributes |
| 4555 | ;; On some systems, a file created in a setuid directory | 4561 | ;; On some systems, a file created in a setuid directory |
| 4556 | ;; inherits that directory's owner. | 4562 | ;; inherits that directory's owner. |
| 4557 | (or | 4563 | (or |
| 4558 | (= (nth 2 parent-attributes) (user-uid)) | 4564 | (= (file-attribute-user-id parent-attributes) |
| 4559 | (string-match "^...[^sS]" (nth 8 parent-attributes))) | 4565 | (user-uid)) |
| 4566 | (string-match | ||
| 4567 | "^...[^sS]" | ||
| 4568 | (file-attribute-modes parent-attributes))) | ||
| 4560 | ;; On many systems, a file created in a setgid directory | 4569 | ;; On many systems, a file created in a setgid directory |
| 4561 | ;; inherits that directory's group. On some systems | 4570 | ;; inherits that directory's group. On some systems |
| 4562 | ;; this happens even if the setgid bit is not set. | 4571 | ;; this happens even if the setgid bit is not set. |
| 4563 | (or (not group) | 4572 | (or (not group) |
| 4564 | (= (nth 3 parent-attributes) | 4573 | (= (file-attribute-group-id parent-attributes) |
| 4565 | (nth 3 attributes))))))))))) | 4574 | (file-attribute-group-id attributes))))))))))) |
| 4566 | 4575 | ||
| 4567 | (defun file-name-sans-extension (filename) | 4576 | (defun file-name-sans-extension (filename) |
| 4568 | "Return FILENAME sans final \"extension\". | 4577 | "Return FILENAME sans final \"extension\". |
| @@ -5722,7 +5731,8 @@ into NEWNAME instead." | |||
| 5722 | 5731 | ||
| 5723 | ;; Set directory attributes. | 5732 | ;; Set directory attributes. |
| 5724 | (let ((modes (file-modes directory)) | 5733 | (let ((modes (file-modes directory)) |
| 5725 | (times (and keep-time (nth 5 (file-attributes directory))))) | 5734 | (times (and keep-time (file-attribute-modification-time |
| 5735 | (file-attributes directory))))) | ||
| 5726 | (if modes (set-file-modes newname modes)) | 5736 | (if modes (set-file-modes newname modes)) |
| 5727 | (if times (set-file-times newname times)))))) | 5737 | (if times (set-file-times newname times)))))) |
| 5728 | 5738 | ||
| @@ -7328,7 +7338,7 @@ based on existing mode bits, as in \"og+rX-w\"." | |||
| 7328 | (let* ((modes (or (if orig-file (file-modes orig-file) 0) | 7338 | (let* ((modes (or (if orig-file (file-modes orig-file) 0) |
| 7329 | (error "File not found"))) | 7339 | (error "File not found"))) |
| 7330 | (modestr (and (stringp orig-file) | 7340 | (modestr (and (stringp orig-file) |
| 7331 | (nth 8 (file-attributes orig-file)))) | 7341 | (file-attribute-modes (file-attributes orig-file)))) |
| 7332 | (default | 7342 | (default |
| 7333 | (and (stringp modestr) | 7343 | (and (stringp modestr) |
| 7334 | (string-match "^.\\(...\\)\\(...\\)\\(...\\)$" modestr) | 7344 | (string-match "^.\\(...\\)\\(...\\)\\(...\\)$" modestr) |
| @@ -7508,27 +7518,24 @@ returned." | |||
| 7508 | 7518 | ||
| 7509 | (defsubst file-attribute-access-time (attributes) | 7519 | (defsubst file-attribute-access-time (attributes) |
| 7510 | "The last access time in ATTRIBUTES returned by `file-attributes'. | 7520 | "The last access time in ATTRIBUTES returned by `file-attributes'. |
| 7511 | This a list of integers (HIGH LOW USEC PSEC) in the same style | 7521 | This a Lisp timestamp in the style of `current-time'." |
| 7512 | as (current-time)." | ||
| 7513 | (nth 4 attributes)) | 7522 | (nth 4 attributes)) |
| 7514 | 7523 | ||
| 7515 | (defsubst file-attribute-modification-time (attributes) | 7524 | (defsubst file-attribute-modification-time (attributes) |
| 7516 | "The modification time in ATTRIBUTES returned by `file-attributes'. | 7525 | "The modification time in ATTRIBUTES returned by `file-attributes'. |
| 7517 | This is the time of the last change to the file's contents, and | 7526 | This is the time of the last change to the file's contents, and |
| 7518 | is a list of integers (HIGH LOW USEC PSEC) in the same style | 7527 | is a Lisp timestamp in the style of `current-time'." |
| 7519 | as (current-time)." | ||
| 7520 | (nth 5 attributes)) | 7528 | (nth 5 attributes)) |
| 7521 | 7529 | ||
| 7522 | (defsubst file-attribute-status-change-time (attributes) | 7530 | (defsubst file-attribute-status-change-time (attributes) |
| 7523 | "The status modification time in ATTRIBUTES returned by `file-attributes'. | 7531 | "The status modification time in ATTRIBUTES returned by `file-attributes'. |
| 7524 | This is the time of last change to the file's attributes: owner | 7532 | This is the time of last change to the file's attributes: owner |
| 7525 | and group, access mode bits, etc, and is a list of integers (HIGH | 7533 | and group, access mode bits, etc., and is a Lisp timestamp in the |
| 7526 | LOW USEC PSEC) in the same style as (current-time)." | 7534 | style of `current-time'." |
| 7527 | (nth 6 attributes)) | 7535 | (nth 6 attributes)) |
| 7528 | 7536 | ||
| 7529 | (defsubst file-attribute-size (attributes) | 7537 | (defsubst file-attribute-size (attributes) |
| 7530 | "The size (in bytes) in ATTRIBUTES returned by `file-attributes'. | 7538 | "The integer size (in bytes) in ATTRIBUTES returned by `file-attributes'." |
| 7531 | This is a floating point number if the size is too large for an integer." | ||
| 7532 | (nth 7 attributes)) | 7539 | (nth 7 attributes)) |
| 7533 | 7540 | ||
| 7534 | (defsubst file-attribute-modes (attributes) | 7541 | (defsubst file-attribute-modes (attributes) |
| @@ -7538,20 +7545,12 @@ This is a string of ten letters or dashes as in ls -l." | |||
| 7538 | 7545 | ||
| 7539 | (defsubst file-attribute-inode-number (attributes) | 7546 | (defsubst file-attribute-inode-number (attributes) |
| 7540 | "The inode number in ATTRIBUTES returned by `file-attributes'. | 7547 | "The inode number in ATTRIBUTES returned by `file-attributes'. |
| 7541 | If it is larger than what an Emacs integer can hold, this is of | 7548 | It is a nonnegative integer." |
| 7542 | the form (HIGH . LOW): first the high bits, then the low 16 bits. | ||
| 7543 | If even HIGH is too large for an Emacs integer, this is instead | ||
| 7544 | of the form (HIGH MIDDLE . LOW): first the high bits, then the | ||
| 7545 | middle 24 bits, and finally the low 16 bits." | ||
| 7546 | (nth 10 attributes)) | 7549 | (nth 10 attributes)) |
| 7547 | 7550 | ||
| 7548 | (defsubst file-attribute-device-number (attributes) | 7551 | (defsubst file-attribute-device-number (attributes) |
| 7549 | "The file system device number in ATTRIBUTES returned by `file-attributes'. | 7552 | "The file system device number in ATTRIBUTES returned by `file-attributes'. |
| 7550 | If it is larger than what an Emacs integer can hold, this is of | 7553 | It is an integer." |
| 7551 | the form (HIGH . LOW): first the high bits, then the low 16 bits. | ||
| 7552 | If even HIGH is too large for an Emacs integer, this is instead | ||
| 7553 | of the form (HIGH MIDDLE . LOW): first the high bits, then the | ||
| 7554 | middle 24 bits, and finally the low 16 bits." | ||
| 7555 | (nth 11 attributes)) | 7554 | (nth 11 attributes)) |
| 7556 | 7555 | ||
| 7557 | (defun file-attribute-collect (attributes &rest attr-names) | 7556 | (defun file-attribute-collect (attributes &rest attr-names) |
diff --git a/lisp/find-lisp.el b/lisp/find-lisp.el index 0070e590c36..a3e4511d72d 100644 --- a/lisp/find-lisp.el +++ b/lisp/find-lisp.el | |||
| @@ -300,24 +300,24 @@ It is a function which takes two arguments, the directory and its parent." | |||
| 300 | "Format one line of long ls output for file FILE-NAME. | 300 | "Format one line of long ls output for file FILE-NAME. |
| 301 | FILE-ATTR and FILE-SIZE give the file's attributes and size. | 301 | FILE-ATTR and FILE-SIZE give the file's attributes and size. |
| 302 | SWITCHES and TIME-INDEX give the full switch list and time data." | 302 | SWITCHES and TIME-INDEX give the full switch list and time data." |
| 303 | (let ((file-type (nth 0 file-attr))) | 303 | (let ((file-type (file-attribute-type file-attr))) |
| 304 | (concat (if (memq ?i switches) ; inode number | 304 | (concat (if (memq ?i switches) ; inode number |
| 305 | (format "%6d " (nth 10 file-attr))) | 305 | (format "%6d " (file-attribute-inode-number file-attr))) |
| 306 | ;; nil is treated like "" in concat | 306 | ;; nil is treated like "" in concat |
| 307 | (if (memq ?s switches) ; size in K | 307 | (if (memq ?s switches) ; size in K |
| 308 | (format "%4d " (1+ (/ (nth 7 file-attr) 1024)))) | 308 | (format "%4d " (1+ (/ (file-attribute-size file-attr) 1024)))) |
| 309 | (nth 8 file-attr) ; permission bits | 309 | (file-attribute-modes file-attr) |
| 310 | (format " %3d %-8s %-8s %8d " | 310 | (format " %3d %-8s %-8s %8d " |
| 311 | (nth 1 file-attr) ; no. of links | 311 | (file-attribute-link-number file-attr) |
| 312 | (if (numberp (nth 2 file-attr)) | 312 | (if (numberp (file-attribute-user-id file-attr)) |
| 313 | (int-to-string (nth 2 file-attr)) | 313 | (int-to-string (file-attribute-user-id file-attr)) |
| 314 | (nth 2 file-attr)) ; uid | 314 | (file-attribute-user-id file-attr)) |
| 315 | (if (eq system-type 'ms-dos) | 315 | (if (eq system-type 'ms-dos) |
| 316 | "root" ; everything is root on MSDOS. | 316 | "root" ; everything is root on MSDOS. |
| 317 | (if (numberp (nth 3 file-attr)) | 317 | (if (numberp (file-attribute-group-id file-attr)) |
| 318 | (int-to-string (nth 3 file-attr)) | 318 | (int-to-string (file-attribute-group-id file-attr)) |
| 319 | (nth 3 file-attr))) ; gid | 319 | (file-attribute-group-id file-attr))) |
| 320 | (nth 7 file-attr) ; size in bytes | 320 | (file-attribute-size file-attr) |
| 321 | ) | 321 | ) |
| 322 | (find-lisp-format-time file-attr switches now) | 322 | (find-lisp-format-time file-attr switches now) |
| 323 | " " | 323 | " " |
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." | |||
| 1603 | (number-to-string have-this))) | 1603 | (number-to-string have-this))) |
| 1604 | (size-file | 1604 | (size-file |
| 1605 | (float (or (and gnus-agent-total-fetched-hashtb | 1605 | (float (or (and gnus-agent-total-fetched-hashtb |
| 1606 | (nth 7 (file-attributes file-name))) | 1606 | (file-attribute-size |
| 1607 | (file-attributes file-name))) | ||
| 1607 | 0))) | 1608 | 0))) |
| 1608 | (file-name-coding-system | 1609 | (file-name-coding-system |
| 1609 | nnmail-pathname-coding-system)) | 1610 | nnmail-pathname-coding-system)) |
| @@ -2096,12 +2097,16 @@ doesn't exist, to valid the overview buffer." | |||
| 2096 | (let* (alist | 2097 | (let* (alist |
| 2097 | (file-name-coding-system nnmail-pathname-coding-system) | 2098 | (file-name-coding-system nnmail-pathname-coding-system) |
| 2098 | (file-attributes (directory-files-and-attributes | 2099 | (file-attributes (directory-files-and-attributes |
| 2099 | (gnus-agent-article-name "" | 2100 | (gnus-agent-article-name |
| 2100 | gnus-agent-read-agentview) nil "^[0-9]+$" t))) | 2101 | "" gnus-agent-read-agentview) |
| 2102 | nil "^[0-9]+$" t))) | ||
| 2101 | (while file-attributes | 2103 | (while file-attributes |
| 2102 | (let ((fa (pop file-attributes))) | 2104 | (let ((fa (pop file-attributes))) |
| 2103 | (unless (nth 1 fa) | 2105 | (unless (file-attribute-type (cdr fa)) |
| 2104 | (push (cons (string-to-number (nth 0 fa)) (time-to-days (nth 5 fa))) alist)))) | 2106 | (push (cons (string-to-number (car fa)) |
| 2107 | (time-to-days | ||
| 2108 | (file-attribute-access-time (cdr fa)))) | ||
| 2109 | alist)))) | ||
| 2105 | alist) | 2110 | alist) |
| 2106 | (file-error nil)))))) | 2111 | (file-error nil)))))) |
| 2107 | 2112 | ||
| @@ -3347,7 +3352,8 @@ missing NOV entry. Run gnus-agent-regenerate-group to restore it."))) | |||
| 3347 | (ignore-errors ; Just being paranoid. | 3352 | (ignore-errors ; Just being paranoid. |
| 3348 | (let* ((file-name (nnheader-concat dir (number-to-string | 3353 | (let* ((file-name (nnheader-concat dir (number-to-string |
| 3349 | article-number))) | 3354 | article-number))) |
| 3350 | (size (float (nth 7 (file-attributes file-name))))) | 3355 | (size (float (file-attribute-size |
| 3356 | (file-attributes file-name))))) | ||
| 3351 | (cl-incf bytes-freed size) | 3357 | (cl-incf bytes-freed size) |
| 3352 | (cl-incf size-files-deleted size) | 3358 | (cl-incf size-files-deleted size) |
| 3353 | (cl-incf files-deleted) | 3359 | (cl-incf files-deleted) |
| @@ -3800,7 +3806,7 @@ has been fetched." | |||
| 3800 | (buffer-read-only nil) | 3806 | (buffer-read-only nil) |
| 3801 | (file-name-coding-system nnmail-pathname-coding-system)) | 3807 | (file-name-coding-system nnmail-pathname-coding-system)) |
| 3802 | (when (and (file-exists-p file) | 3808 | (when (and (file-exists-p file) |
| 3803 | (> (nth 7 (file-attributes file)) 0)) | 3809 | (> (file-attribute-size (file-attributes file)) 0)) |
| 3804 | (erase-buffer) | 3810 | (erase-buffer) |
| 3805 | (gnus-kill-all-overlays) | 3811 | (gnus-kill-all-overlays) |
| 3806 | (let ((coding-system-for-read gnus-cache-coding-system)) | 3812 | (let ((coding-system-for-read gnus-cache-coding-system)) |
| @@ -3945,9 +3951,11 @@ If REREAD is not nil, downloaded articles are marked as unread." | |||
| 3945 | ;; This entry in the overview has been downloaded | 3951 | ;; This entry in the overview has been downloaded |
| 3946 | (push (cons (car downloaded) | 3952 | (push (cons (car downloaded) |
| 3947 | (time-to-days | 3953 | (time-to-days |
| 3948 | (nth 5 (file-attributes | 3954 | (file-attribute-modification-time |
| 3949 | (concat dir (number-to-string | 3955 | (file-attributes |
| 3950 | (car downloaded))))))) alist) | 3956 | (concat dir (number-to-string |
| 3957 | (car downloaded))))))) | ||
| 3958 | alist) | ||
| 3951 | (setq downloaded (cdr downloaded)) | 3959 | (setq downloaded (cdr downloaded)) |
| 3952 | (setq nov-arts (cdr nov-arts))) | 3960 | (setq nov-arts (cdr nov-arts))) |
| 3953 | (t | 3961 | (t |
| @@ -4105,19 +4113,21 @@ agent has fetched." | |||
| 4105 | (let ((sum 0.0) | 4113 | (let ((sum 0.0) |
| 4106 | file) | 4114 | file) |
| 4107 | (while (setq file (pop delta)) | 4115 | (while (setq file (pop delta)) |
| 4108 | (cl-incf sum (float (or (nth 7 (file-attributes | 4116 | (cl-incf sum (float (or (file-attribute-size |
| 4109 | (nnheader-concat | 4117 | (file-attributes |
| 4110 | path | 4118 | (nnheader-concat |
| 4111 | (if (numberp file) | 4119 | path |
| 4112 | (number-to-string file) | 4120 | (if (numberp file) |
| 4113 | file)))) 0)))) | 4121 | (number-to-string file) |
| 4122 | file)))) | ||
| 4123 | 0)))) | ||
| 4114 | (setq delta sum)) | 4124 | (setq delta sum)) |
| 4115 | (let ((sum (- (nth 2 entry))) | 4125 | (let ((sum (- (nth 2 entry))) |
| 4116 | (info (directory-files-and-attributes | 4126 | (info (directory-files-and-attributes |
| 4117 | path nil "^-?[0-9]+$" t)) | 4127 | path nil "^-?[0-9]+$" t)) |
| 4118 | file) | 4128 | file) |
| 4119 | (while (setq file (pop info)) | 4129 | (while (setq file (pop info)) |
| 4120 | (cl-incf sum (float (or (nth 8 file) 0)))) | 4130 | (cl-incf sum (float (or (file-attribute-size (cdr file)) 0)))) |
| 4121 | (setq delta sum)))) | 4131 | (setq delta sum)))) |
| 4122 | 4132 | ||
| 4123 | (setq gnus-agent-need-update-total-fetched-for t) | 4133 | (setq gnus-agent-need-update-total-fetched-for t) |
| @@ -4138,11 +4148,11 @@ modified." | |||
| 4138 | (gnus-sethash path (make-list 3 0) | 4148 | (gnus-sethash path (make-list 3 0) |
| 4139 | gnus-agent-total-fetched-hashtb))) | 4149 | gnus-agent-total-fetched-hashtb))) |
| 4140 | (file-name-coding-system nnmail-pathname-coding-system) | 4150 | (file-name-coding-system nnmail-pathname-coding-system) |
| 4141 | (size (or (nth 7 (file-attributes | 4151 | (size (or (file-attribute-size (file-attributes |
| 4142 | (nnheader-concat | 4152 | (nnheader-concat |
| 4143 | path (if agent-over | 4153 | path (if agent-over |
| 4144 | ".overview" | 4154 | ".overview" |
| 4145 | ".agentview")))) | 4155 | ".agentview")))) |
| 4146 | 0))) | 4156 | 0))) |
| 4147 | (setq gnus-agent-need-update-total-fetched-for t) | 4157 | (setq gnus-agent-need-update-total-fetched-for t) |
| 4148 | (setf (nth (if agent-over 1 0) entry) size))))) | 4158 | (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" | |||
| 642 | "Read the cache active file." | 642 | "Read the cache active file." |
| 643 | (gnus-make-directory gnus-cache-directory) | 643 | (gnus-make-directory gnus-cache-directory) |
| 644 | (if (or (not (file-exists-p gnus-cache-active-file)) | 644 | (if (or (not (file-exists-p gnus-cache-active-file)) |
| 645 | (zerop (nth 7 (file-attributes gnus-cache-active-file))) | 645 | (zerop (file-attribute-size |
| 646 | (file-attributes gnus-cache-active-file))) | ||
| 646 | force) | 647 | force) |
| 647 | ;; There is no active file, so we generate one. | 648 | ;; There is no active file, so we generate one. |
| 648 | (gnus-cache-generate-active) | 649 | (gnus-cache-generate-active) |
| @@ -854,7 +855,7 @@ supported." | |||
| 854 | size) | 855 | size) |
| 855 | 856 | ||
| 856 | (if file | 857 | (if file |
| 857 | (setq size (or (nth 7 (file-attributes file)) 0)) | 858 | (setq size (or (file-attribute-size (file-attributes file)) 0)) |
| 858 | (let* ((file-name-coding-system nnmail-pathname-coding-system) | 859 | (let* ((file-name-coding-system nnmail-pathname-coding-system) |
| 859 | (files (directory-files (gnus-cache-file-name group "") | 860 | (files (directory-files (gnus-cache-file-name group "") |
| 860 | t nil t)) | 861 | t nil t)) |
| @@ -862,8 +863,8 @@ supported." | |||
| 862 | (setq size 0.0) | 863 | (setq size 0.0) |
| 863 | (while (setq file (pop files)) | 864 | (while (setq file (pop files)) |
| 864 | (setq attrs (file-attributes file)) | 865 | (setq attrs (file-attributes file)) |
| 865 | (unless (nth 0 attrs) | 866 | (unless (file-attribute-type attrs) |
| 866 | (cl-incf size (float (nth 7 attrs))))))) | 867 | (cl-incf size (float (file-attribute-size attrs))))))) |
| 867 | 868 | ||
| 868 | (setq gnus-cache-need-update-total-fetched-for t) | 869 | (setq gnus-cache-need-update-total-fetched-for t) |
| 869 | 870 | ||
| @@ -877,7 +878,7 @@ supported." | |||
| 877 | (gnus-sethash group (make-list 2 0) | 878 | (gnus-sethash group (make-list 2 0) |
| 878 | gnus-cache-total-fetched-hashtb))) | 879 | gnus-cache-total-fetched-hashtb))) |
| 879 | (file-name-coding-system nnmail-pathname-coding-system) | 880 | (file-name-coding-system nnmail-pathname-coding-system) |
| 880 | (size (or (nth 7 (file-attributes | 881 | (size (or (file-attribute-size (file-attributes |
| 881 | (or file | 882 | (or file |
| 882 | (gnus-cache-file-name group ".overview")))) | 883 | (gnus-cache-file-name group ".overview")))) |
| 883 | 0))) | 884 | 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." | |||
| 339 | (format-time-string "%FT%T%z" time)) | 339 | (format-time-string "%FT%T%z" time)) |
| 340 | 340 | ||
| 341 | (defun gnus-cloud-file-new-p (file full) | 341 | (defun gnus-cloud-file-new-p (file full) |
| 342 | (let ((timestamp (gnus-cloud-timestamp (nth 5 (file-attributes file)))) | 342 | (let ((timestamp (gnus-cloud-timestamp (file-attribute-modification-time |
| 343 | (file-attributes file)))) | ||
| 343 | (old (cadr (assoc file gnus-cloud-file-timestamps)))) | 344 | (old (cadr (assoc file gnus-cloud-file-timestamps)))) |
| 344 | (when (or full | 345 | (when (or full |
| 345 | (null old) | 346 | (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.") | |||
| 2675 | (gnus-file-newer-than gnus-kill-files-directory | 2675 | (gnus-file-newer-than gnus-kill-files-directory |
| 2676 | (car gnus-score-file-list))) | 2676 | (car gnus-score-file-list))) |
| 2677 | (setq gnus-score-file-list | 2677 | (setq gnus-score-file-list |
| 2678 | (cons (nth 5 (file-attributes gnus-kill-files-directory)) | 2678 | (cons (file-attribute-modification-time |
| 2679 | (file-attributes gnus-kill-files-directory)) | ||
| 2679 | (nreverse | 2680 | (nreverse |
| 2680 | (directory-files | 2681 | (directory-files |
| 2681 | gnus-kill-files-directory t | 2682 | 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." | |||
| 2822 | ;; Check timestamp of `gnus-current-startup-file'.eld against | 2822 | ;; Check timestamp of `gnus-current-startup-file'.eld against |
| 2823 | ;; `gnus-save-newsrc-file-last-timestamp'. | 2823 | ;; `gnus-save-newsrc-file-last-timestamp'. |
| 2824 | (if (let* ((checkfile (concat gnus-current-startup-file ".eld")) | 2824 | (if (let* ((checkfile (concat gnus-current-startup-file ".eld")) |
| 2825 | (mtime (nth 5 (file-attributes checkfile)))) | 2825 | (mtime (file-attribute-modification-time |
| 2826 | (file-attributes checkfile)))) | ||
| 2826 | (and gnus-save-newsrc-file-last-timestamp | 2827 | (and gnus-save-newsrc-file-last-timestamp |
| 2827 | (time-less-p gnus-save-newsrc-file-last-timestamp | 2828 | (time-less-p gnus-save-newsrc-file-last-timestamp |
| 2828 | mtime) | 2829 | mtime) |
| @@ -2843,7 +2844,8 @@ If FORCE is non-nil, the .newsrc file is read." | |||
| 2843 | (gnus-run-hooks 'gnus-save-quick-newsrc-hook) | 2844 | (gnus-run-hooks 'gnus-save-quick-newsrc-hook) |
| 2844 | (save-buffer) | 2845 | (save-buffer) |
| 2845 | (setq gnus-save-newsrc-file-last-timestamp | 2846 | (setq gnus-save-newsrc-file-last-timestamp |
| 2846 | (nth 5 (file-attributes buffer-file-name)))) | 2847 | (file-attribute-modification-time |
| 2848 | (file-attributes buffer-file-name)))) | ||
| 2847 | (let ((coding-system-for-write gnus-ding-file-coding-system) | 2849 | (let ((coding-system-for-write gnus-ding-file-coding-system) |
| 2848 | (version-control gnus-backup-startup-file) | 2850 | (version-control gnus-backup-startup-file) |
| 2849 | (startup-file (concat gnus-current-startup-file ".eld")) | 2851 | (startup-file (concat gnus-current-startup-file ".eld")) |
| @@ -2880,7 +2882,8 @@ If FORCE is non-nil, the .newsrc file is read." | |||
| 2880 | (rename-file working-file startup-file t) | 2882 | (rename-file working-file startup-file t) |
| 2881 | (gnus-set-file-modes startup-file setmodes) | 2883 | (gnus-set-file-modes startup-file setmodes) |
| 2882 | (setq gnus-save-newsrc-file-last-timestamp | 2884 | (setq gnus-save-newsrc-file-last-timestamp |
| 2883 | (nth 5 (file-attributes startup-file))))) | 2885 | (file-attribute-modification-time |
| 2886 | (file-attributes startup-file))))) | ||
| 2884 | (condition-case nil | 2887 | (condition-case nil |
| 2885 | (delete-file working-file) | 2888 | (delete-file working-file) |
| 2886 | (file-error nil))))) | 2889 | (file-error nil))))) |
| @@ -3053,11 +3056,12 @@ If FORCE is non-nil, the .newsrc file is read." | |||
| 3053 | (with-current-buffer (gnus-get-buffer-create " *gnus slave*") | 3056 | (with-current-buffer (gnus-get-buffer-create " *gnus slave*") |
| 3054 | (setq slave-files | 3057 | (setq slave-files |
| 3055 | (sort (mapcar (lambda (file) | 3058 | (sort (mapcar (lambda (file) |
| 3056 | (list (nth 5 (file-attributes file)) file)) | 3059 | (list (file-attribute-modification-time |
| 3060 | (file-attributes file)) | ||
| 3061 | file)) | ||
| 3057 | slave-files) | 3062 | slave-files) |
| 3058 | (lambda (f1 f2) | 3063 | (lambda (f1 f2) |
| 3059 | (or (< (caar f1) (caar f2)) | 3064 | (time-less-p (car f1) (car f2))))) |
| 3060 | (< (nth 1 (car f1)) (nth 1 (car f2))))))) | ||
| 3061 | (while slave-files | 3065 | (while slave-files |
| 3062 | (erase-buffer) | 3066 | (erase-buffer) |
| 3063 | (setq file (nth 1 (car slave-files))) | 3067 | (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." | |||
| 10340 | (unless (re-search-forward "^date:" nil t) | 10340 | (unless (re-search-forward "^date:" nil t) |
| 10341 | (goto-char (point-max)) | 10341 | (goto-char (point-max)) |
| 10342 | (setq atts (file-attributes file)) | 10342 | (setq atts (file-attributes file)) |
| 10343 | (insert "Date: " (message-make-date (nth 5 atts)) "\n"))) | 10343 | (insert "Date: " (message-make-date |
| 10344 | (file-attribute-modification-time atts)) | ||
| 10345 | "\n"))) | ||
| 10344 | ;; This doesn't look like an article, so we fudge some headers. | 10346 | ;; This doesn't look like an article, so we fudge some headers. |
| 10345 | (setq atts (file-attributes file) | 10347 | (setq atts (file-attributes file) |
| 10346 | lines (count-lines (point-min) (point-max))) | 10348 | lines (count-lines (point-min) (point-max))) |
| 10347 | (insert "From: " (read-string "From: ") "\n" | 10349 | (insert "From: " (read-string "From: ") "\n" |
| 10348 | "Subject: " (read-string "Subject: ") "\n" | 10350 | "Subject: " (read-string "Subject: ") "\n" |
| 10349 | "Date: " (message-make-date (nth 5 atts)) "\n" | 10351 | "Date: " (message-make-date |
| 10352 | (file-attribute-modification-time atts)) "\n" | ||
| 10350 | "Message-ID: " (message-make-message-id) "\n" | 10353 | "Message-ID: " (message-make-message-id) "\n" |
| 10351 | "Lines: " (int-to-string lines) "\n" | 10354 | "Lines: " (int-to-string lines) "\n" |
| 10352 | "Chars: " (int-to-string (nth 7 atts)) "\n\n")) | 10355 | "Chars: " (int-to-string (file-attribute-size atts)) "\n\n")) |
| 10353 | (setq group-art (gnus-request-accept-article group nil t)) | 10356 | (setq group-art (gnus-request-accept-article group nil t)) |
| 10354 | (kill-buffer (current-buffer))) | 10357 | (kill-buffer (current-buffer))) |
| 10355 | (setq gnus-newsgroup-active (gnus-activate-group group)) | 10358 | (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." | |||
| 277 | ;;; Time functions. | 277 | ;;; Time functions. |
| 278 | 278 | ||
| 279 | (defun gnus-file-newer-than (file date) | 279 | (defun gnus-file-newer-than (file date) |
| 280 | (let ((fdate (nth 5 (file-attributes file)))) | 280 | (time-less-p date (file-attribute-modification-time (file-attributes file)))) |
| 281 | (or (> (car fdate) (car date)) | ||
| 282 | (and (= (car fdate) (car date)) | ||
| 283 | (> (nth 1 fdate) (nth 1 date)))))) | ||
| 284 | 281 | ||
| 285 | ;;; Keymap macros. | 282 | ;;; Keymap macros. |
| 286 | 283 | ||
| @@ -1434,7 +1431,7 @@ SPEC is a predicate specifier that contains stuff like `or', `and', | |||
| 1434 | 1431 | ||
| 1435 | (defun gnus-cache-file-contents (file variable function) | 1432 | (defun gnus-cache-file-contents (file variable function) |
| 1436 | "Cache the contents of FILE in VARIABLE. The contents come from FUNCTION." | 1433 | "Cache the contents of FILE in VARIABLE. The contents come from FUNCTION." |
| 1437 | (let ((time (nth 5 (file-attributes file))) | 1434 | (let ((time (file-attribute-modification-time (file-attributes file))) |
| 1438 | contents value) | 1435 | contents value) |
| 1439 | (if (or (null (setq value (symbol-value variable))) | 1436 | (if (or (null (setq value (symbol-value variable))) |
| 1440 | (not (equal (car value) file)) | 1437 | (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." | |||
| 602 | (let* ((ffile (car files)) | 602 | (let* ((ffile (car files)) |
| 603 | (bfile (replace-regexp-in-string "\\`.*/\\([^/]+\\)\\'" "\\1" | 603 | (bfile (replace-regexp-in-string "\\`.*/\\([^/]+\\)\\'" "\\1" |
| 604 | ffile)) | 604 | ffile)) |
| 605 | (filetime (nth 5 (file-attributes ffile)))) | 605 | (filetime (file-attribute-modification-time |
| 606 | (file-attributes ffile)))) | ||
| 606 | (setq files (cdr files)) | 607 | (setq files (cdr files)) |
| 607 | (when (and (> (time-to-number-of-days (time-subtract now filetime)) | 608 | (when (and (> (time-to-number-of-days (time-subtract now filetime)) |
| 608 | diff) | 609 | diff) |
| @@ -618,7 +619,8 @@ Deleting old (> %s day(s)) incoming mail file `%s'." diff bfile) | |||
| 618 | (defun mail-source-callback (callback info) | 619 | (defun mail-source-callback (callback info) |
| 619 | "Call CALLBACK on the mail file. Pass INFO on to CALLBACK." | 620 | "Call CALLBACK on the mail file. Pass INFO on to CALLBACK." |
| 620 | (if (or (not (file-exists-p mail-source-crash-box)) | 621 | (if (or (not (file-exists-p mail-source-crash-box)) |
| 621 | (zerop (nth 7 (file-attributes mail-source-crash-box)))) | 622 | (zerop (file-attribute-size |
| 623 | (file-attributes mail-source-crash-box)))) | ||
| 622 | (progn | 624 | (progn |
| 623 | (when (file-exists-p mail-source-crash-box) | 625 | (when (file-exists-p mail-source-crash-box) |
| 624 | (delete-file mail-source-crash-box)) | 626 | (delete-file mail-source-crash-box)) |
| @@ -670,7 +672,7 @@ Deleting old (> %s day(s)) incoming mail file `%s'." diff bfile) | |||
| 670 | ((not (file-exists-p from)) | 672 | ((not (file-exists-p from)) |
| 671 | ;; There is no inbox. | 673 | ;; There is no inbox. |
| 672 | (setq to nil)) | 674 | (setq to nil)) |
| 673 | ((zerop (nth 7 (file-attributes from))) | 675 | ((zerop (file-attribute-size (file-attributes from))) |
| 674 | ;; Empty file. | 676 | ;; Empty file. |
| 675 | (setq to nil)) | 677 | (setq to nil)) |
| 676 | (t | 678 | (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.") | |||
| 215 | (setq nneething-map | 215 | (setq nneething-map |
| 216 | (mapcar (lambda (n) | 216 | (mapcar (lambda (n) |
| 217 | (list (cdr n) (car n) | 217 | (list (cdr n) (car n) |
| 218 | (nth 5 (file-attributes | 218 | (file-attribute-modification-time |
| 219 | (nneething-file-name (car n)))))) | 219 | (file-attributes |
| 220 | (nneething-file-name (car n)))))) | ||
| 220 | nneething-map))) | 221 | nneething-map))) |
| 221 | ;; Remove files matching the exclusion regexp. | 222 | ;; Remove files matching the exclusion regexp. |
| 222 | (when nneething-exclude-files | 223 | (when nneething-exclude-files |
| @@ -244,7 +245,7 @@ included.") | |||
| 244 | (while map | 245 | (while map |
| 245 | (if (and (member (cadr (car map)) files) | 246 | (if (and (member (cadr (car map)) files) |
| 246 | ;; We also remove files that have changed mod times. | 247 | ;; We also remove files that have changed mod times. |
| 247 | (equal (nth 5 (file-attributes | 248 | (equal (file-attribute-modification-time (file-attributes |
| 248 | (nneething-file-name (cadr (car map))))) | 249 | (nneething-file-name (cadr (car map))))) |
| 249 | (cadr (cdar map)))) | 250 | (cadr (cdar map)))) |
| 250 | (progn | 251 | (progn |
| @@ -262,7 +263,7 @@ included.") | |||
| 262 | (setq touched t) | 263 | (setq touched t) |
| 263 | (setcdr nneething-active (1+ (cdr nneething-active))) | 264 | (setcdr nneething-active (1+ (cdr nneething-active))) |
| 264 | (push (list (cdr nneething-active) (car files) | 265 | (push (list (cdr nneething-active) (car files) |
| 265 | (nth 5 (file-attributes | 266 | (file-attribute-modification-time (file-attributes |
| 266 | (nneething-file-name (car files))))) | 267 | (nneething-file-name (car files))))) |
| 267 | nneething-map)) | 268 | nneething-map)) |
| 268 | (setq files (cdr files))) | 269 | (setq files (cdr files))) |
| @@ -318,15 +319,17 @@ included.") | |||
| 318 | "Subject: " (file-name-nondirectory file) (or extra-msg "") "\n" | 319 | "Subject: " (file-name-nondirectory file) (or extra-msg "") "\n" |
| 319 | "Message-ID: <nneething-" (nneething-encode-file-name file) | 320 | "Message-ID: <nneething-" (nneething-encode-file-name file) |
| 320 | "@" (system-name) ">\n" | 321 | "@" (system-name) ">\n" |
| 321 | (if (equal '(0 0) (nth 5 atts)) "" | 322 | (if (zerop (float-time (file-attribute-modification-time atts))) "" |
| 322 | (concat "Date: " (current-time-string (nth 5 atts)) "\n")) | 323 | (concat "Date: " |
| 324 | (current-time-string (file-attribute-modification-time atts)) | ||
| 325 | "\n")) | ||
| 323 | (or (when buffer | 326 | (or (when buffer |
| 324 | (with-current-buffer buffer | 327 | (with-current-buffer buffer |
| 325 | (when (re-search-forward "<[a-zA-Z0-9_]@[-a-zA-Z0-9_]>" 1000 t) | 328 | (when (re-search-forward "<[a-zA-Z0-9_]@[-a-zA-Z0-9_]>" 1000 t) |
| 326 | (concat "From: " (match-string 0) "\n")))) | 329 | (concat "From: " (match-string 0) "\n")))) |
| 327 | (nneething-from-line (nth 2 atts) file)) | 330 | (nneething-from-line (file-attribute-user-id atts) file)) |
| 328 | (if (> (string-to-number (int-to-string (nth 7 atts))) 0) | 331 | (if (> (file-attribute-size atts) 0) |
| 329 | (concat "Chars: " (int-to-string (nth 7 atts)) "\n") | 332 | (concat "Chars: " (int-to-string (file-attribute-size atts)) "\n") |
| 330 | "") | 333 | "") |
| 331 | (if buffer | 334 | (if buffer |
| 332 | (with-current-buffer buffer | 335 | (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." | |||
| 862 | (mm-enable-multibyte) ;; Use multibyte buffer for future copying. | 862 | (mm-enable-multibyte) ;; Use multibyte buffer for future copying. |
| 863 | (buffer-disable-undo) | 863 | (buffer-disable-undo) |
| 864 | (if (equal (cadr (assoc group nnfolder-scantime-alist)) | 864 | (if (equal (cadr (assoc group nnfolder-scantime-alist)) |
| 865 | (nth 5 (file-attributes file))) | 865 | (file-attribute-modification-time (file-attributes file))) |
| 866 | ;; This looks up-to-date, so we don't do any scanning. | 866 | ;; This looks up-to-date, so we don't do any scanning. |
| 867 | (if (file-exists-p file) | 867 | (if (file-exists-p file) |
| 868 | buffer | 868 | 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." | |||
| 896 | 896 | ||
| 897 | (defun nnheader-file-size (file) | 897 | (defun nnheader-file-size (file) |
| 898 | "Return the file size of FILE or 0." | 898 | "Return the file size of FILE or 0." |
| 899 | (or (nth 7 (file-attributes file)) 0)) | 899 | (or (file-attribute-size (file-attributes file)) 0)) |
| 900 | 900 | ||
| 901 | (defun nnheader-find-etc-directory (package &optional file first) | 901 | (defun nnheader-find-etc-directory (package &optional file first) |
| 902 | "Go through `load-path' and find the \"../etc/PACKAGE\" directory. | 902 | "Go through `load-path' and find the \"../etc/PACKAGE\" directory. |
| @@ -951,7 +951,7 @@ find-file-hook, etc. | |||
| 951 | (mm-insert-file-contents filename visit beg end replace))) | 951 | (mm-insert-file-contents filename visit beg end replace))) |
| 952 | 952 | ||
| 953 | (defun nnheader-insert-nov-file (file first) | 953 | (defun nnheader-insert-nov-file (file first) |
| 954 | (let ((size (nth 7 (file-attributes file))) | 954 | (let ((size (file-attribute-size (file-attributes file))) |
| 955 | (cutoff (* 32 1024))) | 955 | (cutoff (* 32 1024))) |
| 956 | (when size | 956 | (when size |
| 957 | (if (< size cutoff) | 957 | (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." | |||
| 1534 | (and (setq file (ignore-errors | 1534 | (and (setq file (ignore-errors |
| 1535 | (symbol-value (intern (format "%s-active-file" | 1535 | (symbol-value (intern (format "%s-active-file" |
| 1536 | backend))))) | 1536 | backend))))) |
| 1537 | (setq file-time (nth 5 (file-attributes file))) | 1537 | (setq file-time (file-attribute-modification-time |
| 1538 | (file-attributes file))) | ||
| 1538 | (or (not | 1539 | (or (not |
| 1539 | (setq timestamp | 1540 | (setq timestamp |
| 1540 | (condition-case () | 1541 | (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'.") | |||
| 318 | (setq attr (file-attributes | 318 | (setq attr (file-attributes |
| 319 | (concat dir (number-to-string number-opened)))) | 319 | (concat dir (number-to-string number-opened)))) |
| 320 | (or attr (throw 'return (1- number-opened))) | 320 | (or attr (throw 'return (1- number-opened))) |
| 321 | (setq ino-opened (nth 10 attr) | 321 | (setq ino-opened (file-attribute-inode-number attr) |
| 322 | nlink (nth 1 attr) | 322 | nlink (file-attribute-link-number attr) |
| 323 | number-linked (+ number-opened nlink)) | 323 | number-linked (+ number-opened nlink)) |
| 324 | (if (or (< nlink 1) (< number-linked nlink)) | 324 | (if (or (< nlink 1) (< number-linked nlink)) |
| 325 | (signal 'error '("Arithmetic overflow"))) | 325 | (signal 'error '("Arithmetic overflow"))) |
| 326 | (setq attr (file-attributes | 326 | (setq attr (file-attributes |
| 327 | (concat dir (number-to-string number-linked)))) | 327 | (concat dir (number-to-string number-linked)))) |
| 328 | (or attr (throw 'return (1- number-linked))) | 328 | (or attr (throw 'return (1- number-linked))) |
| 329 | (unless (equal ino-opened (nth 10 attr)) | 329 | (unless (equal ino-opened (file-attribute-inode-number attr)) |
| 330 | (setq number-opened number-linked)))))) | 330 | (setq number-opened number-linked)))))) |
| 331 | 331 | ||
| 332 | ;; Make the given server, if non-nil, be the current server. Then make the | 332 | ;; 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'.") | |||
| 392 | (setq make-new-file nil | 392 | (setq make-new-file nil |
| 393 | previous-number-link 0)) | 393 | previous-number-link 0)) |
| 394 | (let* ((attr (file-attributes path-open)) | 394 | (let* ((attr (file-attributes path-open)) |
| 395 | (nlink (nth 1 attr))) | 395 | (nlink (file-attribute-link-number attr))) |
| 396 | (setq ino-open (nth 10 attr) | 396 | (setq ino-open (file-attribute-inode-number attr) |
| 397 | number-link (+ number-open nlink)) | 397 | number-link (+ number-open nlink)) |
| 398 | (if (or (< nlink 1) (< number-link nlink)) | 398 | (if (or (< nlink 1) (< number-link nlink)) |
| 399 | (signal 'error '("Arithmetic overflow")))) | 399 | (signal 'error '("Arithmetic overflow")))) |
| @@ -412,7 +412,7 @@ This variable is set by `nnmaildir-request-article'.") | |||
| 412 | number-open number-link)) | 412 | number-open number-link)) |
| 413 | ((nnmaildir--eexist-p err) | 413 | ((nnmaildir--eexist-p err) |
| 414 | (let ((attr (file-attributes path-link))) | 414 | (let ((attr (file-attributes path-link))) |
| 415 | (unless (equal (nth 10 attr) ino-open) | 415 | (unless (equal (file-attribute-inode-number attr) ino-open) |
| 416 | (setq number-open number-link | 416 | (setq number-open number-link |
| 417 | number-link 0)))) | 417 | number-link 0)))) |
| 418 | (t (signal (car err) (cdr err))))))))) | 418 | (t (signal (car err) (cdr err))))))))) |
| @@ -437,8 +437,8 @@ This variable is set by `nnmaildir-request-article'.") | |||
| 437 | (unless attr | 437 | (unless attr |
| 438 | (nnmaildir--expired-article group article) | 438 | (nnmaildir--expired-article group article) |
| 439 | (throw 'return nil)) | 439 | (throw 'return nil)) |
| 440 | (setq mtime (nth 5 attr) | 440 | (setq mtime (file-attribute-modification-time attr) |
| 441 | attr (nth 7 attr) | 441 | attr (file-attribute-size attr) |
| 442 | nov (nnmaildir--art-nov article) | 442 | nov (nnmaildir--art-nov article) |
| 443 | dir (nnmaildir--nndir dir) | 443 | dir (nnmaildir--nndir dir) |
| 444 | novdir (nnmaildir--nov-dir dir) | 444 | novdir (nnmaildir--nov-dir dir) |
| @@ -794,29 +794,33 @@ This variable is set by `nnmaildir-request-article'.") | |||
| 794 | (setq read-only (nnmaildir--param pgname 'read-only) | 794 | (setq read-only (nnmaildir--param pgname 'read-only) |
| 795 | ls (or (nnmaildir--param pgname 'directory-files) srv-ls)) | 795 | ls (or (nnmaildir--param pgname 'directory-files) srv-ls)) |
| 796 | (unless read-only | 796 | (unless read-only |
| 797 | (setq x (nth 11 (file-attributes tdir))) | 797 | (setq x (file-attribute-device-number (file-attributes tdir))) |
| 798 | (unless (and (equal x (nth 11 nattr)) (equal x (nth 11 cattr))) | 798 | (unless (and (equal x (file-attribute-device-number nattr)) |
| 799 | (equal x (file-attribute-device-number cattr))) | ||
| 799 | (setf (nnmaildir--srv-error nnmaildir--cur-server) | 800 | (setf (nnmaildir--srv-error nnmaildir--cur-server) |
| 800 | (concat "Maildir spans filesystems: " absdir)) | 801 | (concat "Maildir spans filesystems: " absdir)) |
| 801 | (throw 'return nil)) | 802 | (throw 'return nil)) |
| 802 | (dolist (file (funcall ls tdir 'full "\\`[^.]" 'nosort)) | 803 | (dolist (file (funcall ls tdir 'full "\\`[^.]" 'nosort)) |
| 803 | (setq x (file-attributes file)) | 804 | (setq x (file-attributes file)) |
| 804 | (if (or (> (cadr x) 1) (time-less-p (nth 4 x) 36h-ago)) | 805 | (if (or (> (file-attribute-link-number x) 1) |
| 806 | (time-less-p (file-attribute-access-time x) 36h-ago)) | ||
| 805 | (delete-file file)))) | 807 | (delete-file file)))) |
| 806 | (or scan-msgs | 808 | (or scan-msgs |
| 807 | isnew | 809 | isnew |
| 808 | (throw 'return t)) | 810 | (throw 'return t)) |
| 809 | (setq nattr (nth 5 nattr)) | 811 | (setq nattr (file-attribute-modification-time nattr)) |
| 810 | (if (equal nattr (nnmaildir--grp-new group)) | 812 | (if (equal nattr (nnmaildir--grp-new group)) |
| 811 | (setq nattr nil)) | 813 | (setq nattr nil)) |
| 812 | (if read-only (setq dir (and (or isnew nattr) ndir)) | 814 | (if read-only (setq dir (and (or isnew nattr) ndir)) |
| 813 | (when (or isnew nattr) | 815 | (when (or isnew nattr) |
| 814 | (dolist (file (funcall ls ndir nil "\\`[^.]" 'nosort)) | 816 | (dolist (file (funcall ls ndir nil "\\`[^.]" 'nosort)) |
| 815 | (setq x (concat ndir file)) | 817 | (setq x (concat ndir file)) |
| 816 | (and (time-less-p (nth 5 (file-attributes x)) nil) | 818 | (and (time-less-p (file-attribute-modification-time |
| 819 | (file-attributes x)) | ||
| 820 | nil) | ||
| 817 | (rename-file x (concat cdir (nnmaildir--ensure-suffix file))))) | 821 | (rename-file x (concat cdir (nnmaildir--ensure-suffix file))))) |
| 818 | (setf (nnmaildir--grp-new group) nattr)) | 822 | (setf (nnmaildir--grp-new group) nattr)) |
| 819 | (setq cattr (nth 5 (file-attributes cdir))) | 823 | (setq cattr (file-attribute-modification-time (file-attributes cdir))) |
| 820 | (if (equal cattr (nnmaildir--grp-cur group)) | 824 | (if (equal cattr (nnmaildir--grp-cur group)) |
| 821 | (setq cattr nil)) | 825 | (setq cattr nil)) |
| 822 | (setq dir (and (or isnew cattr) cdir))) | 826 | (setq dir (and (or isnew cattr) cdir))) |
| @@ -903,7 +907,7 @@ This variable is set by `nnmaildir-request-article'.") | |||
| 903 | (if (nnmaildir--srv-gnm nnmaildir--cur-server) | 907 | (if (nnmaildir--srv-gnm nnmaildir--cur-server) |
| 904 | (nnmail-get-new-mail 'nnmaildir nil nil scan-group)) | 908 | (nnmail-get-new-mail 'nnmaildir nil nil scan-group)) |
| 905 | (unintern scan-group groups)) | 909 | (unintern scan-group groups)) |
| 906 | (setq x (nth 5 (file-attributes srv-dir)) | 910 | (setq x (file-attribute-modification-time (file-attributes srv-dir)) |
| 907 | scan-group (null scan-group)) | 911 | scan-group (null scan-group)) |
| 908 | (if (equal x (nnmaildir--srv-mtime nnmaildir--cur-server)) | 912 | (if (equal x (nnmaildir--srv-mtime nnmaildir--cur-server)) |
| 909 | (if scan-group | 913 | (if scan-group |
| @@ -936,7 +940,7 @@ This variable is set by `nnmaildir-request-article'.") | |||
| 936 | (dolist (grp x) | 940 | (dolist (grp x) |
| 937 | (unintern grp groups)) | 941 | (unintern grp groups)) |
| 938 | (setf (nnmaildir--srv-mtime nnmaildir--cur-server) | 942 | (setf (nnmaildir--srv-mtime nnmaildir--cur-server) |
| 939 | (nth 5 (file-attributes srv-dir)))) | 943 | (file-attribute-modification-time (file-attributes srv-dir)))) |
| 940 | (and scan-group | 944 | (and scan-group |
| 941 | (nnmaildir--srv-gnm nnmaildir--cur-server) | 945 | (nnmaildir--srv-gnm nnmaildir--cur-server) |
| 942 | (nnmail-get-new-mail 'nnmaildir nil nil)))))) | 946 | (nnmail-get-new-mail 'nnmaildir nil nil)))))) |
| @@ -993,7 +997,7 @@ This variable is set by `nnmaildir-request-article'.") | |||
| 993 | (curdir (nnmaildir--cur | 997 | (curdir (nnmaildir--cur |
| 994 | (nnmaildir--srvgrp-dir | 998 | (nnmaildir--srvgrp-dir |
| 995 | (nnmaildir--srv-dir nnmaildir--cur-server) gname))) | 999 | (nnmaildir--srv-dir nnmaildir--cur-server) gname))) |
| 996 | (curdir-mtime (nth 5 (file-attributes curdir))) | 1000 | (curdir-mtime (file-attribute-modification-time (file-attributes curdir))) |
| 997 | pgname flist always-marks never-marks old-marks dir | 1001 | pgname flist always-marks never-marks old-marks dir |
| 998 | all-marks marks ranges markdir read ls | 1002 | all-marks marks ranges markdir read ls |
| 999 | old-mmth new-mmth mtime existing missing deactivate-mark) | 1003 | old-mmth new-mmth mtime existing missing deactivate-mark) |
| @@ -1046,7 +1050,7 @@ This variable is set by `nnmaildir-request-article'.") | |||
| 1046 | ;; a filename flag, get the later of the mtimes for markdir and | 1050 | ;; a filename flag, get the later of the mtimes for markdir and |
| 1047 | ;; curdir, otherwise only the markdir counts. | 1051 | ;; curdir, otherwise only the markdir counts. |
| 1048 | (setq mtime | 1052 | (setq mtime |
| 1049 | (let ((markdir-mtime (nth 5 (file-attributes markdir)))) | 1053 | (let ((markdir-mtime (file-attribute-modification-time (file-attributes markdir)))) |
| 1050 | (cond | 1054 | (cond |
| 1051 | ((null (nnmaildir--mark-to-flag mark)) | 1055 | ((null (nnmaildir--mark-to-flag mark)) |
| 1052 | markdir-mtime) | 1056 | markdir-mtime) |
| @@ -1599,7 +1603,7 @@ This variable is set by `nnmaildir-request-article'.") | |||
| 1599 | (nnmaildir--expired-article group article)) | 1603 | (nnmaildir--expired-article group article)) |
| 1600 | ((and no-force | 1604 | ((and no-force |
| 1601 | (progn | 1605 | (progn |
| 1602 | (setq time (nth 5 time) | 1606 | (setq time (file-attribute-modification-time time) |
| 1603 | bound-iter boundary) | 1607 | bound-iter boundary) |
| 1604 | (while (and bound-iter time | 1608 | (while (and bound-iter time |
| 1605 | (= (car bound-iter) (car time))) | 1609 | (= (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.") | |||
| 210 | min rdir num subdirectoriesp file) | 210 | min rdir num subdirectoriesp file) |
| 211 | ;; Recurse down directories. | 211 | ;; Recurse down directories. |
| 212 | (setq subdirectoriesp | 212 | (setq subdirectoriesp |
| 213 | ;; nth 1 of file-attributes always 1 on MS Windows :( | 213 | ;; link number always 1 on MS Windows :( |
| 214 | (/= (nth 1 (file-attributes (file-truename dir))) 2)) | 214 | (/= (file-attribute-link-number |
| 215 | (file-attributes (file-truename dir))) | ||
| 216 | 2)) | ||
| 215 | (dolist (rdir files) | 217 | (dolist (rdir files) |
| 216 | (if (or (not subdirectoriesp) | 218 | (if (or (not subdirectoriesp) |
| 217 | (file-regular-p rdir)) | 219 | (file-regular-p rdir)) |
| @@ -263,7 +265,8 @@ as unread by Gnus.") | |||
| 263 | 265 | ||
| 264 | (while (and articles is-old) | 266 | (while (and articles is-old) |
| 265 | (setq article (concat dir (int-to-string (car articles)))) | 267 | (setq article (concat dir (int-to-string (car articles)))) |
| 266 | (when (setq mod-time (nth 5 (file-attributes article))) | 268 | (when (setq mod-time (file-attribute-modification-time |
| 269 | (file-attributes article))) | ||
| 267 | (if (and (nnmh-deletable-article-p newsgroup (car articles)) | 270 | (if (and (nnmh-deletable-article-p newsgroup (car articles)) |
| 268 | (setq is-old | 271 | (setq is-old |
| 269 | (nnmail-expired-article-p newsgroup mod-time force))) | 272 | (nnmail-expired-article-p newsgroup mod-time force))) |
| @@ -534,8 +537,8 @@ as unread by Gnus.") | |||
| 534 | art) | 537 | art) |
| 535 | (while (setq art (pop arts)) | 538 | (while (setq art (pop arts)) |
| 536 | (when (not (equal | 539 | (when (not (equal |
| 537 | (nth 5 (file-attributes | 540 | (file-attribute-modification-time |
| 538 | (concat dir (int-to-string (car art))))) | 541 | (file-attributes (concat dir (int-to-string (car art))))) |
| 539 | (cdr art))) | 542 | (cdr art))) |
| 540 | (setq articles (delq art articles)) | 543 | (setq articles (delq art articles)) |
| 541 | (push (car art) new)))) | 544 | (push (car art) new)))) |
| @@ -546,8 +549,9 @@ as unread by Gnus.") | |||
| 546 | (mapcar | 549 | (mapcar |
| 547 | (lambda (art) | 550 | (lambda (art) |
| 548 | (cons art | 551 | (cons art |
| 549 | (nth 5 (file-attributes | 552 | (file-attribute-modification-time |
| 550 | (concat dir (int-to-string art)))))) | 553 | (file-attributes |
| 554 | (concat dir (int-to-string art)))))) | ||
| 551 | new))) | 555 | new))) |
| 552 | ;; Make Gnus mark all new articles as unread. | 556 | ;; Make Gnus mark all new articles as unread. |
| 553 | (when new | 557 | (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.") | |||
| 344 | (while (and articles is-old) | 344 | (while (and articles is-old) |
| 345 | (if (and (setq article (nnml-article-to-file | 345 | (if (and (setq article (nnml-article-to-file |
| 346 | (setq number (pop articles)))) | 346 | (setq number (pop articles)))) |
| 347 | (setq mod-time (nth 5 (file-attributes article))) | 347 | (setq mod-time (file-attribute-modification-time |
| 348 | (file-attributes article))) | ||
| 348 | (nnml-deletable-article-p group number) | 349 | (nnml-deletable-article-p group number) |
| 349 | (setq is-old (nnmail-expired-article-p group mod-time force | 350 | (setq is-old (nnmail-expired-article-p group mod-time force |
| 350 | nnml-inhibit-expiry))) | 351 | 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 @@ | |||
| 77 | ;; Learn spam: (spam-stat-process-spam-directory "~/Mail/mail/spam") | 77 | ;; Learn spam: (spam-stat-process-spam-directory "~/Mail/mail/spam") |
| 78 | ;; Learn non-spam: (spam-stat-process-non-spam-directory "~/Mail/mail/misc") | 78 | ;; Learn non-spam: (spam-stat-process-non-spam-directory "~/Mail/mail/misc") |
| 79 | ;; Save table: (spam-stat-save) | 79 | ;; Save table: (spam-stat-save) |
| 80 | ;; File size: (nth 7 (file-attributes spam-stat-file)) | 80 | ;; File size: (file-attribute-size (file-attributes spam-stat-file)) |
| 81 | ;; Number of words: (hash-table-count spam-stat) | 81 | ;; Number of words: (hash-table-count spam-stat) |
| 82 | ;; Test spam: (spam-stat-test-directory "~/Mail/mail/spam") | 82 | ;; Test spam: (spam-stat-test-directory "~/Mail/mail/spam") |
| 83 | ;; Test non-spam: (spam-stat-test-directory "~/Mail/mail/misc") | 83 | ;; Test non-spam: (spam-stat-test-directory "~/Mail/mail/misc") |
| 84 | ;; Reduce table size: (spam-stat-reduce-size) | 84 | ;; Reduce table size: (spam-stat-reduce-size) |
| 85 | ;; Save table: (spam-stat-save) | 85 | ;; Save table: (spam-stat-save) |
| 86 | ;; File size: (nth 7 (file-attributes spam-stat-file)) | 86 | ;; File size: (file-attribute-size (file-attributes spam-stat-file)) |
| 87 | ;; Number of words: (hash-table-count spam-stat) | 87 | ;; Number of words: (hash-table-count spam-stat) |
| 88 | ;; Test spam: (spam-stat-test-directory "~/Mail/mail/spam") | 88 | ;; Test spam: (spam-stat-test-directory "~/Mail/mail/spam") |
| 89 | ;; Test non-spam: (spam-stat-test-directory "~/Mail/mail/misc") | 89 | ;; 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)) | |||
| 424 | (insert ")))")))) | 424 | (insert ")))")))) |
| 425 | (message "Saved %s." spam-stat-file) | 425 | (message "Saved %s." spam-stat-file) |
| 426 | (setq spam-stat-dirty nil | 426 | (setq spam-stat-dirty nil |
| 427 | spam-stat-last-saved-at (nth 5 (file-attributes spam-stat-file))))) | 427 | spam-stat-last-saved-at (file-attribute-modification-time |
| 428 | (file-attributes spam-stat-file))))) | ||
| 428 | 429 | ||
| 429 | (defun spam-stat-load () | 430 | (defun spam-stat-load () |
| 430 | "Read the `spam-stat' hash table from disk." | 431 | "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)) | |||
| 434 | ((or (not (boundp 'spam-stat-last-saved-at)) | 435 | ((or (not (boundp 'spam-stat-last-saved-at)) |
| 435 | (null spam-stat-last-saved-at) | 436 | (null spam-stat-last-saved-at) |
| 436 | (not (equal spam-stat-last-saved-at | 437 | (not (equal spam-stat-last-saved-at |
| 437 | (nth 5 (file-attributes spam-stat-file))))) | 438 | (file-attribute-modification-time |
| 439 | (file-attributes spam-stat-file))))) | ||
| 438 | (progn | 440 | (progn |
| 439 | (load-file spam-stat-file) | 441 | (load-file spam-stat-file) |
| 440 | (setq spam-stat-dirty nil | 442 | (setq spam-stat-dirty nil |
| 441 | spam-stat-last-saved-at | 443 | spam-stat-last-saved-at |
| 442 | (nth 5 (file-attributes spam-stat-file))))) | 444 | (file-attribute-modification-time |
| 445 | (file-attributes spam-stat-file))))) | ||
| 443 | (t (message "Spam stat file not loaded: no change in disk."))))) | 446 | (t (message "Spam stat file not loaded: no change in disk."))))) |
| 444 | 447 | ||
| 445 | (defun spam-stat-to-hash-table (entries) | 448 | (defun spam-stat-to-hash-table (entries) |
| @@ -561,8 +564,10 @@ check the variable `spam-stat-score-data'." | |||
| 561 | (dolist (f files) | 564 | (dolist (f files) |
| 562 | (when (and (file-readable-p f) | 565 | (when (and (file-readable-p f) |
| 563 | (file-regular-p f) | 566 | (file-regular-p f) |
| 564 | (> (nth 7 (file-attributes f)) 0) | 567 | (> (file-attribute-size (file-attributes f)) 0) |
| 565 | (< (time-to-number-of-days (time-since (nth 5 (file-attributes f)))) | 568 | (< (time-to-number-of-days |
| 569 | (time-since (file-attribute-modification-time | ||
| 570 | (file-attributes f)))) | ||
| 566 | spam-stat-process-directory-age)) | 571 | spam-stat-process-directory-age)) |
| 567 | (setq count (1+ count)) | 572 | (setq count (1+ count)) |
| 568 | (message "Reading %s: %.2f%%" dir (/ count max)) | 573 | (message "Reading %s: %.2f%%" dir (/ count max)) |
| @@ -607,7 +612,7 @@ display non-spam files; otherwise display spam files." | |||
| 607 | (dolist (f files) | 612 | (dolist (f files) |
| 608 | (when (and (file-readable-p f) | 613 | (when (and (file-readable-p f) |
| 609 | (file-regular-p f) | 614 | (file-regular-p f) |
| 610 | (> (nth 7 (file-attributes f)) 0)) | 615 | (> (file-attribute-size (file-attributes f)) 0)) |
| 611 | (setq count (1+ count)) | 616 | (setq count (1+ count)) |
| 612 | (message "Reading %.2f%%, score %.2f" | 617 | (message "Reading %.2f%%, score %.2f" |
| 613 | (/ count max) (/ score count)) | 618 | (/ count max) (/ score count)) |
diff --git a/lisp/ido.el b/lisp/ido.el index f9a9607a3a9..64d820333f4 100644 --- a/lisp/ido.el +++ b/lisp/ido.el | |||
| @@ -1750,7 +1750,8 @@ is enabled then some keybindings are changed in the keymap." | |||
| 1750 | (ido-final-slash dir) | 1750 | (ido-final-slash dir) |
| 1751 | (not (ido-is-unc-host dir)) | 1751 | (not (ido-is-unc-host dir)) |
| 1752 | (file-directory-p dir) | 1752 | (file-directory-p dir) |
| 1753 | (> (nth 7 (file-attributes (file-truename dir))) ido-max-directory-size)))) | 1753 | (> (file-attribute-size (file-attributes (file-truename dir))) |
| 1754 | ido-max-directory-size)))) | ||
| 1754 | 1755 | ||
| 1755 | (defun ido-set-current-directory (dir &optional subdir no-merge) | 1756 | (defun ido-set-current-directory (dir &optional subdir no-merge) |
| 1756 | ;; Set ido's current directory to DIR or DIR/SUBDIR | 1757 | ;; Set ido's current directory to DIR or DIR/SUBDIR |
| @@ -3610,7 +3611,7 @@ Uses and updates `ido-dir-file-cache'." | |||
| 3610 | (ftp (ido-is-ftp-directory dir)) | 3611 | (ftp (ido-is-ftp-directory dir)) |
| 3611 | (unc (ido-is-unc-host dir)) | 3612 | (unc (ido-is-unc-host dir)) |
| 3612 | (attr (if (or ftp unc) nil (file-attributes dir))) | 3613 | (attr (if (or ftp unc) nil (file-attributes dir))) |
| 3613 | (mtime (nth 5 attr)) | 3614 | (mtime (file-attribute-modification-time attr)) |
| 3614 | valid) | 3615 | valid) |
| 3615 | (when cached ; should we use the cached entry ? | 3616 | (when cached ; should we use the cached entry ? |
| 3616 | (cond | 3617 | (cond |
diff --git a/lisp/image-dired.el b/lisp/image-dired.el index 1acb31928b4..17e566d5b15 100644 --- a/lisp/image-dired.el +++ b/lisp/image-dired.el | |||
| @@ -587,8 +587,9 @@ Create the thumbnails directory if it does not exist." | |||
| 587 | (let* ((thumb-file (image-dired-thumb-name file)) | 587 | (let* ((thumb-file (image-dired-thumb-name file)) |
| 588 | (thumb-attr (file-attributes thumb-file))) | 588 | (thumb-attr (file-attributes thumb-file))) |
| 589 | (when (or (not thumb-attr) | 589 | (when (or (not thumb-attr) |
| 590 | (time-less-p (nth 5 thumb-attr) | 590 | (time-less-p (file-attribute-modification-time thumb-attr) |
| 591 | (nth 5 (file-attributes file)))) | 591 | (file-attribute-modification-time |
| 592 | (file-attributes file)))) | ||
| 592 | (image-dired-create-thumb file thumb-file)) | 593 | (image-dired-create-thumb file thumb-file)) |
| 593 | (create-image thumb-file) | 594 | (create-image thumb-file) |
| 594 | ;; (list 'image :type 'jpeg | 595 | ;; (list 'image :type 'jpeg |
| @@ -752,7 +753,8 @@ Increase at own risk.") | |||
| 752 | (let* ((width (int-to-string (image-dired-thumb-size 'width))) | 753 | (let* ((width (int-to-string (image-dired-thumb-size 'width))) |
| 753 | (height (int-to-string (image-dired-thumb-size 'height))) | 754 | (height (int-to-string (image-dired-thumb-size 'height))) |
| 754 | (modif-time (format-time-string | 755 | (modif-time (format-time-string |
| 755 | "%s" (nth 5 (file-attributes original-file)))) | 756 | "%s" (file-attribute-modification-time |
| 757 | (file-attributes original-file)))) | ||
| 756 | (thumbnail-nq8-file (replace-regexp-in-string ".png\\'" "-nq8.png" | 758 | (thumbnail-nq8-file (replace-regexp-in-string ".png\\'" "-nq8.png" |
| 757 | thumbnail-file)) | 759 | thumbnail-file)) |
| 758 | (spec | 760 | (spec |
| @@ -2652,8 +2654,8 @@ tags to their respective image file. Internal function used by | |||
| 2652 | ;; (mapcar | 2654 | ;; (mapcar |
| 2653 | ;; (lambda (f) | 2655 | ;; (lambda (f) |
| 2654 | ;; (let ((fattribs (file-attributes f))) | 2656 | ;; (let ((fattribs (file-attributes f))) |
| 2655 | ;; ;; Get last access time and file size | 2657 | ;; `(,(file-attribute-access-time fattribs) |
| 2656 | ;; `(,(nth 4 fattribs) ,(nth 7 fattribs) ,f))) | 2658 | ;; ,(file-attribute-size fattribs) ,f))) |
| 2657 | ;; (directory-files (image-dired-dir) t ".+\\.thumb\\..+$")) | 2659 | ;; (directory-files (image-dired-dir) t ".+\\.thumb\\..+$")) |
| 2658 | ;; ;; Sort function. Compare time between two files. | 2660 | ;; ;; Sort function. Compare time between two files. |
| 2659 | ;; (lambda (l1 l2) | 2661 | ;; (lambda (l1 l2) |
diff --git a/lisp/info.el b/lisp/info.el index ab2c51d84bf..f2e29578f89 100644 --- a/lisp/info.el +++ b/lisp/info.el | |||
| @@ -654,9 +654,11 @@ Do the right thing if the file has been compressed or zipped." | |||
| 654 | 654 | ||
| 655 | ;; Clear the caches of modified Info files. | 655 | ;; Clear the caches of modified Info files. |
| 656 | (let* ((attribs-old (cdr (assoc fullname Info-file-attributes))) | 656 | (let* ((attribs-old (cdr (assoc fullname Info-file-attributes))) |
| 657 | (modtime-old (and attribs-old (nth 5 attribs-old))) | 657 | (modtime-old (and attribs-old |
| 658 | (file-attribute-modification-time attribs-old))) | ||
| 658 | (attribs-new (and (stringp fullname) (file-attributes fullname))) | 659 | (attribs-new (and (stringp fullname) (file-attributes fullname))) |
| 659 | (modtime-new (and attribs-new (nth 5 attribs-new)))) | 660 | (modtime-new (and attribs-new |
| 661 | (file-attribute-modification-time attribs-new)))) | ||
| 660 | (when (and modtime-old modtime-new | 662 | (when (and modtime-old modtime-new |
| 661 | (time-less-p modtime-old modtime-new)) | 663 | (time-less-p modtime-old modtime-new)) |
| 662 | (setq Info-index-nodes (remove (assoc (or Info-current-file filename) | 664 | (setq Info-index-nodes (remove (assoc (or Info-current-file filename) |
diff --git a/lisp/ls-lisp.el b/lisp/ls-lisp.el index adb86dd05b1..95f3163ddf2 100644 --- a/lisp/ls-lisp.el +++ b/lisp/ls-lisp.el | |||
| @@ -385,13 +385,13 @@ not contain `d', so that a full listing is expected." | |||
| 385 | ;; files we are about to display. | 385 | ;; files we are about to display. |
| 386 | (dolist (elt file-alist) | 386 | (dolist (elt file-alist) |
| 387 | (setq attr (cdr elt) | 387 | (setq attr (cdr elt) |
| 388 | fuid (nth 2 attr) | 388 | fuid (file-attribute-user-id attr) |
| 389 | uid-len (if (stringp fuid) (string-width fuid) | 389 | uid-len (if (stringp fuid) (string-width fuid) |
| 390 | (length (format "%d" fuid))) | 390 | (length (format "%d" fuid))) |
| 391 | fgid (nth 3 attr) | 391 | fgid (file-attribute-group-id attr) |
| 392 | gid-len (if (stringp fgid) (string-width fgid) | 392 | gid-len (if (stringp fgid) (string-width fgid) |
| 393 | (length (format "%d" fgid))) | 393 | (length (format "%d" fgid))) |
| 394 | file-size (nth 7 attr)) | 394 | file-size (file-attribute-size attr)) |
| 395 | (if (> uid-len max-uid-len) | 395 | (if (> uid-len max-uid-len) |
| 396 | (setq max-uid-len uid-len)) | 396 | (setq max-uid-len uid-len)) |
| 397 | (if (> gid-len max-gid-len) | 397 | (if (> gid-len max-gid-len) |
| @@ -418,7 +418,7 @@ not contain `d', so that a full listing is expected." | |||
| 418 | files (cdr files) | 418 | files (cdr files) |
| 419 | short (car elt) | 419 | short (car elt) |
| 420 | attr (cdr elt) | 420 | attr (cdr elt) |
| 421 | file-size (nth 7 attr)) | 421 | file-size (file-attribute-size attr)) |
| 422 | (and attr | 422 | (and attr |
| 423 | (setq sum (+ file-size | 423 | (setq sum (+ file-size |
| 424 | ;; Even if neither SUM nor file's size | 424 | ;; Even if neither SUM nor file's size |
| @@ -474,7 +474,7 @@ not contain `d', so that a full listing is expected." | |||
| 474 | (if (memq ?F switches) | 474 | (if (memq ?F switches) |
| 475 | (ls-lisp-classify-file file fattr) | 475 | (ls-lisp-classify-file file fattr) |
| 476 | file) | 476 | file) |
| 477 | fattr (nth 7 fattr) | 477 | fattr (file-attribute-size fattr) |
| 478 | switches time-index)) | 478 | switches time-index)) |
| 479 | (message "%s: doesn't exist or is inaccessible" file) | 479 | (message "%s: doesn't exist or is inaccessible" file) |
| 480 | (ding) (sit-for 2))))) ; to show user the message! | 480 | (ding) (sit-for 2))))) ; to show user the message! |
| @@ -659,10 +659,9 @@ SWITCHES is a list of characters. Default sorting is alphabetic." | |||
| 659 | (sort (copy-sequence file-alist) ; modifies its argument! | 659 | (sort (copy-sequence file-alist) ; modifies its argument! |
| 660 | (cond ((memq ?S switches) | 660 | (cond ((memq ?S switches) |
| 661 | (lambda (x y) ; sorted on size | 661 | (lambda (x y) ; sorted on size |
| 662 | ;; 7th file attribute is file size | ||
| 663 | ;; Make largest file come first | 662 | ;; Make largest file come first |
| 664 | (< (nth 7 (cdr y)) | 663 | (< (file-attribute-size (cdr y)) |
| 665 | (nth 7 (cdr x))))) | 664 | (file-attribute-size (cdr x))))) |
| 666 | ((setq index (ls-lisp-time-index switches)) | 665 | ((setq index (ls-lisp-time-index switches)) |
| 667 | (lambda (x y) ; sorted on time | 666 | (lambda (x y) ; sorted on time |
| 668 | (time-less-p (nth index (cdr y)) | 667 | (time-less-p (nth index (cdr y)) |
| @@ -719,8 +718,8 @@ FATTR is the file attributes returned by `file-attributes' for the file. | |||
| 719 | The file type indicators are `/' for directories, `@' for symbolic | 718 | The file type indicators are `/' for directories, `@' for symbolic |
| 720 | links, `|' for FIFOs, `=' for sockets, `*' for regular files that | 719 | links, `|' for FIFOs, `=' for sockets, `*' for regular files that |
| 721 | are executable, and nothing for other types of files." | 720 | are executable, and nothing for other types of files." |
| 722 | (let* ((type (car fattr)) | 721 | (let* ((type (file-attribute-type fattr)) |
| 723 | (modestr (nth 8 fattr)) | 722 | (modestr (file-attribute-modes fattr)) |
| 724 | (typestr (substring modestr 0 1)) | 723 | (typestr (substring modestr 0 1)) |
| 725 | (file-name (propertize filename 'dired-filename t))) | 724 | (file-name (propertize filename 'dired-filename t))) |
| 726 | (cond | 725 | (cond |
| @@ -773,35 +772,13 @@ FOLLOWED by null and full filename, SOLELY for full alpha sort." | |||
| 773 | "Format one line of long ls output for file FILE-NAME. | 772 | "Format one line of long ls output for file FILE-NAME. |
| 774 | FILE-ATTR and FILE-SIZE give the file's attributes and size. | 773 | FILE-ATTR and FILE-SIZE give the file's attributes and size. |
| 775 | SWITCHES and TIME-INDEX give the full switch list and time data." | 774 | SWITCHES and TIME-INDEX give the full switch list and time data." |
| 776 | (let ((file-type (nth 0 file-attr)) | 775 | (let ((file-type (file-attribute-type file-attr)) |
| 777 | ;; t for directory, string (name linked to) | 776 | ;; t for directory, string (name linked to) |
| 778 | ;; for symbolic link, or nil. | 777 | ;; for symbolic link, or nil. |
| 779 | (drwxrwxrwx (nth 8 file-attr))) ; attribute string ("drwxrwxrwx") | 778 | (drwxrwxrwx (file-attribute-modes file-attr))) |
| 780 | (concat (if (memq ?i switches) ; inode number | 779 | (concat (if (memq ?i switches) ; inode number |
| 781 | (let ((inode (nth 10 file-attr))) | 780 | (let ((inode (file-attribute-inode-number file-attr))) |
| 782 | (if (consp inode) | 781 | (format " %18d " inode))) |
| 783 | (if (consp (cdr inode)) | ||
| 784 | ;; 2^(24+16) = 1099511627776.0, but | ||
| 785 | ;; multiplying by it and then adding the | ||
| 786 | ;; other members of the cons cell in one go | ||
| 787 | ;; loses precision, since a double does not | ||
| 788 | ;; have enough significant digits to hold a | ||
| 789 | ;; full 64-bit value. So below we split | ||
| 790 | ;; 1099511627776 into high 13 and low 5 | ||
| 791 | ;; digits and compute in two parts. | ||
| 792 | (let ((p1 (* (car inode) 10995116.0)) | ||
| 793 | (p2 (+ (* (car inode) 27776.0) | ||
| 794 | (* (cadr inode) 65536.0) | ||
| 795 | (cddr inode)))) | ||
| 796 | (format " %13.0f%05.0f " | ||
| 797 | ;; Use floor to emulate integer | ||
| 798 | ;; division. | ||
| 799 | (+ p1 (floor p2 100000.0)) | ||
| 800 | (mod p2 100000.0))) | ||
| 801 | (format " %18.0f " | ||
| 802 | (+ (* (car inode) 65536.0) | ||
| 803 | (cdr inode)))) | ||
| 804 | (format " %18d " inode)))) | ||
| 805 | ;; nil is treated like "" in concat | 782 | ;; nil is treated like "" in concat |
| 806 | (if (memq ?s switches) ; size in K, rounded up | 783 | (if (memq ?s switches) ; size in K, rounded up |
| 807 | ;; In GNU ls, -h affects the size in blocks, displayed | 784 | ;; In GNU ls, -h affects the size in blocks, displayed |
| @@ -819,14 +796,14 @@ SWITCHES and TIME-INDEX give the full switch list and time data." | |||
| 819 | (fceiling (/ file-size 1024.0))))) | 796 | (fceiling (/ file-size 1024.0))))) |
| 820 | drwxrwxrwx ; attribute string | 797 | drwxrwxrwx ; attribute string |
| 821 | (if (memq 'links ls-lisp-verbosity) | 798 | (if (memq 'links ls-lisp-verbosity) |
| 822 | (format "%3d" (nth 1 file-attr))) ; link count | 799 | (format "%3d" (file-attribute-link-number file-attr))) |
| 823 | ;; Numeric uid/gid are more confusing than helpful; | 800 | ;; Numeric uid/gid are more confusing than helpful; |
| 824 | ;; Emacs should be able to make strings of them. | 801 | ;; Emacs should be able to make strings of them. |
| 825 | ;; They tend to be bogus on non-UNIX platforms anyway so | 802 | ;; They tend to be bogus on non-UNIX platforms anyway so |
| 826 | ;; optionally hide them. | 803 | ;; optionally hide them. |
| 827 | (if (memq 'uid ls-lisp-verbosity) | 804 | (if (memq 'uid ls-lisp-verbosity) |
| 828 | ;; uid can be a string or an integer | 805 | ;; uid can be a string or an integer |
| 829 | (let ((uid (nth 2 file-attr))) | 806 | (let ((uid (file-attribute-user-id file-attr))) |
| 830 | (format (if (stringp uid) | 807 | (format (if (stringp uid) |
| 831 | ls-lisp-uid-s-fmt | 808 | ls-lisp-uid-s-fmt |
| 832 | ls-lisp-uid-d-fmt) | 809 | ls-lisp-uid-d-fmt) |
| @@ -834,7 +811,7 @@ SWITCHES and TIME-INDEX give the full switch list and time data." | |||
| 834 | (if (not (memq ?G switches)) ; GNU ls -- shows group by default | 811 | (if (not (memq ?G switches)) ; GNU ls -- shows group by default |
| 835 | (if (or (memq ?g switches) ; UNIX ls -- no group by default | 812 | (if (or (memq ?g switches) ; UNIX ls -- no group by default |
| 836 | (memq 'gid ls-lisp-verbosity)) | 813 | (memq 'gid ls-lisp-verbosity)) |
| 837 | (let ((gid (nth 3 file-attr))) | 814 | (let ((gid (file-attribute-group-id file-attr))) |
| 838 | (format (if (stringp gid) | 815 | (format (if (stringp gid) |
| 839 | ls-lisp-gid-s-fmt | 816 | ls-lisp-gid-s-fmt |
| 840 | ls-lisp-gid-d-fmt) | 817 | ls-lisp-gid-d-fmt) |
diff --git a/lisp/mail/blessmail.el b/lisp/mail/blessmail.el index 8261f175ad8..62e9873b493 100644 --- a/lisp/mail/blessmail.el +++ b/lisp/mail/blessmail.el | |||
| @@ -49,15 +49,15 @@ | |||
| 49 | (setq attr (file-attributes dirname)) | 49 | (setq attr (file-attributes dirname)) |
| 50 | (if (not (eq t (car attr))) | 50 | (if (not (eq t (car attr))) |
| 51 | (insert (format "echo %s is not a directory\n" rmail-spool-directory)) | 51 | (insert (format "echo %s is not a directory\n" rmail-spool-directory)) |
| 52 | (setq modes (nth 8 attr)) | 52 | (setq modes (file-attribute-modes attr)) |
| 53 | (cond ((= ?w (aref modes 8)) | 53 | (cond ((= ?w (aref modes 8)) |
| 54 | ;; Nothing needs to be done. | 54 | ;; Nothing needs to be done. |
| 55 | ) | 55 | ) |
| 56 | ((= ?w (aref modes 5)) | 56 | ((= ?w (aref modes 5)) |
| 57 | (insert "chgrp " (number-to-string (nth 3 attr)) | 57 | (insert "chgrp " (number-to-string (file-attribute-group-id attr)) |
| 58 | " $* && chmod g+s $*\n")) | 58 | " $* && chmod g+s $*\n")) |
| 59 | ((= ?w (aref modes 2)) | 59 | ((= ?w (aref modes 2)) |
| 60 | (insert "chown " (number-to-string (nth 2 attr)) | 60 | (insert "chown " (number-to-string (file-attribute-user-id attr)) |
| 61 | " $* && chmod u+s $*\n")) | 61 | " $* && chmod u+s $*\n")) |
| 62 | (t | 62 | (t |
| 63 | (insert "chown root $* && chmod u+s $*\n")))) | 63 | (insert "chown root $* && chmod u+s $*\n")))) |
diff --git a/lisp/mail/feedmail.el b/lisp/mail/feedmail.el index ec4a1162b28..2b63343239b 100644 --- a/lisp/mail/feedmail.el +++ b/lisp/mail/feedmail.el | |||
| @@ -2815,16 +2815,13 @@ return that value." | |||
| 2815 | (defun feedmail-default-date-generator (maybe-file) | 2815 | (defun feedmail-default-date-generator (maybe-file) |
| 2816 | "Default function for generating Date: header contents." | 2816 | "Default function for generating Date: header contents." |
| 2817 | (feedmail-say-debug ">in-> feedmail-default-date-generator") | 2817 | (feedmail-say-debug ">in-> feedmail-default-date-generator") |
| 2818 | (when maybe-file | 2818 | (let ((attr (and maybe-file (file-attributes maybe-file)))) |
| 2819 | (feedmail-say-debug (concat "4 cre " (feedmail-rfc822-date (nth 4 (file-attributes maybe-file))))) | 2819 | (when attr |
| 2820 | (feedmail-say-debug (concat "5 mod " (feedmail-rfc822-date (nth 5 (file-attributes maybe-file))))) | 2820 | (feedmail-say-debug (concat "4 cre " (feedmail-rfc822-date (file-attribute-access-time attr)))) |
| 2821 | (feedmail-say-debug (concat "6 sta " (feedmail-rfc822-date (nth 6 (file-attributes maybe-file)))))) | 2821 | (feedmail-say-debug (concat "5 mod " (feedmail-rfc822-date (file-attribute-modification-time attr)))) |
| 2822 | (let ((date-time)) | 2822 | (feedmail-say-debug (concat "6 sta " (feedmail-rfc822-date (file-attribute-status-change-time attr))))) |
| 2823 | (if (and (not feedmail-queue-use-send-time-for-date) maybe-file) | 2823 | (feedmail-rfc822-date (and attr (not feedmail-queue-use-send-time-for-date) |
| 2824 | (setq date-time (nth 5 (file-attributes maybe-file)))) | 2824 | (file-attribute-modification-time attr))))) |
| 2825 | (feedmail-rfc822-date date-time)) | ||
| 2826 | ) | ||
| 2827 | |||
| 2828 | 2825 | ||
| 2829 | (defun feedmail-fiddle-date (maybe-file) | 2826 | (defun feedmail-fiddle-date (maybe-file) |
| 2830 | "Fiddle Date:. See documentation of `feedmail-date-generator'." | 2827 | "Fiddle Date:. See documentation of `feedmail-date-generator'." |
| @@ -2874,7 +2871,8 @@ probably not appropriate for you." | |||
| 2874 | (concat (if (equal (match-beginning 1) (match-end 1)) "" "-") end-stuff)) | 2871 | (concat (if (equal (match-beginning 1) (match-end 1)) "" "-") end-stuff)) |
| 2875 | (setq end-stuff (concat "@" end-stuff))) | 2872 | (setq end-stuff (concat "@" end-stuff))) |
| 2876 | (if (and (not feedmail-queue-use-send-time-for-message-id) maybe-file) | 2873 | (if (and (not feedmail-queue-use-send-time-for-message-id) maybe-file) |
| 2877 | (setq date-time (nth 5 (file-attributes maybe-file)))) | 2874 | (setq date-time (file-attribute-modification-time |
| 2875 | (file-attributes maybe-file)))) | ||
| 2878 | (format "<%d-%s%s%s>" | 2876 | (format "<%d-%s%s%s>" |
| 2879 | (mod (random) 10000) | 2877 | (mod (random) 10000) |
| 2880 | (format-time-string "%a%d%b%Y%H%M%S" date-time) | 2878 | (format-time-string "%a%d%b%Y%H%M%S" date-time) |
diff --git a/lisp/mail/mailabbrev.el b/lisp/mail/mailabbrev.el index 0ce1a3b12b2..e5456d92afb 100644 --- a/lisp/mail/mailabbrev.el +++ b/lisp/mail/mailabbrev.el | |||
| @@ -163,7 +163,8 @@ no aliases, which is represented by this being a table with no entries.)") | |||
| 163 | (defun mail-abbrevs-sync-aliases () | 163 | (defun mail-abbrevs-sync-aliases () |
| 164 | (when mail-personal-alias-file | 164 | (when mail-personal-alias-file |
| 165 | (if (file-exists-p mail-personal-alias-file) | 165 | (if (file-exists-p mail-personal-alias-file) |
| 166 | (let ((modtime (nth 5 (file-attributes mail-personal-alias-file)))) | 166 | (let ((modtime (file-attribute-modification-time |
| 167 | (file-attributes mail-personal-alias-file)))) | ||
| 167 | (if (not (equal mail-abbrev-modtime modtime)) | 168 | (if (not (equal mail-abbrev-modtime modtime)) |
| 168 | (progn | 169 | (progn |
| 169 | (setq mail-abbrev-modtime modtime) | 170 | (setq mail-abbrev-modtime modtime) |
| @@ -176,7 +177,8 @@ no aliases, which is represented by this being a table with no entries.)") | |||
| 176 | (file-exists-p mail-personal-alias-file)) | 177 | (file-exists-p mail-personal-alias-file)) |
| 177 | (progn | 178 | (progn |
| 178 | (setq mail-abbrev-modtime | 179 | (setq mail-abbrev-modtime |
| 179 | (nth 5 (file-attributes mail-personal-alias-file))) | 180 | (file-attribute-modification-time |
| 181 | (file-attributes mail-personal-alias-file))) | ||
| 180 | (build-mail-abbrevs))) | 182 | (build-mail-abbrevs))) |
| 181 | (mail-abbrevs-sync-aliases) | 183 | (mail-abbrevs-sync-aliases) |
| 182 | (add-function :around (local 'abbrev-expand-function) | 184 | (add-function :around (local 'abbrev-expand-function) |
diff --git a/lisp/mail/mspools.el b/lisp/mail/mspools.el index aa91f36a67f..2e8765eb67c 100644 --- a/lisp/mail/mspools.el +++ b/lisp/mail/mspools.el | |||
| @@ -387,7 +387,7 @@ nil." | |||
| 387 | (let ((file (concat mspools-folder-directory spool)) | 387 | (let ((file (concat mspools-folder-directory spool)) |
| 388 | size) | 388 | size) |
| 389 | (setq file (or (file-symlink-p file) file)) | 389 | (setq file (or (file-symlink-p file) file)) |
| 390 | (setq size (nth 7 (file-attributes file))) | 390 | (setq size (file-attribute-size (file-attributes file))) |
| 391 | ;; size could be nil if the sym-link points to a non-existent file | 391 | ;; size could be nil if the sym-link points to a non-existent file |
| 392 | ;; so check this first. | 392 | ;; so check this first. |
| 393 | (if (and size (> size 0)) | 393 | (if (and size (> size 0)) |
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index 9416d049028..73a17ee15e2 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el | |||
| @@ -2028,10 +2028,10 @@ Value is the size of the newly read mail after conversion." | |||
| 2028 | "the remote server" | 2028 | "the remote server" |
| 2029 | proto))) | 2029 | proto))) |
| 2030 | ((and (file-exists-p tofile) | 2030 | ((and (file-exists-p tofile) |
| 2031 | (/= 0 (nth 7 (file-attributes tofile)))) | 2031 | (/= 0 (file-attribute-size (file-attributes tofile)))) |
| 2032 | (message "Getting mail from %s..." tofile)) | 2032 | (message "Getting mail from %s..." tofile)) |
| 2033 | ((and (file-exists-p file) | 2033 | ((and (file-exists-p file) |
| 2034 | (/= 0 (nth 7 (file-attributes file)))) | 2034 | (/= 0 (file-attribute-size (file-attributes file)))) |
| 2035 | (message "Getting mail from %s..." file))) | 2035 | (message "Getting mail from %s..." file))) |
| 2036 | ;; Set TOFILE if have not already done so, and | 2036 | ;; Set TOFILE if have not already done so, and |
| 2037 | ;; rename or copy the file FILE to TOFILE if and as appropriate. | 2037 | ;; rename or copy the file FILE to TOFILE if and as appropriate. |
diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el index 50dd81039e7..6fc91a3acd9 100644 --- a/lisp/mail/sendmail.el +++ b/lisp/mail/sendmail.el | |||
| @@ -561,7 +561,8 @@ This also saves the value of `send-mail-function' via Customize." | |||
| 561 | 561 | ||
| 562 | (defun sendmail-sync-aliases () | 562 | (defun sendmail-sync-aliases () |
| 563 | (when mail-personal-alias-file | 563 | (when mail-personal-alias-file |
| 564 | (let ((modtime (nth 5 (file-attributes mail-personal-alias-file)))) | 564 | (let ((modtime (file-attribute-modification-time |
| 565 | (file-attributes mail-personal-alias-file)))) | ||
| 565 | (or (equal mail-alias-modtime modtime) | 566 | (or (equal mail-alias-modtime modtime) |
| 566 | (setq mail-alias-modtime modtime | 567 | (setq mail-alias-modtime modtime |
| 567 | mail-aliases t))))) | 568 | mail-aliases t))))) |
diff --git a/lisp/mh-e/mh-alias.el b/lisp/mh-e/mh-alias.el index fa91042fd9a..257d6b31cc3 100644 --- a/lisp/mh-e/mh-alias.el +++ b/lisp/mh-e/mh-alias.el | |||
| @@ -78,7 +78,8 @@ If ARG is non-nil, set timestamp with the current time." | |||
| 78 | (function | 78 | (function |
| 79 | (lambda (file) | 79 | (lambda (file) |
| 80 | (when (and file (file-exists-p file)) | 80 | (when (and file (file-exists-p file)) |
| 81 | (setq stamp (nth 5 (file-attributes file))) | 81 | (setq stamp (file-attribute-modification-time |
| 82 | (file-attributes file))) | ||
| 82 | (or (> (car stamp) (car mh-alias-tstamp)) | 83 | (or (> (car stamp) (car mh-alias-tstamp)) |
| 83 | (and (= (car stamp) (car mh-alias-tstamp)) | 84 | (and (= (car stamp) (car mh-alias-tstamp)) |
| 84 | (> (cadr stamp) (cadr mh-alias-tstamp))))))) | 85 | (> (cadr stamp) (cadr mh-alias-tstamp))))))) |
diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el index 2fc7ac251ec..1aa794477a9 100644 --- a/lisp/net/ange-ftp.el +++ b/lisp/net/ange-ftp.el | |||
| @@ -1361,11 +1361,13 @@ only return the directory part of FILE." | |||
| 1361 | (ange-ftp-real-expand-file-name ange-ftp-netrc-filename))) | 1361 | (ange-ftp-real-expand-file-name ange-ftp-netrc-filename))) |
| 1362 | (setq attr (ange-ftp-real-file-attributes file))) | 1362 | (setq attr (ange-ftp-real-file-attributes file))) |
| 1363 | (if (and attr ; file exists. | 1363 | (if (and attr ; file exists. |
| 1364 | (not (equal (nth 5 attr) ange-ftp-netrc-modtime))) ; file changed | 1364 | (not (equal (file-attribute-modification-time attr) |
| 1365 | ange-ftp-netrc-modtime))) ; file changed | ||
| 1365 | (save-match-data | 1366 | (save-match-data |
| 1366 | (if (or ange-ftp-disable-netrc-security-check | 1367 | (if (or ange-ftp-disable-netrc-security-check |
| 1367 | (and (eq (nth 2 attr) (user-uid)) ; Same uids. | 1368 | (and (eq (file-attribute-user-id attr) (user-uid)) ; Same uids. |
| 1368 | (string-match ".r..------" (nth 8 attr)))) | 1369 | (string-match ".r..------" |
| 1370 | (file-attribute-modes attr)))) | ||
| 1369 | (with-current-buffer | 1371 | (with-current-buffer |
| 1370 | ;; we are cheating a bit here. I'm trying to do the equivalent | 1372 | ;; we are cheating a bit here. I'm trying to do the equivalent |
| 1371 | ;; of find-file on the .netrc file, but then nuke it afterwards. | 1373 | ;; of find-file on the .netrc file, but then nuke it afterwards. |
| @@ -1389,7 +1391,8 @@ only return the directory part of FILE." | |||
| 1389 | (ange-ftp-message "%s either not owned by you or badly protected." | 1391 | (ange-ftp-message "%s either not owned by you or badly protected." |
| 1390 | ange-ftp-netrc-filename) | 1392 | ange-ftp-netrc-filename) |
| 1391 | (sit-for 1)) | 1393 | (sit-for 1)) |
| 1392 | (setq ange-ftp-netrc-modtime (nth 5 attr)))))) | 1394 | (setq ange-ftp-netrc-modtime |
| 1395 | (file-attribute-modification-time attr)))))) | ||
| 1393 | 1396 | ||
| 1394 | ;; Return a list of prefixes of the form 'user@host:' to be used when | 1397 | ;; Return a list of prefixes of the form 'user@host:' to be used when |
| 1395 | ;; completion is done in the root directory. | 1398 | ;; completion is done in the root directory. |
| @@ -3242,7 +3245,8 @@ system TYPE.") | |||
| 3242 | ;; tell the process filter what size the transfer will be. | 3245 | ;; tell the process filter what size the transfer will be. |
| 3243 | (let ((attr (file-attributes temp))) | 3246 | (let ((attr (file-attributes temp))) |
| 3244 | (if attr | 3247 | (if attr |
| 3245 | (ange-ftp-set-xfer-size host user (nth 7 attr)))) | 3248 | (ange-ftp-set-xfer-size host user |
| 3249 | (file-attribute-size attr)))) | ||
| 3246 | 3250 | ||
| 3247 | ;; put or append the file. | 3251 | ;; put or append the file. |
| 3248 | (let ((result (ange-ftp-send-cmd host user | 3252 | (let ((result (ange-ftp-send-cmd host user |
| @@ -3481,8 +3485,8 @@ system TYPE.") | |||
| 3481 | (let ((f1-parsed (ange-ftp-ftp-name f1)) | 3485 | (let ((f1-parsed (ange-ftp-ftp-name f1)) |
| 3482 | (f2-parsed (ange-ftp-ftp-name f2))) | 3486 | (f2-parsed (ange-ftp-ftp-name f2))) |
| 3483 | (if (or f1-parsed f2-parsed) | 3487 | (if (or f1-parsed f2-parsed) |
| 3484 | (let ((f1-mt (nth 5 (file-attributes f1))) | 3488 | (let ((f1-mt (file-attribute-modification-time (file-attributes f1))) |
| 3485 | (f2-mt (nth 5 (file-attributes f2)))) | 3489 | (f2-mt (file-attribute-modification-time (file-attributes f2)))) |
| 3486 | (cond ((null f1-mt) nil) | 3490 | (cond ((null f1-mt) nil) |
| 3487 | ((null f2-mt) t) | 3491 | ((null f2-mt) t) |
| 3488 | (t (time-less-p f2-mt f1-mt)))) | 3492 | (t (time-less-p f2-mt f1-mt)))) |
| @@ -3782,7 +3786,8 @@ so return the size on the remote host exactly. See RFC 3659." | |||
| 3782 | ;; tell the process filter what size the file is. | 3786 | ;; tell the process filter what size the file is. |
| 3783 | (let ((attr (file-attributes (or temp2 filename)))) | 3787 | (let ((attr (file-attributes (or temp2 filename)))) |
| 3784 | (if attr | 3788 | (if attr |
| 3785 | (ange-ftp-set-xfer-size t-host t-user (nth 7 attr)))) | 3789 | (ange-ftp-set-xfer-size t-host t-user |
| 3790 | (file-attribute-size attr)))) | ||
| 3786 | 3791 | ||
| 3787 | (ange-ftp-send-cmd | 3792 | (ange-ftp-send-cmd |
| 3788 | t-host | 3793 | t-host |
diff --git a/lisp/net/eudcb-mab.el b/lisp/net/eudcb-mab.el index a21348480e0..a69c77b7235 100644 --- a/lisp/net/eudcb-mab.el +++ b/lisp/net/eudcb-mab.el | |||
| @@ -53,7 +53,8 @@ RETURN-ATTRS is a list of attributes to return, defaulting to | |||
| 53 | 53 | ||
| 54 | (let ((fmt-string "%ln:%fn:%p:%e") | 54 | (let ((fmt-string "%ln:%fn:%p:%e") |
| 55 | (mab-buffer (get-buffer-create " *mab contacts*")) | 55 | (mab-buffer (get-buffer-create " *mab contacts*")) |
| 56 | (modified (nth 5 (file-attributes eudc-contacts-file))) | 56 | (modified (file-attribute-modification-time |
| 57 | (file-attributes eudc-contacts-file))) | ||
| 57 | result) | 58 | result) |
| 58 | (with-current-buffer mab-buffer | 59 | (with-current-buffer mab-buffer |
| 59 | (make-local-variable 'eudc-buffer-time) | 60 | (make-local-variable 'eudc-buffer-time) |
diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 97fdabd72bd..64cc1a51f69 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el | |||
| @@ -1667,7 +1667,7 @@ If CHARSET is nil then use UTF-8." | |||
| 1667 | (defun eww-read-bookmarks () | 1667 | (defun eww-read-bookmarks () |
| 1668 | (let ((file (expand-file-name "eww-bookmarks" eww-bookmarks-directory))) | 1668 | (let ((file (expand-file-name "eww-bookmarks" eww-bookmarks-directory))) |
| 1669 | (setq eww-bookmarks | 1669 | (setq eww-bookmarks |
| 1670 | (unless (zerop (or (nth 7 (file-attributes file)) 0)) | 1670 | (unless (zerop (or (file-attribute-size (file-attributes file)) 0)) |
| 1671 | (with-temp-buffer | 1671 | (with-temp-buffer |
| 1672 | (insert-file-contents file) | 1672 | (insert-file-contents file) |
| 1673 | (read (current-buffer))))))) | 1673 | (read (current-buffer))))))) |
diff --git a/lisp/net/netrc.el b/lisp/net/netrc.el index ec743dcff0c..7b974ebf616 100644 --- a/lisp/net/netrc.el +++ b/lisp/net/netrc.el | |||
| @@ -63,12 +63,14 @@ | |||
| 63 | "port")) | 63 | "port")) |
| 64 | alist elem result pair) | 64 | alist elem result pair) |
| 65 | (if (and netrc-cache | 65 | (if (and netrc-cache |
| 66 | (equal (car netrc-cache) (nth 5 (file-attributes file)))) | 66 | (equal (car netrc-cache) (file-attribute-modification-time |
| 67 | (file-attributes file)))) | ||
| 67 | (insert (base64-decode-string (rot13-string (cdr netrc-cache)))) | 68 | (insert (base64-decode-string (rot13-string (cdr netrc-cache)))) |
| 68 | (insert-file-contents file) | 69 | (insert-file-contents file) |
| 69 | (when (string-match "\\.gpg\\'" file) | 70 | (when (string-match "\\.gpg\\'" file) |
| 70 | ;; Store the contents of the file heavily encrypted in memory. | 71 | ;; Store the contents of the file heavily encrypted in memory. |
| 71 | (setq netrc-cache (cons (nth 5 (file-attributes file)) | 72 | (setq netrc-cache (cons (file-attribute-modification-time |
| 73 | (file-attributes file)) | ||
| 72 | (rot13-string | 74 | (rot13-string |
| 73 | (base64-encode-string | 75 | (base64-encode-string |
| 74 | (buffer-string))))))) | 76 | (buffer-string))))))) |
diff --git a/lisp/net/newst-backend.el b/lisp/net/newst-backend.el index 32893d2eea5..b6fbdfb766c 100644 --- a/lisp/net/newst-backend.el +++ b/lisp/net/newst-backend.el | |||
| @@ -1800,7 +1800,8 @@ download it from URL first." | |||
| 1800 | (let ((image-name (concat directory feed-name))) | 1800 | (let ((image-name (concat directory feed-name))) |
| 1801 | (if (and (file-exists-p image-name) | 1801 | (if (and (file-exists-p image-name) |
| 1802 | (time-less-p nil | 1802 | (time-less-p nil |
| 1803 | (time-add (nth 5 (file-attributes image-name)) | 1803 | (time-add (file-attribute-modification-time |
| 1804 | (file-attributes image-name)) | ||
| 1804 | (seconds-to-time 86400)))) | 1805 | (seconds-to-time 86400)))) |
| 1805 | (newsticker--debug-msg "%s: Getting image for %s skipped" | 1806 | (newsticker--debug-msg "%s: Getting image for %s skipped" |
| 1806 | (format-time-string "%A, %H:%M") | 1807 | (format-time-string "%A, %H:%M") |
diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el index 9af57fb0755..bcfaf40ebc1 100644 --- a/lisp/net/tramp-compat.el +++ b/lisp/net/tramp-compat.el | |||
| @@ -142,15 +142,15 @@ returned." | |||
| 142 | (defsubst tramp-compat-file-attribute-modification-time (attributes) | 142 | (defsubst tramp-compat-file-attribute-modification-time (attributes) |
| 143 | "The modification time in ATTRIBUTES returned by `file-attributes'. | 143 | "The modification time in ATTRIBUTES returned by `file-attributes'. |
| 144 | This is the time of the last change to the file's contents, and | 144 | This is the time of the last change to the file's contents, and |
| 145 | is a list of integers (HIGH LOW USEC PSEC) in the same style | 145 | is a Lisp timestamp in the style of `current-time'." |
| 146 | as (current-time)." | ||
| 147 | (nth 5 attributes))) | 146 | (nth 5 attributes))) |
| 148 | 147 | ||
| 149 | (if (fboundp 'file-attribute-size) | 148 | (if (fboundp 'file-attribute-size) |
| 150 | (defalias 'tramp-compat-file-attribute-size 'file-attribute-size) | 149 | (defalias 'tramp-compat-file-attribute-size 'file-attribute-size) |
| 151 | (defsubst tramp-compat-file-attribute-size (attributes) | 150 | (defsubst tramp-compat-file-attribute-size (attributes) |
| 152 | "The size (in bytes) in ATTRIBUTES returned by `file-attributes'. | 151 | "The size (in bytes) in ATTRIBUTES returned by `file-attributes'. |
| 153 | This is a floating point number if the size is too large for an integer." | 152 | If the size is too large for a fixnum, this is a bignum in Emacs 27 |
| 153 | and later, and is a float in Emacs 26 and earlier." | ||
| 154 | (nth 7 attributes))) | 154 | (nth 7 attributes))) |
| 155 | 155 | ||
| 156 | (if (fboundp 'file-attribute-modes) | 156 | (if (fboundp 'file-attribute-modes) |
diff --git a/lisp/nxml/rng-loc.el b/lisp/nxml/rng-loc.el index a9a1950822d..75d983189a5 100644 --- a/lisp/nxml/rng-loc.el +++ b/lisp/nxml/rng-loc.el | |||
| @@ -407,7 +407,7 @@ or nil." | |||
| 407 | "Return a list of rules for the schema locating file FILE." | 407 | "Return a list of rules for the schema locating file FILE." |
| 408 | (setq file (expand-file-name file)) | 408 | (setq file (expand-file-name file)) |
| 409 | (let ((cached (assoc file rng-schema-locating-file-alist)) | 409 | (let ((cached (assoc file rng-schema-locating-file-alist)) |
| 410 | (mtime (nth 5 (file-attributes file))) | 410 | (mtime (file-attribute-modification-time (file-attributes file))) |
| 411 | parsed) | 411 | parsed) |
| 412 | (cond ((not mtime) | 412 | (cond ((not mtime) |
| 413 | (when cached | 413 | (when cached |
diff --git a/lisp/obsolete/fast-lock.el b/lisp/obsolete/fast-lock.el index 41e48c3eafb..21db32148f7 100644 --- a/lisp/obsolete/fast-lock.el +++ b/lisp/obsolete/fast-lock.el | |||
| @@ -441,7 +441,8 @@ See `fast-lock-mode'." | |||
| 441 | ;; Only save if user's restrictions are satisfied. | 441 | ;; Only save if user's restrictions are satisfied. |
| 442 | (and min-size (>= (buffer-size) min-size)) | 442 | (and min-size (>= (buffer-size) min-size)) |
| 443 | (or fast-lock-save-others | 443 | (or fast-lock-save-others |
| 444 | (eq (user-uid) (nth 2 (file-attributes buffer-file-name)))) | 444 | (eq (user-uid) (file-attribute-user-id |
| 445 | (file-attributes buffer-file-name)))) | ||
| 445 | ;; | 446 | ;; |
| 446 | ;; Only save if there are `face' properties to save. | 447 | ;; Only save if there are `face' properties to save. |
| 447 | (text-property-not-all (point-min) (point-max) 'face nil)) | 448 | (text-property-not-all (point-min) (point-max) 'face nil)) |
diff --git a/lisp/obsolete/vc-arch.el b/lisp/obsolete/vc-arch.el index 414ae77fc6a..9860c9d3faa 100644 --- a/lisp/obsolete/vc-arch.el +++ b/lisp/obsolete/vc-arch.el | |||
| @@ -304,8 +304,9 @@ Only the value `maybe' can be trusted :-(." | |||
| 304 | ;; Buh? Unexpected format. | 304 | ;; Buh? Unexpected format. |
| 305 | 'edited | 305 | 'edited |
| 306 | (let ((ats (file-attributes file))) | 306 | (let ((ats (file-attributes file))) |
| 307 | (if (and (eq (nth 7 ats) (string-to-number (match-string 2))) | 307 | (if (and (eq (file-attribute-size ats) (string-to-number (match-string 2))) |
| 308 | (equal (format-time-string "%s" (nth 5 ats)) | 308 | (equal (format-time-string |
| 309 | "%s" (file-attribute-modification-time ats)) | ||
| 309 | (match-string 1))) | 310 | (match-string 1))) |
| 310 | 'up-to-date | 311 | 'up-to-date |
| 311 | 'edited))))))))) | 312 | 'edited))))))))) |
| @@ -402,7 +403,7 @@ CALLBACK expects (ENTRIES &optional MORE-TO-COME); see | |||
| 402 | 403 | ||
| 403 | (defun vc-arch-diff3-rej-p (rej) | 404 | (defun vc-arch-diff3-rej-p (rej) |
| 404 | (let ((attrs (file-attributes rej))) | 405 | (let ((attrs (file-attributes rej))) |
| 405 | (and attrs (< (nth 7 attrs) 60) | 406 | (and attrs (< (file-attribute-size attrs) 60) |
| 406 | (with-temp-buffer | 407 | (with-temp-buffer |
| 407 | (insert-file-contents rej) | 408 | (insert-file-contents rej) |
| 408 | (goto-char (point-min)) | 409 | (goto-char (point-min)) |
diff --git a/lisp/org/ob-eval.el b/lisp/org/ob-eval.el index 2bfaa08a609..f8cb285dd3e 100644 --- a/lisp/org/ob-eval.el +++ b/lisp/org/ob-eval.el | |||
| @@ -120,7 +120,7 @@ function in various versions of Emacs. | |||
| 120 | (delete-file input-file)) | 120 | (delete-file input-file)) |
| 121 | 121 | ||
| 122 | (when (and error-file (file-exists-p error-file)) | 122 | (when (and error-file (file-exists-p error-file)) |
| 123 | (when (< 0 (nth 7 (file-attributes error-file))) | 123 | (when (< 0 (file-attribute-size (file-attributes error-file))) |
| 124 | (with-current-buffer (get-buffer-create error-buffer) | 124 | (with-current-buffer (get-buffer-create error-buffer) |
| 125 | (let ((pos-from-end (- (point-max) (point)))) | 125 | (let ((pos-from-end (- (point-max) (point)))) |
| 126 | (or (bobp) | 126 | (or (bobp) |
diff --git a/lisp/org/org-attach.el b/lisp/org/org-attach.el index 9774e3a7975..203e71e9549 100644 --- a/lisp/org/org-attach.el +++ b/lisp/org/org-attach.el | |||
| @@ -352,7 +352,7 @@ This checks for the existence of a \".git\" directory in that directory." | |||
| 352 | (shell-command-to-string | 352 | (shell-command-to-string |
| 353 | "git ls-files -zmo --exclude-standard") "\0" t)) | 353 | "git ls-files -zmo --exclude-standard") "\0" t)) |
| 354 | (if (and use-annex | 354 | (if (and use-annex |
| 355 | (>= (nth 7 (file-attributes new-or-modified)) | 355 | (>= (file-attribute-size (file-attributes new-or-modified)) |
| 356 | org-attach-git-annex-cutoff)) | 356 | org-attach-git-annex-cutoff)) |
| 357 | (call-process "git" nil nil nil "annex" "add" new-or-modified) | 357 | (call-process "git" nil nil nil "annex" "add" new-or-modified) |
| 358 | (call-process "git" nil nil nil "add" new-or-modified)) | 358 | (call-process "git" nil nil nil "add" new-or-modified)) |
diff --git a/lisp/org/org-macro.el b/lisp/org/org-macro.el index 1033db2af46..e50b2f99842 100644 --- a/lisp/org/org-macro.el +++ b/lisp/org/org-macro.el | |||
| @@ -159,7 +159,8 @@ function installs the following ones: \"property\", | |||
| 159 | (format "(eval (format-time-string \"$1\" (or (and (org-string-nw-p \"$2\") (org-macro--vc-modified-time %s)) '%s)))" | 159 | (format "(eval (format-time-string \"$1\" (or (and (org-string-nw-p \"$2\") (org-macro--vc-modified-time %s)) '%s)))" |
| 160 | (prin1-to-string visited-file) | 160 | (prin1-to-string visited-file) |
| 161 | (prin1-to-string | 161 | (prin1-to-string |
| 162 | (nth 5 (file-attributes visited-file))))))))) | 162 | (file-attribute-modification-time |
| 163 | (file-attributes visited-file))))))))) | ||
| 163 | ;; Initialize and install "n" macro. | 164 | ;; Initialize and install "n" macro. |
| 164 | (org-macro--counter-initialize) | 165 | (org-macro--counter-initialize) |
| 165 | (funcall update-templates | 166 | (funcall update-templates |
diff --git a/lisp/org/org.el b/lisp/org/org.el index 21d9cd8785d..873ae6b8209 100644 --- a/lisp/org/org.el +++ b/lisp/org/org.el | |||
| @@ -230,8 +230,9 @@ file to byte-code before it is loaded." | |||
| 230 | (let* ((age (lambda (file) | 230 | (let* ((age (lambda (file) |
| 231 | (float-time | 231 | (float-time |
| 232 | (time-subtract (current-time) | 232 | (time-subtract (current-time) |
| 233 | (nth 5 (or (file-attributes (file-truename file)) | 233 | (file-attribute-modification-time |
| 234 | (file-attributes file))))))) | 234 | (or (file-attributes (file-truename file)) |
| 235 | (file-attributes file))))))) | ||
| 235 | (base-name (file-name-sans-extension file)) | 236 | (base-name (file-name-sans-extension file)) |
| 236 | (exported-file (concat base-name ".el"))) | 237 | (exported-file (concat base-name ".el"))) |
| 237 | ;; tangle if the Org file is newer than the elisp file | 238 | ;; tangle if the Org file is newer than the elisp file |
| @@ -22381,7 +22382,9 @@ returned by, e.g., `current-time'." | |||
| 22381 | ;; (e.g. HFS+) do not retain any finer granularity. As | 22382 | ;; (e.g. HFS+) do not retain any finer granularity. As |
| 22382 | ;; a consequence, make sure we return non-nil when the two | 22383 | ;; a consequence, make sure we return non-nil when the two |
| 22383 | ;; times are equal. | 22384 | ;; times are equal. |
| 22384 | (not (time-less-p (cl-subseq (nth 5 (file-attributes file)) 0 2) | 22385 | (not (time-less-p (cl-subseq (file-attribute-modification-time |
| 22386 | (file-attributes file)) | ||
| 22387 | 0 2) | ||
| 22385 | (cl-subseq time 0 2))))) | 22388 | (cl-subseq time 0 2))))) |
| 22386 | 22389 | ||
| 22387 | (defun org-compile-file (source process ext &optional err-msg log-buf spec) | 22390 | (defun org-compile-file (source process ext &optional err-msg log-buf spec) |
diff --git a/lisp/org/ox-html.el b/lisp/org/ox-html.el index 39f7d83e14a..6166a4ad019 100644 --- a/lisp/org/ox-html.el +++ b/lisp/org/ox-html.el | |||
| @@ -1935,7 +1935,8 @@ INFO is a plist used as a communication channel." | |||
| 1935 | (?c . ,(plist-get info :creator)) | 1935 | (?c . ,(plist-get info :creator)) |
| 1936 | (?C . ,(let ((file (plist-get info :input-file))) | 1936 | (?C . ,(let ((file (plist-get info :input-file))) |
| 1937 | (format-time-string timestamp-format | 1937 | (format-time-string timestamp-format |
| 1938 | (and file (nth 5 (file-attributes file)))))) | 1938 | (and file (file-attribute-modification-time |
| 1939 | (file-attributes file)))))) | ||
| 1939 | (?v . ,(or (plist-get info :html-validation-link) ""))))) | 1940 | (?v . ,(or (plist-get info :html-validation-link) ""))))) |
| 1940 | 1941 | ||
| 1941 | (defun org-html--build-pre/postamble (type info) | 1942 | (defun org-html--build-pre/postamble (type info) |
diff --git a/lisp/org/ox-publish.el b/lisp/org/ox-publish.el index ba5a0232e42..80ef239b679 100644 --- a/lisp/org/ox-publish.el +++ b/lisp/org/ox-publish.el | |||
| @@ -879,7 +879,8 @@ If FILE is an Org file and provides a DATE keyword use it. In | |||
| 879 | any other case use the file system's modification time. Return | 879 | any other case use the file system's modification time. Return |
| 880 | time in `current-time' format." | 880 | time in `current-time' format." |
| 881 | (let ((file (org-publish--expand-file-name file project))) | 881 | (let ((file (org-publish--expand-file-name file project))) |
| 882 | (if (file-directory-p file) (nth 5 (file-attributes file)) | 882 | (if (file-directory-p file) (file-attribute-modification-time |
| 883 | (file-attributes file)) | ||
| 883 | (let ((date (org-publish-find-property file :date project))) | 884 | (let ((date (org-publish-find-property file :date project))) |
| 884 | ;; DATE is a secondary string. If it contains a time-stamp, | 885 | ;; DATE is a secondary string. If it contains a time-stamp, |
| 885 | ;; convert it to internal format. Otherwise, use FILE | 886 | ;; convert it to internal format. Otherwise, use FILE |
| @@ -889,7 +890,8 @@ time in `current-time' format." | |||
| 889 | (let ((value (org-element-interpret-data ts))) | 890 | (let ((value (org-element-interpret-data ts))) |
| 890 | (and (org-string-nw-p value) | 891 | (and (org-string-nw-p value) |
| 891 | (org-time-string-to-time value)))))) | 892 | (org-time-string-to-time value)))))) |
| 892 | ((file-exists-p file) (nth 5 (file-attributes file))) | 893 | ((file-exists-p file) (file-attribute-modification-time |
| 894 | (file-attributes file))) | ||
| 893 | (t (error "No such file: \"%s\"" file))))))) | 895 | (t (error "No such file: \"%s\"" file))))))) |
| 894 | 896 | ||
| 895 | (defun org-publish-sitemap-default-entry (entry style project) | 897 | (defun org-publish-sitemap-default-entry (entry style project) |
| @@ -1348,8 +1350,7 @@ does not exist." | |||
| 1348 | (expand-file-name (or (file-symlink-p file) file) | 1350 | (expand-file-name (or (file-symlink-p file) file) |
| 1349 | (file-name-directory file))))) | 1351 | (file-name-directory file))))) |
| 1350 | (if (not attr) (error "No such file: \"%s\"" file) | 1352 | (if (not attr) (error "No such file: \"%s\"" file) |
| 1351 | (+ (ash (car (nth 5 attr)) 16) | 1353 | (floor (float-time (file-attribute-modification-time attr)))))) |
| 1352 | (cadr (nth 5 attr)))))) | ||
| 1353 | 1354 | ||
| 1354 | 1355 | ||
| 1355 | (provide 'ox-publish) | 1356 | (provide 'ox-publish) |
diff --git a/lisp/pcmpl-gnu.el b/lisp/pcmpl-gnu.el index 16c992662dd..c4e5a677d0c 100644 --- a/lisp/pcmpl-gnu.el +++ b/lisp/pcmpl-gnu.el | |||
| @@ -316,7 +316,7 @@ | |||
| 316 | (while (pcomplete-here | 316 | (while (pcomplete-here |
| 317 | (if (and complete-within | 317 | (if (and complete-within |
| 318 | (let* ((fa (file-attributes (pcomplete-arg 1))) | 318 | (let* ((fa (file-attributes (pcomplete-arg 1))) |
| 319 | (size (nth 7 fa))) | 319 | (size (file-attribute-size fa))) |
| 320 | (and (numberp size) | 320 | (and (numberp size) |
| 321 | (or (null large-file-warning-threshold) | 321 | (or (null large-file-warning-threshold) |
| 322 | (< size large-file-warning-threshold))))) | 322 | (< size large-file-warning-threshold))))) |
diff --git a/lisp/pcmpl-rpm.el b/lisp/pcmpl-rpm.el index 74ddb8b9d78..7f164c9f2be 100644 --- a/lisp/pcmpl-rpm.el +++ b/lisp/pcmpl-rpm.el | |||
| @@ -71,7 +71,8 @@ | |||
| 71 | "Return a list of all installed rpm packages." | 71 | "Return a list of all installed rpm packages." |
| 72 | (if (and pcmpl-rpm-cache | 72 | (if (and pcmpl-rpm-cache |
| 73 | pcmpl-rpm-cache-time | 73 | pcmpl-rpm-cache-time |
| 74 | (let ((mtime (nth 5 (file-attributes pcmpl-rpm-cache-stamp-file)))) | 74 | (let ((mtime (file-attribute-modification-time |
| 75 | (file-attributes pcmpl-rpm-cache-stamp-file)))) | ||
| 75 | (and mtime (not (time-less-p pcmpl-rpm-cache-time mtime))))) | 76 | (and mtime (not (time-less-p pcmpl-rpm-cache-time mtime))))) |
| 76 | pcmpl-rpm-packages | 77 | pcmpl-rpm-packages |
| 77 | (message "Getting list of installed rpms...") | 78 | (message "Getting list of installed rpms...") |
diff --git a/lisp/play/cookie1.el b/lisp/play/cookie1.el index 5ae2cb432e8..7a6a56b1913 100644 --- a/lisp/play/cookie1.el +++ b/lisp/play/cookie1.el | |||
| @@ -125,7 +125,8 @@ and subsequent calls on the same file won't go to disk." | |||
| 125 | (setq phrase-file (cookie-check-file phrase-file)) | 125 | (setq phrase-file (cookie-check-file phrase-file)) |
| 126 | (let ((sym (intern-soft phrase-file cookie-cache))) | 126 | (let ((sym (intern-soft phrase-file cookie-cache))) |
| 127 | (and sym (not (equal (symbol-function sym) | 127 | (and sym (not (equal (symbol-function sym) |
| 128 | (nth 5 (file-attributes phrase-file)))) | 128 | (file-attribute-modification-time |
| 129 | (file-attributes phrase-file)))) | ||
| 129 | (yes-or-no-p (concat phrase-file | 130 | (yes-or-no-p (concat phrase-file |
| 130 | " has changed. Read new contents? ")) | 131 | " has changed. Read new contents? ")) |
| 131 | (setq sym nil)) | 132 | (setq sym nil)) |
| @@ -133,7 +134,8 @@ and subsequent calls on the same file won't go to disk." | |||
| 133 | (symbol-value sym) | 134 | (symbol-value sym) |
| 134 | (setq sym (intern phrase-file cookie-cache)) | 135 | (setq sym (intern phrase-file cookie-cache)) |
| 135 | (if startmsg (message "%s" startmsg)) | 136 | (if startmsg (message "%s" startmsg)) |
| 136 | (fset sym (nth 5 (file-attributes phrase-file))) | 137 | (fset sym (file-attribute-modification-time |
| 138 | (file-attributes phrase-file))) | ||
| 137 | (let (result) | 139 | (let (result) |
| 138 | (with-temp-buffer | 140 | (with-temp-buffer |
| 139 | (insert-file-contents (expand-file-name phrase-file)) | 141 | (insert-file-contents (expand-file-name phrase-file)) |
diff --git a/lisp/progmodes/cmacexp.el b/lisp/progmodes/cmacexp.el index 742ac80be1e..7dcfb10af0a 100644 --- a/lisp/progmodes/cmacexp.el +++ b/lisp/progmodes/cmacexp.el | |||
| @@ -383,7 +383,8 @@ Optional arg DISPLAY non-nil means show messages in the echo area." | |||
| 383 | (not (member (file-name-nondirectory shell-file-name) | 383 | (not (member (file-name-nondirectory shell-file-name) |
| 384 | msdos-shells))) | 384 | msdos-shells))) |
| 385 | (eq exit-status 0)) | 385 | (eq exit-status 0)) |
| 386 | (zerop (nth 7 (file-attributes (expand-file-name tempname)))) | 386 | (zerop (file-attribute-size |
| 387 | (file-attributes (expand-file-name tempname)))) | ||
| 387 | (progn | 388 | (progn |
| 388 | (goto-char (point-min)) | 389 | (goto-char (point-min)) |
| 389 | ;; Put the messages inside a comment, so they won't get in | 390 | ;; Put the messages inside a comment, so they won't get in |
diff --git a/lisp/ps-bdf.el b/lisp/ps-bdf.el index 301142ed489..f9632f00133 100644 --- a/lisp/ps-bdf.el +++ b/lisp/ps-bdf.el | |||
| @@ -70,13 +70,12 @@ for BDFNAME." | |||
| 70 | 70 | ||
| 71 | (defsubst bdf-file-mod-time (filename) | 71 | (defsubst bdf-file-mod-time (filename) |
| 72 | "Return modification time of FILENAME. | 72 | "Return modification time of FILENAME. |
| 73 | The value is a list of integers in the same format as `current-time'." | 73 | The value is a timestamp in the same format as `current-time'." |
| 74 | (nth 5 (file-attributes filename))) | 74 | (file-attribute-modification-time (file-attributes filename))) |
| 75 | 75 | ||
| 76 | (defun bdf-file-newer-than-time (filename mod-time) | 76 | (defun bdf-file-newer-than-time (filename mod-time) |
| 77 | "Return non-nil if and only if FILENAME is newer than MOD-TIME. | 77 | "Return non-nil if and only if FILENAME is newer than MOD-TIME. |
| 78 | MOD-TIME is a modification time as a list of integers in the same | 78 | MOD-TIME is a modification time in the same format as `current-time'." |
| 79 | format as `current-time'." | ||
| 80 | (let ((new-mod-time (bdf-file-mod-time filename))) | 79 | (let ((new-mod-time (bdf-file-mod-time filename))) |
| 81 | (time-less-p mod-time new-mod-time))) | 80 | (time-less-p mod-time new-mod-time))) |
| 82 | 81 | ||
| @@ -168,8 +167,7 @@ FONT-INFO is a list of the following format: | |||
| 168 | (BDFFILE MOD-TIME FONT-BOUNDING-BOX | 167 | (BDFFILE MOD-TIME FONT-BOUNDING-BOX |
| 169 | RELATIVE-COMPOSE BASELINE-OFFSET CODE-RANGE MAXLEN OFFSET-VECTOR) | 168 | RELATIVE-COMPOSE BASELINE-OFFSET CODE-RANGE MAXLEN OFFSET-VECTOR) |
| 170 | 169 | ||
| 171 | MOD-TIME is last modification time as a list of integers in the | 170 | MOD-TIME is last modification time in the same format as `current-time'. |
| 172 | same format as `current-time'. | ||
| 173 | 171 | ||
| 174 | SIZE is a size of the font on 72 dpi device. This value is got | 172 | SIZE is a size of the font on 72 dpi device. This value is got |
| 175 | from SIZE record of the font. | 173 | from SIZE record of the font. |
diff --git a/lisp/server.el b/lisp/server.el index fd024480bdd..50684a20aaa 100644 --- a/lisp/server.el +++ b/lisp/server.el | |||
| @@ -540,13 +540,13 @@ Creates the directory if necessary and makes sure: | |||
| 540 | (setq attrs (file-attributes dir 'integer))) | 540 | (setq attrs (file-attributes dir 'integer))) |
| 541 | 541 | ||
| 542 | ;; Check that it's safe for use. | 542 | ;; Check that it's safe for use. |
| 543 | (let* ((uid (nth 2 attrs)) | 543 | (let* ((uid (file-attribute-user-id attrs)) |
| 544 | (w32 (eq system-type 'windows-nt)) | 544 | (w32 (eq system-type 'windows-nt)) |
| 545 | (unsafe (cond | 545 | (unsafe (cond |
| 546 | ((not (eq t (car attrs))) | 546 | ((not (eq t (file-attribute-type attrs))) |
| 547 | (if (null attrs) "its attributes can't be checked" | 547 | (if (null attrs) "its attributes can't be checked" |
| 548 | (format "it is a %s" | 548 | (format "it is a %s" |
| 549 | (if (stringp (car attrs)) | 549 | (if (stringp (file-attribute-type attrs)) |
| 550 | "symlink" "file")))) | 550 | "symlink" "file")))) |
| 551 | ((and w32 (zerop uid)) ; on FAT32? | 551 | ((and w32 (zerop uid)) ; on FAT32? |
| 552 | (display-warning | 552 | (display-warning |
diff --git a/lisp/simple.el b/lisp/simple.el index ffd7fcc067a..f0fcbf57562 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -3827,7 +3827,8 @@ interactively, this is t." | |||
| 3827 | ;; No output; error? | 3827 | ;; No output; error? |
| 3828 | (let ((output | 3828 | (let ((output |
| 3829 | (if (and error-file | 3829 | (if (and error-file |
| 3830 | (< 0 (nth 7 (file-attributes error-file)))) | 3830 | (< 0 (file-attribute-size |
| 3831 | (file-attributes error-file)))) | ||
| 3831 | (format "some error output%s" | 3832 | (format "some error output%s" |
| 3832 | (if shell-command-default-error-buffer | 3833 | (if shell-command-default-error-buffer |
| 3833 | (format " to the \"%s\" buffer" | 3834 | (format " to the \"%s\" buffer" |
| @@ -3850,7 +3851,7 @@ interactively, this is t." | |||
| 3850 | ))))) | 3851 | ))))) |
| 3851 | 3852 | ||
| 3852 | (when (and error-file (file-exists-p error-file)) | 3853 | (when (and error-file (file-exists-p error-file)) |
| 3853 | (if (< 0 (nth 7 (file-attributes error-file))) | 3854 | (if (< 0 (file-attribute-size (file-attributes error-file))) |
| 3854 | (with-current-buffer (get-buffer-create error-buffer) | 3855 | (with-current-buffer (get-buffer-create error-buffer) |
| 3855 | (let ((pos-from-end (- (point-max) (point)))) | 3856 | (let ((pos-from-end (- (point-max) (point)))) |
| 3856 | (or (bobp) | 3857 | (or (bobp) |
diff --git a/lisp/speedbar.el b/lisp/speedbar.el index 48829d4023f..f3ea048cb83 100644 --- a/lisp/speedbar.el +++ b/lisp/speedbar.el | |||
| @@ -1466,9 +1466,10 @@ Return nil if not applicable. If FILENAME, then use that | |||
| 1466 | instead of reading it from the speedbar buffer." | 1466 | instead of reading it from the speedbar buffer." |
| 1467 | (let* ((item (or filename (speedbar-line-file))) | 1467 | (let* ((item (or filename (speedbar-line-file))) |
| 1468 | (attr (if item (file-attributes item) nil))) | 1468 | (attr (if item (file-attributes item) nil))) |
| 1469 | (if (and item attr) (dframe-message "%s %-6d %s" (nth 8 attr) | 1469 | (if (and item attr) |
| 1470 | (nth 7 attr) item) | 1470 | (dframe-message "%s %-6d %s" |
| 1471 | nil))) | 1471 | (file-attribute-modes attr) |
| 1472 | (file-attribute-size attr) item)))) | ||
| 1472 | 1473 | ||
| 1473 | (defun speedbar-item-info-tag-helper () | 1474 | (defun speedbar-item-info-tag-helper () |
| 1474 | "Display info about a tag that is on the current line. | 1475 | "Display info about a tag that is on the current line. |
| @@ -3008,13 +3009,13 @@ the file being checked." | |||
| 3008 | (cdr (car oa)))))) | 3009 | (cdr (car oa)))))) |
| 3009 | nil | 3010 | nil |
| 3010 | ;; Find out if the object is out of date or not. | 3011 | ;; Find out if the object is out of date or not. |
| 3011 | (let ((date1 (nth 5 (file-attributes fulln))) | 3012 | (let ((date1 (file-attribute-modification-time |
| 3012 | (date2 (nth 5 (file-attributes (concat | 3013 | (file-attributes fulln))) |
| 3013 | (file-name-sans-extension fulln) | 3014 | (date2 (file-attribute-modification-time |
| 3014 | (cdr (car oa))))))) | 3015 | (file-attributes (concat |
| 3015 | (if (or (< (car date1) (car date2)) | 3016 | (file-name-sans-extension fulln) |
| 3016 | (and (= (car date1) (car date2)) | 3017 | (cdr (car oa))))))) |
| 3017 | (< (nth 1 date1) (nth 1 date2)))) | 3018 | (if (time-less-p date1 date2) |
| 3018 | (car speedbar-obj-indicator) | 3019 | (car speedbar-obj-indicator) |
| 3019 | (cdr speedbar-obj-indicator))))))) | 3020 | (cdr speedbar-obj-indicator))))))) |
| 3020 | 3021 | ||
diff --git a/lisp/thumbs.el b/lisp/thumbs.el index 26c9935429f..067a32ba575 100644 --- a/lisp/thumbs.el +++ b/lisp/thumbs.el | |||
| @@ -210,7 +210,9 @@ reached." | |||
| 210 | (mapcar | 210 | (mapcar |
| 211 | (lambda (f) | 211 | (lambda (f) |
| 212 | (let ((fattribs-list (file-attributes f))) | 212 | (let ((fattribs-list (file-attributes f))) |
| 213 | `(,(nth 4 fattribs-list) ,(nth 7 fattribs-list) ,f))) | 213 | `(,(file-attribute-access-time fattribs-list) |
| 214 | ,(file-attribute-size fattribs-list) | ||
| 215 | ,f))) | ||
| 214 | (directory-files (thumbs-thumbsdir) t (image-file-name-regexp))) | 216 | (directory-files (thumbs-thumbsdir) t (image-file-name-regexp))) |
| 215 | (lambda (l1 l2) (time-less-p (car l1) (car l2))))) | 217 | (lambda (l1 l2) (time-less-p (car l1) (car l2))))) |
| 216 | (dirsize (apply '+ (mapcar (lambda (x) (cadr x)) files-list)))) | 218 | (dirsize (apply '+ (mapcar (lambda (x) (cadr x)) files-list)))) |
diff --git a/lisp/time.el b/lisp/time.el index 94f7009953b..f8d933d48aa 100644 --- a/lisp/time.el +++ b/lisp/time.el | |||
| @@ -365,7 +365,8 @@ Switches from the 1 to 5 to 15 minute load average, and then back to 1." | |||
| 365 | (while (and mail-files (= size 0)) | 365 | (while (and mail-files (= size 0)) |
| 366 | ;; Count size of regular files only. | 366 | ;; Count size of regular files only. |
| 367 | (setq size (+ size (or (and (file-regular-p (car mail-files)) | 367 | (setq size (+ size (or (and (file-regular-p (car mail-files)) |
| 368 | (nth 7 (file-attributes (car mail-files)))) | 368 | (file-attribute-size |
| 369 | (file-attributes (car mail-files)))) | ||
| 369 | 0))) | 370 | 0))) |
| 370 | (setq mail-files (cdr mail-files))) | 371 | (setq mail-files (cdr mail-files))) |
| 371 | (if (> size 0) | 372 | (if (> size 0) |
| @@ -483,7 +484,8 @@ update which can wait for the next redisplay." | |||
| 483 | (defun display-time-file-nonempty-p (file) | 484 | (defun display-time-file-nonempty-p (file) |
| 484 | (let ((remote-file-name-inhibit-cache (- display-time-interval 5))) | 485 | (let ((remote-file-name-inhibit-cache (- display-time-interval 5))) |
| 485 | (and (file-exists-p file) | 486 | (and (file-exists-p file) |
| 486 | (< 0 (nth 7 (file-attributes (file-chase-links file))))))) | 487 | (< 0 (file-attribute-size |
| 488 | (file-attributes (file-chase-links file))))))) | ||
| 487 | 489 | ||
| 488 | ;;;###autoload | 490 | ;;;###autoload |
| 489 | (define-minor-mode display-time-mode | 491 | (define-minor-mode display-time-mode |
diff --git a/lisp/url/url-cache.el b/lisp/url/url-cache.el index 309c96cbccf..3765d9dc93d 100644 --- a/lisp/url/url-cache.el +++ b/lisp/url/url-cache.el | |||
| @@ -86,10 +86,10 @@ FILE can be created or overwritten." | |||
| 86 | The actual return value is the last modification time of the cache file." | 86 | The actual return value is the last modification time of the cache file." |
| 87 | (let* ((fname (url-cache-create-filename url)) | 87 | (let* ((fname (url-cache-create-filename url)) |
| 88 | (attribs (file-attributes fname))) | 88 | (attribs (file-attributes fname))) |
| 89 | (and fname ; got a filename | 89 | (and fname |
| 90 | (file-exists-p fname) ; file exists | 90 | (file-exists-p fname) |
| 91 | (not (eq (nth 0 attribs) t)) ; Its not a directory | 91 | (not (eq (file-attribute-type attribs) t)) |
| 92 | (nth 5 attribs)))) ; Can get last mod-time | 92 | (file-attribute-modification-time attribs)))) |
| 93 | 93 | ||
| 94 | (defun url-cache-create-filename-human-readable (url) | 94 | (defun url-cache-create-filename-human-readable (url) |
| 95 | "Return a filename in the local cache for URL." | 95 | "Return a filename in the local cache for URL." |
| @@ -226,7 +226,7 @@ considered \"expired\"." | |||
| 226 | (setq deleted-files (1+ deleted-files)))) | 226 | (setq deleted-files (1+ deleted-files)))) |
| 227 | ((time-less-p | 227 | ((time-less-p |
| 228 | (time-add | 228 | (time-add |
| 229 | (nth 5 (file-attributes file)) | 229 | (file-attribute-modification-time (file-attributes file)) |
| 230 | (seconds-to-time url-cache-expire-time)) | 230 | (seconds-to-time url-cache-expire-time)) |
| 231 | now) | 231 | now) |
| 232 | (delete-file file) | 232 | (delete-file file) |
diff --git a/lisp/url/url-file.el b/lisp/url/url-file.el index 1c7c20e7c83..02542ccbccc 100644 --- a/lisp/url/url-file.el +++ b/lisp/url/url-file.el | |||
| @@ -70,7 +70,7 @@ to them." | |||
| 70 | buff func | 70 | buff func |
| 71 | func args | 71 | func args |
| 72 | args efs)) | 72 | args efs)) |
| 73 | (let ((size (nth 7 (file-attributes name)))) | 73 | (let ((size (file-attribute-size (file-attributes name)))) |
| 74 | (with-current-buffer buff | 74 | (with-current-buffer buff |
| 75 | (goto-char (point-max)) | 75 | (goto-char (point-max)) |
| 76 | (if (/= -1 size) | 76 | (if (/= -1 size) |
diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el index b91a2ba45a4..6c189c13cd4 100644 --- a/lisp/vc/diff-mode.el +++ b/lisp/vc/diff-mode.el | |||
| @@ -1450,7 +1450,7 @@ modified lines of the diff." | |||
| 1450 | ;; can just remove the file altogether. Very handy for .rej files if we | 1450 | ;; can just remove the file altogether. Very handy for .rej files if we |
| 1451 | ;; remove hunks as we apply them. | 1451 | ;; remove hunks as we apply them. |
| 1452 | (when (and buffer-file-name | 1452 | (when (and buffer-file-name |
| 1453 | (eq 0 (nth 7 (file-attributes buffer-file-name)))) | 1453 | (eq 0 (file-attribute-size (file-attributes buffer-file-name)))) |
| 1454 | (delete-file buffer-file-name))) | 1454 | (delete-file buffer-file-name))) |
| 1455 | 1455 | ||
| 1456 | (defun diff-delete-empty-files () | 1456 | (defun diff-delete-empty-files () |
diff --git a/lisp/vc/pcvs-info.el b/lisp/vc/pcvs-info.el index edcfc6e6c4c..2947733a24a 100644 --- a/lisp/vc/pcvs-info.el +++ b/lisp/vc/pcvs-info.el | |||
| @@ -451,7 +451,8 @@ DIR can also be a file." | |||
| 451 | ((not (file-exists-p (concat dir f))) (setq type 'MISSING)) | 451 | ((not (file-exists-p (concat dir f))) (setq type 'MISSING)) |
| 452 | ((equal rev "0") (setq type 'ADDED rev nil)) | 452 | ((equal rev "0") (setq type 'ADDED rev nil)) |
| 453 | ((equal date "Result of merge") (setq subtype 'MERGED)) | 453 | ((equal date "Result of merge") (setq subtype 'MERGED)) |
| 454 | ((let ((mtime (nth 5 (file-attributes (concat dir f)))) | 454 | ((let ((mtime (file-attribute-modification-time |
| 455 | (file-attributes (concat dir f)))) | ||
| 455 | (system-time-locale "C")) | 456 | (system-time-locale "C")) |
| 456 | (setq timestamp (format-time-string "%c" mtime t)) | 457 | (setq timestamp (format-time-string "%c" mtime t)) |
| 457 | ;; Solaris sometimes uses "Wed Sep 05", not "Wed Sep 5". | 458 | ;; Solaris sometimes uses "Wed Sep 05", not "Wed Sep 5". |
diff --git a/lisp/vc/vc-bzr.el b/lisp/vc/vc-bzr.el index 630932fe371..aa3d1443aaa 100644 --- a/lisp/vc/vc-bzr.el +++ b/lisp/vc/vc-bzr.el | |||
| @@ -268,8 +268,8 @@ in the repository root directory of FILE." | |||
| 268 | ;; If file is in dirstate, can only be added (b#8025). | 268 | ;; If file is in dirstate, can only be added (b#8025). |
| 269 | ((or (not (match-beginning 4)) | 269 | ((or (not (match-beginning 4)) |
| 270 | (eq (char-after (match-beginning 4)) ?a)) 'added) | 270 | (eq (char-after (match-beginning 4)) ?a)) 'added) |
| 271 | ((or (and (eq (string-to-number (match-string 3)) | 271 | ((or (and (eql (string-to-number (match-string 3)) |
| 272 | (nth 7 (file-attributes file))) | 272 | (file-attribute-size (file-attributes file))) |
| 273 | (equal (match-string 5) | 273 | (equal (match-string 5) |
| 274 | (save-match-data (vc-bzr-sha1 file))) | 274 | (save-match-data (vc-bzr-sha1 file))) |
| 275 | ;; For a file, does the executable state match? | 275 | ;; For a file, does the executable state match? |
| @@ -281,7 +281,8 @@ in the repository root directory of FILE." | |||
| 281 | ?x | 281 | ?x |
| 282 | (mapcar | 282 | (mapcar |
| 283 | 'identity | 283 | 'identity |
| 284 | (nth 8 (file-attributes file)))))) | 284 | (file-attribute-modes |
| 285 | (file-attributes file)))))) | ||
| 285 | (if (eq (char-after (match-beginning 7)) | 286 | (if (eq (char-after (match-beginning 7)) |
| 286 | ?y) | 287 | ?y) |
| 287 | exe | 288 | exe |
| @@ -291,8 +292,8 @@ in the repository root directory of FILE." | |||
| 291 | ;; checkouts \2 is empty and we need to | 292 | ;; checkouts \2 is empty and we need to |
| 292 | ;; look for size in \6. | 293 | ;; look for size in \6. |
| 293 | (eq (match-beginning 2) (match-end 2)) | 294 | (eq (match-beginning 2) (match-end 2)) |
| 294 | (eq (string-to-number (match-string 6)) | 295 | (eql (string-to-number (match-string 6)) |
| 295 | (nth 7 (file-attributes file))) | 296 | (file-attribute-size (file-attributes file))) |
| 296 | (equal (match-string 5) | 297 | (equal (match-string 5) |
| 297 | (vc-bzr-sha1 file)))) | 298 | (vc-bzr-sha1 file)))) |
| 298 | 'up-to-date) | 299 | 'up-to-date) |
diff --git a/lisp/vc/vc-cvs.el b/lisp/vc/vc-cvs.el index 54ece6cc264..ac98d996d2c 100644 --- a/lisp/vc/vc-cvs.el +++ b/lisp/vc/vc-cvs.el | |||
| @@ -57,7 +57,7 @@ | |||
| 57 | ;; (We actually shouldn't trust this, but there is | 57 | ;; (We actually shouldn't trust this, but there is |
| 58 | ;; no other way to learn this from CVS at the | 58 | ;; no other way to learn this from CVS at the |
| 59 | ;; moment (version 1.9).) | 59 | ;; moment (version 1.9).) |
| 60 | (string-match "r-..-..-." (nth 8 attrib))) | 60 | (string-match "r-..-..-." (file-attribute-modes attrib))) |
| 61 | 'announce | 61 | 'announce |
| 62 | 'implicit)))))) | 62 | 'implicit)))))) |
| 63 | 63 | ||
| @@ -257,7 +257,7 @@ See also variable `vc-cvs-sticky-date-format-string'." | |||
| 257 | ;; If the file has not changed since checkout, consider it `up-to-date'. | 257 | ;; If the file has not changed since checkout, consider it `up-to-date'. |
| 258 | ;; Otherwise consider it `edited'. | 258 | ;; Otherwise consider it `edited'. |
| 259 | (let ((checkout-time (vc-file-getprop file 'vc-checkout-time)) | 259 | (let ((checkout-time (vc-file-getprop file 'vc-checkout-time)) |
| 260 | (lastmod (nth 5 (file-attributes file)))) | 260 | (lastmod (file-attribute-modification-time (file-attributes file)))) |
| 261 | (cond | 261 | (cond |
| 262 | ((equal checkout-time lastmod) 'up-to-date) | 262 | ((equal checkout-time lastmod) 'up-to-date) |
| 263 | ((string= (vc-working-revision file) "0") 'added) | 263 | ((string= (vc-working-revision file) "0") 'added) |
| @@ -524,7 +524,8 @@ The changes are between FIRST-REVISION and SECOND-REVISION." | |||
| 524 | (string= (match-string 1) "P ")) | 524 | (string= (match-string 1) "P ")) |
| 525 | (vc-file-setprop file 'vc-state 'up-to-date) | 525 | (vc-file-setprop file 'vc-state 'up-to-date) |
| 526 | (vc-file-setprop file 'vc-checkout-time | 526 | (vc-file-setprop file 'vc-checkout-time |
| 527 | (nth 5 (file-attributes file))) | 527 | (file-attribute-modification-time |
| 528 | (file-attributes file))) | ||
| 528 | 0);; indicate success to the caller | 529 | 0);; indicate success to the caller |
| 529 | ;; Merge successful, but our own changes are still in the file | 530 | ;; Merge successful, but our own changes are still in the file |
| 530 | ((string= (match-string 1) "M ") | 531 | ((string= (match-string 1) "M ") |
| @@ -748,7 +749,8 @@ If UPDATE is non-nil, then update (resynch) any affected buffers." | |||
| 748 | (vc-file-setprop file 'vc-state 'up-to-date) | 749 | (vc-file-setprop file 'vc-state 'up-to-date) |
| 749 | (vc-file-setprop file 'vc-working-revision nil) | 750 | (vc-file-setprop file 'vc-working-revision nil) |
| 750 | (vc-file-setprop file 'vc-checkout-time | 751 | (vc-file-setprop file 'vc-checkout-time |
| 751 | (nth 5 (file-attributes file)))) | 752 | (file-attribute-modification-time |
| 753 | (file-attributes file)))) | ||
| 752 | ((or (string= state "M") | 754 | ((or (string= state "M") |
| 753 | (string= state "C")) | 755 | (string= state "C")) |
| 754 | (vc-file-setprop file 'vc-state 'edited) | 756 | (vc-file-setprop file 'vc-state 'edited) |
| @@ -931,7 +933,8 @@ state." | |||
| 931 | (cond | 933 | (cond |
| 932 | ((string-match "Up-to-date" status) | 934 | ((string-match "Up-to-date" status) |
| 933 | (vc-file-setprop file 'vc-checkout-time | 935 | (vc-file-setprop file 'vc-checkout-time |
| 934 | (nth 5 (file-attributes file))) | 936 | (file-attribute-modification-time |
| 937 | (file-attributes file))) | ||
| 935 | 'up-to-date) | 938 | 'up-to-date) |
| 936 | ((string-match "Locally Modified" status) 'edited) | 939 | ((string-match "Locally Modified" status) 'edited) |
| 937 | ((string-match "Needs Merge" status) 'needs-merge) | 940 | ((string-match "Needs Merge" status) 'needs-merge) |
| @@ -1174,7 +1177,7 @@ is non-nil." | |||
| 1174 | ;; (which is based on textual comparison), because there can be problems | 1177 | ;; (which is based on textual comparison), because there can be problems |
| 1175 | ;; generating a time string that looks exactly like the one from CVS. | 1178 | ;; generating a time string that looks exactly like the one from CVS. |
| 1176 | (let* ((time (match-string 2)) | 1179 | (let* ((time (match-string 2)) |
| 1177 | (mtime (nth 5 (file-attributes file))) | 1180 | (mtime (file-attribute-modification-time (file-attributes file))) |
| 1178 | (parsed-time (progn (require 'parse-time) | 1181 | (parsed-time (progn (require 'parse-time) |
| 1179 | (parse-time-string (concat time " +0000"))))) | 1182 | (parse-time-string (concat time " +0000"))))) |
| 1180 | (cond ((and (not (string-match "\\+" time)) | 1183 | (cond ((and (not (string-match "\\+" time)) |
diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el index 76eec884a17..36965735959 100644 --- a/lisp/vc/vc-hg.el +++ b/lisp/vc/vc-hg.el | |||
| @@ -833,7 +833,7 @@ if we don't understand a construct, we signal | |||
| 833 | (with-temp-buffer | 833 | (with-temp-buffer |
| 834 | (let ((attr (file-attributes hgignore))) | 834 | (let ((attr (file-attributes hgignore))) |
| 835 | (when attr (insert-file-contents hgignore)) | 835 | (when attr (insert-file-contents hgignore)) |
| 836 | (push (list hgignore (nth 5 attr) (nth 7 attr)) | 836 | (push (list hgignore (file-attribute-modification-time attr) (file-attribute-size attr)) |
| 837 | vc-hg--hgignore-filenames)) | 837 | vc-hg--hgignore-filenames)) |
| 838 | (while (not (eobp)) | 838 | (while (not (eobp)) |
| 839 | ;; This list of pattern-file commands isn't complete, but it | 839 | ;; This list of pattern-file commands isn't complete, but it |
| @@ -897,8 +897,8 @@ REPO must be the directory name of an hg repository." | |||
| 897 | (saved-mtime (nth 1 fs)) | 897 | (saved-mtime (nth 1 fs)) |
| 898 | (saved-size (nth 2 fs)) | 898 | (saved-size (nth 2 fs)) |
| 899 | (attr (file-attributes (nth 0 fs))) | 899 | (attr (file-attributes (nth 0 fs))) |
| 900 | (current-mtime (nth 5 attr)) | 900 | (current-mtime (file-attribute-modification-time attr)) |
| 901 | (current-size (nth 7 attr))) | 901 | (current-size (file-attribute-size attr))) |
| 902 | (unless (and (equal saved-mtime current-mtime) | 902 | (unless (and (equal saved-mtime current-mtime) |
| 903 | (equal saved-size current-size)) | 903 | (equal saved-size current-size)) |
| 904 | (setf valid nil)))) | 904 | (setf valid nil)))) |
| @@ -968,8 +968,8 @@ Avoids the need to repeatedly scan dirstate on repeated calls to | |||
| 968 | `vc-hg-state', as we see during registration queries.") | 968 | `vc-hg-state', as we see during registration queries.") |
| 969 | 969 | ||
| 970 | (defun vc-hg--cached-dirstate-search (dirstate dirstate-attr ascii-fname) | 970 | (defun vc-hg--cached-dirstate-search (dirstate dirstate-attr ascii-fname) |
| 971 | (let* ((mtime (nth 5 dirstate-attr)) | 971 | (let* ((mtime (file-attribute-modification-time dirstate-attr)) |
| 972 | (size (nth 7 dirstate-attr)) | 972 | (size (file-attribute-size dirstate-attr)) |
| 973 | (cache vc-hg--dirstate-scan-cache) | 973 | (cache vc-hg--dirstate-scan-cache) |
| 974 | ) | 974 | ) |
| 975 | (if (and cache | 975 | (if (and cache |
| @@ -1012,7 +1012,7 @@ hg binary." | |||
| 1012 | ;; Repository must be in an understood format | 1012 | ;; Repository must be in an understood format |
| 1013 | (not (vc-hg--requirements-understood-p repo)) | 1013 | (not (vc-hg--requirements-understood-p repo)) |
| 1014 | ;; Dirstate too small to be valid | 1014 | ;; Dirstate too small to be valid |
| 1015 | (< (nth 7 dirstate-attr) 40) | 1015 | (< (file-attribute-size dirstate-attr) 40) |
| 1016 | (progn | 1016 | (progn |
| 1017 | (setf repo-relative-filename | 1017 | (setf repo-relative-filename |
| 1018 | (file-relative-name truename repo)) | 1018 | (file-relative-name truename repo)) |
| @@ -1036,8 +1036,9 @@ hg binary." | |||
| 1036 | ((eq state ?n) | 1036 | ((eq state ?n) |
| 1037 | (let ((vc-hg-size (nth 2 dirstate-entry)) | 1037 | (let ((vc-hg-size (nth 2 dirstate-entry)) |
| 1038 | (vc-hg-mtime (nth 3 dirstate-entry)) | 1038 | (vc-hg-mtime (nth 3 dirstate-entry)) |
| 1039 | (fs-size (nth 7 stat)) | 1039 | (fs-size (file-attribute-size stat)) |
| 1040 | (fs-mtime (vc-hg--time-to-integer (nth 5 stat)))) | 1040 | (fs-mtime (vc-hg--time-to-integer |
| 1041 | (file-attribute-modification-time stat)))) | ||
| 1041 | (if (and (eql vc-hg-size fs-size) (eql vc-hg-mtime fs-mtime)) | 1042 | (if (and (eql vc-hg-size fs-size) (eql vc-hg-mtime fs-mtime)) |
| 1042 | 'up-to-date | 1043 | 'up-to-date |
| 1043 | 'edited))) | 1044 | 'edited))) |
diff --git a/lisp/vc/vc-hooks.el b/lisp/vc/vc-hooks.el index f1b622b54a9..84e11f2e01d 100644 --- a/lisp/vc/vc-hooks.el +++ b/lisp/vc/vc-hooks.el | |||
| @@ -658,7 +658,7 @@ Before doing that, check if there are any old backups and get rid of them." | |||
| 658 | ;; If the file was saved in the same second in which it was | 658 | ;; If the file was saved in the same second in which it was |
| 659 | ;; checked out, clear the checkout-time to avoid confusion. | 659 | ;; checked out, clear the checkout-time to avoid confusion. |
| 660 | (if (equal (vc-file-getprop file 'vc-checkout-time) | 660 | (if (equal (vc-file-getprop file 'vc-checkout-time) |
| 661 | (nth 5 (file-attributes file))) | 661 | (file-attribute-modification-time (file-attributes file))) |
| 662 | (vc-file-setprop file 'vc-checkout-time nil)) | 662 | (vc-file-setprop file 'vc-checkout-time nil)) |
| 663 | (if (vc-state-refresh file backend) | 663 | (if (vc-state-refresh file backend) |
| 664 | (vc-mode-line file backend))) | 664 | (vc-mode-line file backend))) |
diff --git a/lisp/vc/vc-rcs.el b/lisp/vc/vc-rcs.el index 9fa52bf5dce..51a44439625 100644 --- a/lisp/vc/vc-rcs.el +++ b/lisp/vc/vc-rcs.el | |||
| @@ -955,11 +955,10 @@ Uses `rcs2log' which only works for RCS and CVS." | |||
| 955 | "Return non-nil if FILE is newer than its RCS master. | 955 | "Return non-nil if FILE is newer than its RCS master. |
| 956 | This likely means that FILE has been changed with respect | 956 | This likely means that FILE has been changed with respect |
| 957 | to its master version." | 957 | to its master version." |
| 958 | (let ((file-time (nth 5 (file-attributes file))) | 958 | (let ((file-time (file-attribute-modification-time (file-attributes file))) |
| 959 | (master-time (nth 5 (file-attributes (vc-master-name file))))) | 959 | (master-time (file-attribute-modification-time |
| 960 | (or (> (nth 0 file-time) (nth 0 master-time)) | 960 | (file-attributes (vc-master-name file))))) |
| 961 | (and (= (nth 0 file-time) (nth 0 master-time)) | 961 | (time-less-p master-time file-time))) |
| 962 | (> (nth 1 file-time) (nth 1 master-time)))))) | ||
| 963 | 962 | ||
| 964 | (defun vc-rcs-find-most-recent-rev (branch) | 963 | (defun vc-rcs-find-most-recent-rev (branch) |
| 965 | "Find most recent revision on BRANCH." | 964 | "Find most recent revision on BRANCH." |
diff --git a/lisp/vc/vc-svn.el b/lisp/vc/vc-svn.el index 2cbf34ba43a..4b1a34bd5f8 100644 --- a/lisp/vc/vc-svn.el +++ b/lisp/vc/vc-svn.el | |||
| @@ -479,7 +479,8 @@ The changes are between FIRST-VERSION and SECOND-VERSION." | |||
| 479 | ((string= (match-string 2) "U") | 479 | ((string= (match-string 2) "U") |
| 480 | (vc-file-setprop file 'vc-state 'up-to-date) | 480 | (vc-file-setprop file 'vc-state 'up-to-date) |
| 481 | (vc-file-setprop file 'vc-checkout-time | 481 | (vc-file-setprop file 'vc-checkout-time |
| 482 | (nth 5 (file-attributes file))) | 482 | (file-attribute-modification-time |
| 483 | (file-attributes file))) | ||
| 483 | 0);; indicate success to the caller | 484 | 0);; indicate success to the caller |
| 484 | ;; Merge successful, but our own changes are still in the file | 485 | ;; Merge successful, but our own changes are still in the file |
| 485 | ((string= (match-string 2) "G") | 486 | ((string= (match-string 2) "G") |
| @@ -729,7 +730,8 @@ Set file properties accordingly. If FILENAME is non-nil, return its status." | |||
| 729 | (if (eq (char-after (match-beginning 1)) ?*) | 730 | (if (eq (char-after (match-beginning 1)) ?*) |
| 730 | 'needs-update | 731 | 'needs-update |
| 731 | (vc-file-setprop file 'vc-checkout-time | 732 | (vc-file-setprop file 'vc-checkout-time |
| 732 | (nth 5 (file-attributes file))) | 733 | (file-attribute-modification-time |
| 734 | (file-attributes file))) | ||
| 733 | 'up-to-date)) | 735 | 'up-to-date)) |
| 734 | ((eq status ?A) | 736 | ((eq status ?A) |
| 735 | ;; If the file was actually copied, (match-string 2) is "-". | 737 | ;; If the file was actually copied, (match-string 2) is "-". |
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 487594b2d54..d3d66d6fb5f 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el | |||
| @@ -1481,7 +1481,8 @@ After check-out, runs the normal hook `vc-checkout-hook'." | |||
| 1481 | nil) | 1481 | nil) |
| 1482 | 'up-to-date | 1482 | 'up-to-date |
| 1483 | 'edited)) | 1483 | 'edited)) |
| 1484 | (vc-checkout-time . ,(nth 5 (file-attributes file)))))) | 1484 | (vc-checkout-time . ,(file-attribute-modification-time |
| 1485 | (file-attributes file)))))) | ||
| 1485 | (vc-resynch-buffer file t t) | 1486 | (vc-resynch-buffer file t t) |
| 1486 | (run-hooks 'vc-checkout-hook)) | 1487 | (run-hooks 'vc-checkout-hook)) |
| 1487 | 1488 | ||
| @@ -1558,7 +1559,8 @@ Runs the normal hooks `vc-before-checkin-hook' and `vc-checkin-hook'." | |||
| 1558 | (vc-call-backend backend 'checkin files comment rev) | 1559 | (vc-call-backend backend 'checkin files comment rev) |
| 1559 | (mapc 'vc-delete-automatic-version-backups files)) | 1560 | (mapc 'vc-delete-automatic-version-backups files)) |
| 1560 | `((vc-state . up-to-date) | 1561 | `((vc-state . up-to-date) |
| 1561 | (vc-checkout-time . ,(nth 5 (file-attributes file))) | 1562 | (vc-checkout-time . ,(file-attribute-modification-time |
| 1563 | (file-attributes file))) | ||
| 1562 | (vc-working-revision . nil))) | 1564 | (vc-working-revision . nil))) |
| 1563 | (message "Checking in %s...done" (vc-delistify files))) | 1565 | (message "Checking in %s...done" (vc-delistify files))) |
| 1564 | 'vc-checkin-hook | 1566 | 'vc-checkin-hook |
| @@ -2568,7 +2570,8 @@ its name; otherwise return nil." | |||
| 2568 | (vc-delete-automatic-version-backups file)) | 2570 | (vc-delete-automatic-version-backups file)) |
| 2569 | (vc-call revert file backup-file)) | 2571 | (vc-call revert file backup-file)) |
| 2570 | `((vc-state . up-to-date) | 2572 | `((vc-state . up-to-date) |
| 2571 | (vc-checkout-time . ,(nth 5 (file-attributes file))))) | 2573 | (vc-checkout-time . ,(file-attribute-modification-time |
| 2574 | (file-attributes file))))) | ||
| 2572 | (vc-resynch-buffer file t t)) | 2575 | (vc-resynch-buffer file t t)) |
| 2573 | 2576 | ||
| 2574 | ;;;###autoload | 2577 | ;;;###autoload |
diff --git a/lisp/xdg.el b/lisp/xdg.el index a896eb855a8..f8183249d5a 100644 --- a/lisp/xdg.el +++ b/lisp/xdg.el | |||
| @@ -295,7 +295,9 @@ Results are cached in `xdg-mime-table'." | |||
| 295 | (files ())) | 295 | (files ())) |
| 296 | (let ((mtim1 (get 'xdg-mime-table 'mtime)) | 296 | (let ((mtim1 (get 'xdg-mime-table 'mtime)) |
| 297 | (mtim2 (cl-loop for f in caches when (file-readable-p f) | 297 | (mtim2 (cl-loop for f in caches when (file-readable-p f) |
| 298 | maximize (float-time (nth 5 (file-attributes f)))))) | 298 | maximize (float-time |
| 299 | (file-attribute-modification-time | ||
| 300 | (file-attributes f)))))) | ||
| 299 | ;; If one of the MIME/Desktop cache files has been modified: | 301 | ;; If one of the MIME/Desktop cache files has been modified: |
| 300 | (when (or (null mtim1) (time-less-p mtim1 mtim2)) | 302 | (when (or (null mtim1) (time-less-p mtim1 mtim2)) |
| 301 | (setq xdg-mime-table nil))) | 303 | (setq xdg-mime-table nil))) |
diff --git a/src/buffer.c b/src/buffer.c index 1f18dbd11a8..024e64f0d74 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -6010,11 +6010,11 @@ An entry (TEXT . POSITION) represents the deletion of the string TEXT | |||
| 6010 | from (abs POSITION). If POSITION is positive, point was at the front | 6010 | from (abs POSITION). If POSITION is positive, point was at the front |
| 6011 | of the text being deleted; if negative, point was at the end. | 6011 | of the text being deleted; if negative, point was at the end. |
| 6012 | 6012 | ||
| 6013 | An entry (t HIGH LOW USEC PSEC) indicates that the buffer was previously | 6013 | An entry (t . TIMESTAMP), where TIMESTAMP is in the style of |
| 6014 | unmodified; (HIGH LOW USEC PSEC) is in the same style as (current-time) | 6014 | `current-time', indicates that the buffer was previously unmodified; |
| 6015 | and is the visited file's modification time, as of that time. If the | 6015 | TIMESTAMP is the visited file's modification time, as of that time. |
| 6016 | modification time of the most recent save is different, this entry is | 6016 | If the modification time of the most recent save is different, this |
| 6017 | obsolete. | 6017 | entry is obsolete. |
| 6018 | 6018 | ||
| 6019 | An entry (t . 0) means the buffer was previously unmodified but | 6019 | An entry (t . 0) means the buffer was previously unmodified but |
| 6020 | its time stamp was unknown because it was not associated with a file. | 6020 | its time stamp was unknown because it was not associated with a file. |
diff --git a/src/dired.c b/src/dired.c index 70c5bb24b4e..7ad401c728b 100644 --- a/src/dired.c +++ b/src/dired.c | |||
| @@ -347,7 +347,7 @@ DEFUN ("directory-files-and-attributes", Fdirectory_files_and_attributes, | |||
| 347 | doc: /* Return a list of names of files and their attributes in DIRECTORY. | 347 | doc: /* Return a list of names of files and their attributes in DIRECTORY. |
| 348 | Value is a list of the form: | 348 | Value is a list of the form: |
| 349 | 349 | ||
| 350 | ((FILE1 FILE1-ATTRS) (FILE2 FILE2-ATTRS) ...) | 350 | ((FILE1 . FILE1-ATTRS) (FILE2 . FILE2-ATTRS) ...) |
| 351 | 351 | ||
| 352 | where each FILEn-ATTRS is the attributes of FILEn as returned | 352 | where each FILEn-ATTRS is the attributes of FILEn as returned |
| 353 | by `file-attributes'. | 353 | by `file-attributes'. |
| @@ -866,26 +866,22 @@ provided: `file-attribute-type', `file-attribute-link-number', | |||
| 866 | Elements of the attribute list are: | 866 | Elements of the attribute list are: |
| 867 | 0. t for directory, string (name linked to) for symbolic link, or nil. | 867 | 0. t for directory, string (name linked to) for symbolic link, or nil. |
| 868 | 1. Number of links to file. | 868 | 1. Number of links to file. |
| 869 | 2. File uid as a string or a number. If a string value cannot be | 869 | 2. File uid as a string or (if ID-FORMAT is `integer' or a string value |
| 870 | looked up, an integer value is returned, which could be a fixnum, | 870 | cannot be looked up) as an integer. |
| 871 | if it's small enough, otherwise a bignum. | ||
| 872 | 3. File gid, likewise. | 871 | 3. File gid, likewise. |
| 873 | 4. Last access time, as a list of integers (HIGH LOW USEC PSEC) in the | 872 | 4. Last access time, in the style of `current-time'. |
| 874 | same style as (current-time). | ||
| 875 | (See a note below about access time on FAT-based filesystems.) | 873 | (See a note below about access time on FAT-based filesystems.) |
| 876 | 5. Last modification time, likewise. This is the time of the last | 874 | 5. Last modification time, likewise. This is the time of the last |
| 877 | change to the file's contents. | 875 | change to the file's contents. |
| 878 | 6. Last status change time, likewise. This is the time of last change | 876 | 6. Last status change time, likewise. This is the time of last change |
| 879 | to the file's attributes: owner and group, access mode bits, etc. | 877 | to the file's attributes: owner and group, access mode bits, etc. |
| 880 | 7. Size in bytes, which could be a fixnum, if it's small enough, | 878 | 7. Size in bytes, as an integer. |
| 881 | otherwise a bignum. | ||
| 882 | 8. File modes, as a string of ten letters or dashes as in ls -l. | 879 | 8. File modes, as a string of ten letters or dashes as in ls -l. |
| 883 | 9. An unspecified value, present only for backward compatibility. | 880 | 9. An unspecified value, present only for backward compatibility. |
| 884 | 10. inode number, which could be a fixnum, if it's small enough, | 881 | 10. inode number, as a nonnegative integer. |
| 885 | otherwise a bignum. | 882 | 11. Filesystem device number, as an integer. |
| 886 | 11. Filesystem device number. If it is larger than what a fixnum | ||
| 887 | can hold, it is a bignum. | ||
| 888 | 883 | ||
| 884 | Large integers are bignums, so `eq' might not work on them. | ||
| 889 | On most filesystems, the combination of the inode and the device | 885 | On most filesystems, the combination of the inode and the device |
| 890 | number uniquely identifies the file. | 886 | number uniquely identifies the file. |
| 891 | 887 | ||
diff --git a/src/editfns.c b/src/editfns.c index 047a73f0b8c..ec6e8ba98d6 100644 --- a/src/editfns.c +++ b/src/editfns.c | |||
| @@ -1656,8 +1656,7 @@ See `current-time-string' for the various forms of a time value. */) | |||
| 1656 | DEFUN ("get-internal-run-time", Fget_internal_run_time, Sget_internal_run_time, | 1656 | DEFUN ("get-internal-run-time", Fget_internal_run_time, Sget_internal_run_time, |
| 1657 | 0, 0, 0, | 1657 | 0, 0, 0, |
| 1658 | doc: /* Return the current run time used by Emacs. | 1658 | doc: /* Return the current run time used by Emacs. |
| 1659 | The time is returned as a list (HIGH LOW USEC PSEC), using the same | 1659 | The time is returned as in the style of `current-time'. |
| 1660 | style as (current-time). | ||
| 1661 | 1660 | ||
| 1662 | On systems that can't determine the run time, `get-internal-run-time' | 1661 | On systems that can't determine the run time, `get-internal-run-time' |
| 1663 | does the same thing as `current-time'. */) | 1662 | does the same thing as `current-time'. */) |
diff --git a/src/fileio.c b/src/fileio.c index 5ca7c595f7d..7fb865809f5 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -5454,10 +5454,9 @@ See Info node `(elisp)Modification Time' for more details. */) | |||
| 5454 | DEFUN ("visited-file-modtime", Fvisited_file_modtime, | 5454 | DEFUN ("visited-file-modtime", Fvisited_file_modtime, |
| 5455 | Svisited_file_modtime, 0, 0, 0, | 5455 | Svisited_file_modtime, 0, 0, 0, |
| 5456 | doc: /* Return the current buffer's recorded visited file modification time. | 5456 | doc: /* Return the current buffer's recorded visited file modification time. |
| 5457 | The value is a list of the form (HIGH LOW USEC PSEC), like the time values that | 5457 | Return a Lisp timestamp (as in `current-time') if the current buffer |
| 5458 | `file-attributes' returns. If the current buffer has no recorded file | 5458 | has a recorded file modification time, 0 if it doesn't, and -1 if the |
| 5459 | modification time, this function returns 0. If the visited file | 5459 | visited file doesn't exist. |
| 5460 | doesn't exist, return -1. | ||
| 5461 | See Info node `(elisp)Modification Time' for more details. */) | 5460 | See Info node `(elisp)Modification Time' for more details. */) |
| 5462 | (void) | 5461 | (void) |
| 5463 | { | 5462 | { |
| @@ -5473,9 +5472,8 @@ DEFUN ("set-visited-file-modtime", Fset_visited_file_modtime, | |||
| 5473 | Useful if the buffer was not read from the file normally | 5472 | Useful if the buffer was not read from the file normally |
| 5474 | or if the file itself has been changed for some known benign reason. | 5473 | or if the file itself has been changed for some known benign reason. |
| 5475 | An argument specifies the modification time value to use | 5474 | An argument specifies the modification time value to use |
| 5476 | \(instead of that of the visited file), in the form of a list | 5475 | \(instead of that of the visited file), in the form of a time value as |
| 5477 | \(HIGH LOW USEC PSEC) or an integer flag as returned by | 5476 | in `current-time' or an integer flag as returned by `visited-file-modtime'. */) |
| 5478 | `visited-file-modtime'. */) | ||
| 5479 | (Lisp_Object time_flag) | 5477 | (Lisp_Object time_flag) |
| 5480 | { | 5478 | { |
| 5481 | if (!NILP (time_flag)) | 5479 | if (!NILP (time_flag)) |
diff --git a/src/keyboard.c b/src/keyboard.c index 008d3b9d7c0..1c1f1514ae8 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -4377,8 +4377,8 @@ timer_check (void) | |||
| 4377 | 4377 | ||
| 4378 | DEFUN ("current-idle-time", Fcurrent_idle_time, Scurrent_idle_time, 0, 0, 0, | 4378 | DEFUN ("current-idle-time", Fcurrent_idle_time, Scurrent_idle_time, 0, 0, 0, |
| 4379 | doc: /* Return the current length of Emacs idleness, or nil. | 4379 | doc: /* Return the current length of Emacs idleness, or nil. |
| 4380 | The value when Emacs is idle is a list of four integers (HIGH LOW USEC PSEC) | 4380 | The value when Emacs is idle is a Lisp timestamp in the style of |
| 4381 | in the same style as (current-time). | 4381 | `current-time'. |
| 4382 | 4382 | ||
| 4383 | The value when Emacs is not idle is nil. | 4383 | The value when Emacs is not idle is nil. |
| 4384 | 4384 | ||
diff --git a/src/process.c b/src/process.c index b4ba641f31b..a9638dfc2df 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -7934,8 +7934,7 @@ integer or floating point values. | |||
| 7934 | majflt -- number of major page faults (number) | 7934 | majflt -- number of major page faults (number) |
| 7935 | cminflt -- cumulative number of minor page faults (number) | 7935 | cminflt -- cumulative number of minor page faults (number) |
| 7936 | cmajflt -- cumulative number of major page faults (number) | 7936 | cmajflt -- cumulative number of major page faults (number) |
| 7937 | utime -- user time used by the process, in (current-time) format, | 7937 | utime -- user time used by the process, in `current-time' format |
| 7938 | which is a list of integers (HIGH LOW USEC PSEC) | ||
| 7939 | stime -- system time used by the process (current-time) | 7938 | stime -- system time used by the process (current-time) |
| 7940 | time -- sum of utime and stime (current-time) | 7939 | time -- sum of utime and stime (current-time) |
| 7941 | cutime -- user time used by the process and its children (current-time) | 7940 | cutime -- user time used by the process and its children (current-time) |
| @@ -7947,7 +7946,7 @@ integer or floating point values. | |||
| 7947 | start -- time the process started (current-time) | 7946 | start -- time the process started (current-time) |
| 7948 | vsize -- virtual memory size of the process in KB's (number) | 7947 | vsize -- virtual memory size of the process in KB's (number) |
| 7949 | rss -- resident set size of the process in KB's (number) | 7948 | rss -- resident set size of the process in KB's (number) |
| 7950 | etime -- elapsed time the process is running, in (HIGH LOW USEC PSEC) format | 7949 | etime -- elapsed time the process is running (current-time) |
| 7951 | pcpu -- percents of CPU time used by the process (floating-point number) | 7950 | pcpu -- percents of CPU time used by the process (floating-point number) |
| 7952 | pmem -- percents of total physical memory used by process's resident set | 7951 | pmem -- percents of total physical memory used by process's resident set |
| 7953 | (floating-point number) | 7952 | (floating-point number) |