emacs-devel
[Top][All Lists]
Advanced

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

Re: Use file-attributes accesors in existing code


From: Ted Zlatanov
Subject: Re: Use file-attributes accesors in existing code
Date: Thu, 28 Jul 2016 13:23:21 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

On Thu, 28 Jul 2016 23:53:23 +0900 (JST) Tino Calancha <address@hidden> wrote: 

TC> as you know in Emacs 25.2 we have accessors for each of
TC> the values returned by 'file-attributes'.  These accessors
TC> prevent from some hardcoded numbers in the code, that is,
TC> write:
TC> (file-attribute-size attr)
TC> instead of:
TC> (nth 5 attr)

TC> Is it worth to review the existing code, in a case by
TC> case basis, to see where the use of these accesors may result in a
TC> more readable code?

TC> I am glad to carry this task in case the maintainers think is
TC> useful.

As a fellow developer, I think that makes sense, and hope the
maintainers agree.

TC> How about another accesor returning a list (inode device)?
TC> How to call it?
TC> Is is too long 'file-attribute-inode-device-numbers'?

I'd use something like this:

(file-attribute-collect attr 'inode 'device)

Ted




reply via email to

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