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'.
This commit is contained in:
parent
3da935d533
commit
eeffc1f5ae
6 changed files with 13 additions and 11 deletions
|
@ -1413,7 +1413,7 @@ to distinguish remote filesystems from local ones.
|
|||
The file's inode and device together give enough information
|
||||
to distinguish any two files on the system---no two files can have the
|
||||
same values for both of these attributes. This tuple that uniquely
|
||||
identifies the file is returned by @code{file-attribute-file-number}.
|
||||
identifies the file is returned by @code{file-attribute-file-identifier}.
|
||||
|
||||
For example, here are the file attributes for @file{files.texi}:
|
||||
|
||||
|
|
2
etc/NEWS
2
etc/NEWS
|
@ -3159,7 +3159,7 @@ The following generalized variables have been made obsolete:
|
|||
* Lisp Changes in Emacs 29.1
|
||||
|
||||
+++
|
||||
** New accessor function 'file-attribute-file-number'.
|
||||
** New accessor function 'file-attribute-file-identifier'.
|
||||
It returns the list of the inode number and device identifier
|
||||
retrieved by 'file-attributes'. This value can be used to identify a
|
||||
file uniquely. The device identifier can be a single number or (for
|
||||
|
|
|
@ -374,8 +374,8 @@ Remove the DIRECTORY(ies), if they are empty.")
|
|||
(file-attribute-inode-number attr)
|
||||
(file-attribute-device-number attr-target)
|
||||
(file-attribute-device-number attr)
|
||||
(equal (file-attribute-file-number attr-target)
|
||||
(file-attribute-file-number attr)))
|
||||
(equal (file-attribute-file-identifier attr-target)
|
||||
(file-attribute-file-identifier attr)))
|
||||
(eshell-error (format-message "%s: `%s' and `%s' are the same file\n"
|
||||
command (car files) target)))
|
||||
(t
|
||||
|
|
|
@ -2164,7 +2164,7 @@ If there is no such live buffer, return nil."
|
|||
(setq list (cdr list)))
|
||||
found)
|
||||
(let* ((attributes (file-attributes truename))
|
||||
(number (file-attribute-file-number attributes))
|
||||
(number (file-attribute-file-identifier attributes))
|
||||
(list (buffer-list)) found)
|
||||
(and buffer-file-numbers-unique
|
||||
(car-safe number) ;Make sure the inode is not just nil.
|
||||
|
@ -2367,7 +2367,7 @@ the various files."
|
|||
(let* ((buf (get-file-buffer filename))
|
||||
(truename (abbreviate-file-name (file-truename filename)))
|
||||
(attributes (file-attributes truename))
|
||||
(number (file-attribute-file-number attributes))
|
||||
(number (file-attribute-file-identifier attributes))
|
||||
;; Find any buffer for a file that has same truename.
|
||||
(other (and (not buf)
|
||||
(find-buffer-visiting
|
||||
|
@ -4745,7 +4745,7 @@ the old visited file has been renamed to the new name FILENAME."
|
|||
(setq buffer-file-name truename))))
|
||||
(setq buffer-file-number
|
||||
(if filename
|
||||
(file-attribute-file-number (file-attributes buffer-file-name))
|
||||
(file-attribute-file-identifier (file-attributes buffer-file-name))
|
||||
nil))
|
||||
;; write-file-functions is normally used for things like ftp-find-file
|
||||
;; 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
|
|||
(setq save-buffer-coding-system last-coding-system-used)
|
||||
(setq buffer-file-coding-system last-coding-system-used))
|
||||
(setq buffer-file-number
|
||||
(file-attribute-file-number (file-attributes buffer-file-name)))
|
||||
(file-attribute-file-identifier
|
||||
(file-attributes buffer-file-name)))
|
||||
(if setmodes
|
||||
(condition-case ()
|
||||
(progn
|
||||
|
@ -8662,7 +8663,7 @@ It is a nonnegative integer."
|
|||
It is an integer or a cons cell of integers."
|
||||
(nth 11 attributes))
|
||||
|
||||
(defsubst file-attribute-file-number (attributes)
|
||||
(defsubst file-attribute-file-identifier (attributes)
|
||||
"The inode and device numbers in ATTRIBUTES returned by `file-attributes'.
|
||||
The value is a list of the form (INODENUM DEVICE), where DEVICE could be
|
||||
either a single number or a cons cell of two numbers.
|
||||
|
|
|
@ -458,7 +458,8 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'."
|
|||
;; The Windows version doesn't report meaningful inode numbers, so
|
||||
;; use the canonicalized absolute file name of the directory instead.
|
||||
(setq attrs (or canonicalized
|
||||
(file-attribute-file-number (file-attributes this-dir))))
|
||||
(file-attribute-file-identifier
|
||||
(file-attributes this-dir))))
|
||||
(unless (member attrs normal-top-level-add-subdirs-inode-list)
|
||||
(push attrs normal-top-level-add-subdirs-inode-list)
|
||||
(dolist (file contents)
|
||||
|
|
|
@ -928,7 +928,7 @@ Elements of the attribute list are:
|
|||
Large integers are bignums, so `eq' might not work on them.
|
||||
On most filesystems, the combination of the inode and the device
|
||||
identifier uniquely identifies the file. This unique file identification
|
||||
is provided by the access function `file-attribute-file-number'.
|
||||
is provided by the access function `file-attribute-file-identifier'.
|
||||
|
||||
On MS-Windows, performance depends on `w32-get-true-file-attributes',
|
||||
which see.
|
||||
|
|
Loading…
Add table
Reference in a new issue