[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#22890: 25.1.50; Wishlist: There should be file-attribute accessors
From: |
Andy Moreton |
Subject: |
bug#22890: 25.1.50; Wishlist: There should be file-attribute accessors |
Date: |
Fri, 04 Mar 2016 16:17:54 +0000 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.92 (windows-nt) |
On Fri 04 Mar 2016, Lars Ingebrigtsen wrote:
> Lars Ingebrigtsen <larsi@gnus.org> writes:
>
>> `file-attributes' returns a list of data, and you very often see code
>> like
>>
>> (let ((atts (file-attributes file)))
>> (when (> (elt atts 7) 4000)
>> ...))
>>
>> and you have no idea what that means. So I think there should be 12
>> attribute accessor functions (well, defsubsts) that people can use
>> instead. The names could be something like `file-attribute-size',
>> `file-attribute-access-time', etc.
>
> I've now implemented this on the trunk.
A useful addition. Please fix the defsubst typos (ntf -> nth) and
possibly add some tests.
Consider also fixing file-attributes callers to use the new accessors.
AndyM