diff options
| author | Michael Albinus | 2022-10-14 21:32:15 +0200 |
|---|---|---|
| committer | Michael Albinus | 2022-10-14 21:32:15 +0200 |
| commit | eeffc1f5ae36284e8d08c0f529e115032d7e0d04 (patch) | |
| tree | 55ac8a32b7d3fba9a0029de6fc199c29e66d092a | |
| parent | 3da935d5339dfb43cb1be2df5f83b74b4e34ccc1 (diff) | |
| download | emacs-eeffc1f5ae36284e8d08c0f529e115032d7e0d04.tar.gz emacs-eeffc1f5ae36284e8d08c0f529e115032d7e0d04.zip | |
Rename `file-attribute-file-number' to `file-attribute-file-identifier'
* doc/lispref/files.texi (File Attributes):
* etc/NEWS:
* lisp/files.el (find-buffer-visiting, find-file-noselect)
(set-visited-file-name, basic-save-buffer)
(file-attribute-file-identifier):
* lisp/startup.el (normal-top-level-add-subdirs-to-load-path):
* lisp/eshell/em-unix.el (eshell-shuffle-files):
* src/dired.c (Ffile_attributes):
Rename `file-attribute-file-number' to `file-attribute-file-identifier'.
| -rw-r--r-- | doc/lispref/files.texi | 2 | ||||
| -rw-r--r-- | etc/NEWS | 2 | ||||
| -rw-r--r-- | lisp/eshell/em-unix.el | 4 | ||||
| -rw-r--r-- | lisp/files.el | 11 | ||||
| -rw-r--r-- | lisp/startup.el | 3 | ||||
| -rw-r--r-- | src/dired.c | 2 |
6 files changed, 13 insertions, 11 deletions
diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi index 2467364dc6e..b26d4f10585 100644 --- a/doc/lispref/files.texi +++ b/doc/lispref/files.texi | |||
| @@ -1413,7 +1413,7 @@ to distinguish remote filesystems from local ones. | |||
| 1413 | The file's inode and device together give enough information | 1413 | The file's inode and device together give enough information |
| 1414 | to distinguish any two files on the system---no two files can have the | 1414 | to distinguish any two files on the system---no two files can have the |
| 1415 | same values for both of these attributes. This tuple that uniquely | 1415 | same values for both of these attributes. This tuple that uniquely |
| 1416 | identifies the file is returned by @code{file-attribute-file-number}. | 1416 | identifies the file is returned by @code{file-attribute-file-identifier}. |
| 1417 | 1417 | ||
| 1418 | For example, here are the file attributes for @file{files.texi}: | 1418 | For example, here are the file attributes for @file{files.texi}: |
| 1419 | 1419 | ||
| @@ -3159,7 +3159,7 @@ The following generalized variables have been made obsolete: | |||
| 3159 | * Lisp Changes in Emacs 29.1 | 3159 | * Lisp Changes in Emacs 29.1 |
| 3160 | 3160 | ||
| 3161 | +++ | 3161 | +++ |
| 3162 | ** New accessor function 'file-attribute-file-number'. | 3162 | ** New accessor function 'file-attribute-file-identifier'. |
| 3163 | It returns the list of the inode number and device identifier | 3163 | It returns the list of the inode number and device identifier |
| 3164 | retrieved by 'file-attributes'. This value can be used to identify a | 3164 | retrieved by 'file-attributes'. This value can be used to identify a |
| 3165 | file uniquely. The device identifier can be a single number or (for | 3165 | file uniquely. The device identifier can be a single number or (for |
diff --git a/lisp/eshell/em-unix.el b/lisp/eshell/em-unix.el index 378b0ceeeae..4b5e4dd53ed 100644 --- a/lisp/eshell/em-unix.el +++ b/lisp/eshell/em-unix.el | |||
| @@ -374,8 +374,8 @@ Remove the DIRECTORY(ies), if they are empty.") | |||
| 374 | (file-attribute-inode-number attr) | 374 | (file-attribute-inode-number attr) |
| 375 | (file-attribute-device-number attr-target) | 375 | (file-attribute-device-number attr-target) |
| 376 | (file-attribute-device-number attr) | 376 | (file-attribute-device-number attr) |
| 377 | (equal (file-attribute-file-number attr-target) | 377 | (equal (file-attribute-file-identifier attr-target) |
| 378 | (file-attribute-file-number attr))) | 378 | (file-attribute-file-identifier attr))) |
| 379 | (eshell-error (format-message "%s: `%s' and `%s' are the same file\n" | 379 | (eshell-error (format-message "%s: `%s' and `%s' are the same file\n" |
| 380 | command (car files) target))) | 380 | command (car files) target))) |
| 381 | (t | 381 | (t |
diff --git a/lisp/files.el b/lisp/files.el index dd10f7399cc..3fa0f2f3b81 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -2164,7 +2164,7 @@ If there is no such live buffer, return nil." | |||
| 2164 | (setq list (cdr list))) | 2164 | (setq list (cdr list))) |
| 2165 | found) | 2165 | found) |
| 2166 | (let* ((attributes (file-attributes truename)) | 2166 | (let* ((attributes (file-attributes truename)) |
| 2167 | (number (file-attribute-file-number attributes)) | 2167 | (number (file-attribute-file-identifier attributes)) |
| 2168 | (list (buffer-list)) found) | 2168 | (list (buffer-list)) found) |
| 2169 | (and buffer-file-numbers-unique | 2169 | (and buffer-file-numbers-unique |
| 2170 | (car-safe number) ;Make sure the inode is not just nil. | 2170 | (car-safe number) ;Make sure the inode is not just nil. |
| @@ -2367,7 +2367,7 @@ the various files." | |||
| 2367 | (let* ((buf (get-file-buffer filename)) | 2367 | (let* ((buf (get-file-buffer filename)) |
| 2368 | (truename (abbreviate-file-name (file-truename filename))) | 2368 | (truename (abbreviate-file-name (file-truename filename))) |
| 2369 | (attributes (file-attributes truename)) | 2369 | (attributes (file-attributes truename)) |
| 2370 | (number (file-attribute-file-number attributes)) | 2370 | (number (file-attribute-file-identifier attributes)) |
| 2371 | ;; Find any buffer for a file that has same truename. | 2371 | ;; Find any buffer for a file that has same truename. |
| 2372 | (other (and (not buf) | 2372 | (other (and (not buf) |
| 2373 | (find-buffer-visiting | 2373 | (find-buffer-visiting |
| @@ -4745,7 +4745,7 @@ the old visited file has been renamed to the new name FILENAME." | |||
| 4745 | (setq buffer-file-name truename)))) | 4745 | (setq buffer-file-name truename)))) |
| 4746 | (setq buffer-file-number | 4746 | (setq buffer-file-number |
| 4747 | (if filename | 4747 | (if filename |
| 4748 | (file-attribute-file-number (file-attributes buffer-file-name)) | 4748 | (file-attribute-file-identifier (file-attributes buffer-file-name)) |
| 4749 | nil)) | 4749 | nil)) |
| 4750 | ;; write-file-functions is normally used for things like ftp-find-file | 4750 | ;; write-file-functions is normally used for things like ftp-find-file |
| 4751 | ;; that visit things that are not local files as if they were files. | 4751 | ;; that visit things that are not local files as if they were files. |
| @@ -5734,7 +5734,8 @@ Before and after saving the buffer, this function runs | |||
| 5734 | (setq save-buffer-coding-system last-coding-system-used) | 5734 | (setq save-buffer-coding-system last-coding-system-used) |
| 5735 | (setq buffer-file-coding-system last-coding-system-used)) | 5735 | (setq buffer-file-coding-system last-coding-system-used)) |
| 5736 | (setq buffer-file-number | 5736 | (setq buffer-file-number |
| 5737 | (file-attribute-file-number (file-attributes buffer-file-name))) | 5737 | (file-attribute-file-identifier |
| 5738 | (file-attributes buffer-file-name))) | ||
| 5738 | (if setmodes | 5739 | (if setmodes |
| 5739 | (condition-case () | 5740 | (condition-case () |
| 5740 | (progn | 5741 | (progn |
| @@ -8662,7 +8663,7 @@ It is a nonnegative integer." | |||
| 8662 | It is an integer or a cons cell of integers." | 8663 | It is an integer or a cons cell of integers." |
| 8663 | (nth 11 attributes)) | 8664 | (nth 11 attributes)) |
| 8664 | 8665 | ||
| 8665 | (defsubst file-attribute-file-number (attributes) | 8666 | (defsubst file-attribute-file-identifier (attributes) |
| 8666 | "The inode and device numbers in ATTRIBUTES returned by `file-attributes'. | 8667 | "The inode and device numbers in ATTRIBUTES returned by `file-attributes'. |
| 8667 | The value is a list of the form (INODENUM DEVICE), where DEVICE could be | 8668 | The value is a list of the form (INODENUM DEVICE), where DEVICE could be |
| 8668 | either a single number or a cons cell of two numbers. | 8669 | either a single number or a cons cell of two numbers. |
diff --git a/lisp/startup.el b/lisp/startup.el index c7faf4abc6f..725984b815b 100644 --- a/lisp/startup.el +++ b/lisp/startup.el | |||
| @@ -458,7 +458,8 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'." | |||
| 458 | ;; The Windows version doesn't report meaningful inode numbers, so | 458 | ;; The Windows version doesn't report meaningful inode numbers, so |
| 459 | ;; use the canonicalized absolute file name of the directory instead. | 459 | ;; use the canonicalized absolute file name of the directory instead. |
| 460 | (setq attrs (or canonicalized | 460 | (setq attrs (or canonicalized |
| 461 | (file-attribute-file-number (file-attributes this-dir)))) | 461 | (file-attribute-file-identifier |
| 462 | (file-attributes this-dir)))) | ||
| 462 | (unless (member attrs normal-top-level-add-subdirs-inode-list) | 463 | (unless (member attrs normal-top-level-add-subdirs-inode-list) |
| 463 | (push attrs normal-top-level-add-subdirs-inode-list) | 464 | (push attrs normal-top-level-add-subdirs-inode-list) |
| 464 | (dolist (file contents) | 465 | (dolist (file contents) |
diff --git a/src/dired.c b/src/dired.c index 1b4edf20483..ef729df5d2b 100644 --- a/src/dired.c +++ b/src/dired.c | |||
| @@ -928,7 +928,7 @@ Elements of the attribute list are: | |||
| 928 | Large integers are bignums, so `eq' might not work on them. | 928 | Large integers are bignums, so `eq' might not work on them. |
| 929 | On most filesystems, the combination of the inode and the device | 929 | On most filesystems, the combination of the inode and the device |
| 930 | identifier uniquely identifies the file. This unique file identification | 930 | identifier uniquely identifies the file. This unique file identification |
| 931 | is provided by the access function `file-attribute-file-number'. | 931 | is provided by the access function `file-attribute-file-identifier'. |
| 932 | 932 | ||
| 933 | On MS-Windows, performance depends on `w32-get-true-file-attributes', | 933 | On MS-Windows, performance depends on `w32-get-true-file-attributes', |
| 934 | which see. | 934 | which see. |