bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#58446: 28.2; file-attribute-device-number returns a cons cell instea


From: Michael Albinus
Subject: bug#58446: 28.2; file-attribute-device-number returns a cons cell instead of an integer
Date: Fri, 14 Oct 2022 19:28:10 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Stefan Monnier <monnier@iro.umontreal.ca> writes:

Hi Stefan,

>> (defsubst file-attribute-file-number (attributes)
>>   "The inode and device numbers in ATTRIBUTES returned by `file-attributes'.
>> It can be used to determine whether two files are identical."
>>   (nthcdr 10 attributes))
>>
>> WDYT?
>
> Sounds good, except:
>
> - The name `file-attribute-file-number` doesn't sound right
>   because it doesn't return a number.

The name is a reminiscence of the existing variable buffer-file-number,
which serves exactly the same purpose.

> - I wouldn't use `defsubst` (so it can more easily be modified in the
>   future, e.g. in case we add more fields to the attributes or use some
>   other representation for attributes).

All other accessor functions for file-attributes are defsubsts.

> - I would document it more abstractly, mentioning inode and device
>   number only as *examples* of things it might contain.

There is no intention to use it for anything else. It shall return
(nthcdr 10 attributes) like all the other file-attributes accessor
functions return for the respective slots.

>         Stefan

Best regards, Michael.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]