[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: `file-attribute' accessors
From: |
Thierry Volpiatto |
Subject: |
Re: `file-attribute' accessors |
Date: |
Mon, 09 Apr 2012 16:19:38 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.95 (gnu/linux) |
Lars Magne Ingebrigtsen <address@hidden> writes:
> I was reading code that said `(nth 7 (file-attributes file-name))', and
> I had to look up the doc string of `file-attributes' and find item seven
> to understand what the code was trying to do.
>
> Wouldn't it be nice if we had accessor functions for these things
> instead of making people write `nth 7'? If the code said
> `(file-attribute-size (file-attributes file-name))', that would have
> made things more understandable. (And probably easier to write, too,
> since one wouldn't have to consult the `file-attributes' doc string
> every time...)
Why not keys instead of many accessor functions?
See `helm-file-attributes' in helm-utils.el at
https://github.com/emacs-helm/helm
(helm-file-attributes "~/.emacs.d/emacs-config-laptop/.emacs.el" :size t)
=>62675
(helm-file-attributes "~/.emacs.d/emacs-config-laptop/.emacs.el" :human-size t)
=>"61.2K"
> If this sounds OK, I can add the, erm, 11 trivial accessor functions and
> adjust the documentation of `file-attributes' in trunk.
--
Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997
- `file-attribute' accessors, Lars Magne Ingebrigtsen, 2012/04/09
- Re: `file-attribute' accessors,
Thierry Volpiatto <=
- Re: `file-attribute' accessors, Lars Magne Ingebrigtsen, 2012/04/09
- Re: `file-attribute' accessors, Thierry Volpiatto, 2012/04/09
- Re: `file-attribute' accessors, Ted Zlatanov, 2012/04/09
- Re: `file-attribute' accessors, Lars Magne Ingebrigtsen, 2012/04/09
- Re: `file-attribute' accessors, Stefan Monnier, 2012/04/09
- Re: `file-attribute' accessors, Ted Zlatanov, 2012/04/09
- Re: `file-attribute' accessors, Stefan Monnier, 2012/04/09
- Re: `file-attribute' accessors, Miles Bader, 2012/04/10
Re: `file-attribute' accessors, Leo, 2012/04/09