all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Andy Moreton <andrewjmoreton@gmail.com>
To: 22890@debbugs.gnu.org
Subject: bug#22890: 25.1.50; Wishlist: There should be file-attribute accessors
Date: Fri, 04 Mar 2016 16:17:54 +0000	[thread overview]
Message-ID: <vz18u1yusi5.fsf@gmail.com> (raw)
In-Reply-To: <87h9goje5d.fsf@gnus.org>

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






  reply	other threads:[~2016-03-04 16:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-03  5:58 bug#22890: 25.1.50; Wishlist: There should be file-attribute accessors Lars Ingebrigtsen
2016-03-04 13:39 ` Lars Ingebrigtsen
2016-03-04 16:17   ` Andy Moreton [this message]
2016-03-04 19:25     ` Lars Magne Ingebrigtsen
2016-03-04 19:51       ` Drew Adams
2016-03-04 20:00         ` John Wiegley
2016-03-04 20:20           ` Drew Adams

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=vz18u1yusi5.fsf@gmail.com \
    --to=andrewjmoreton@gmail.com \
    --cc=22890@debbugs.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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.