From: Ted Zlatanov <tzz@lifelogs.com>
To: emacs-devel@gnu.org
Subject: Re: Use file-attributes accesors in existing code
Date: Thu, 28 Jul 2016 13:23:21 -0400 [thread overview]
Message-ID: <874m79fzhy.fsf@lifelogs.com> (raw)
In-Reply-To: alpine.DEB.2.20.1607282352210.4298@calancha-pc
On Thu, 28 Jul 2016 23:53:23 +0900 (JST) Tino Calancha <tino.calancha@gmail.com> 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
next prev parent reply other threads:[~2016-07-28 17:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-28 14:53 Use file-attributes accesors in existing code Tino Calancha
2016-07-28 17:23 ` Ted Zlatanov [this message]
2016-07-28 17:35 ` Michael Albinus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=874m79fzhy.fsf@lifelogs.com \
--to=tzz@lifelogs.com \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).