all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juanma Barranquero <lekktu@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Eli Zaretskii <eliz@gnu.org>, emacs-devel@gnu.org
Subject: Re: Enhancement for file-attributes
Date: Mon, 1 Oct 2012 04:04:58 +0200	[thread overview]
Message-ID: <CAAeL0SRf0zPX6XhB-StnjRQZ=u+tStsAaVPNVXamw=E2J+Q5iw@mail.gmail.com> (raw)
In-Reply-To: <jwvhaqf8031.fsf-monnier+emacs@gnu.org>

On Mon, Oct 1, 2012 at 3:16 AM, Stefan Monnier <monnier@iro.umontreal.ca> wrote:

> It would have made a lot of sense originally, but I'm wondering whether
> it's worth the trouble now.  In how many places would we save the
> file-chase-links all?  Are these places important?

I don't know about that, but a way to ask file-attributes for a
specific value, instead of computing them all and consing them into a
list would perhaps make sense.

I recently counted uses of (nth X (file-attributes ...)), and
variants, like (car (file-attributes ...)) and (let ((atr
(file-attributes ...))) ...), etc. Asking for the file size happens >
110 times in the sources; last modification time, > 50; all the rest,
<10 each (approx, as I counted by hand).

So a function (file-size X) doing an optimized equivalent of  (nth 7
(file-attributes (file-truename NAME))) would be useful, and cleaner
IMO.

    Juanma



  reply	other threads:[~2012-10-01  2:04 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-30 14:26 Enhancement for file-attributes Eli Zaretskii
2012-09-30 21:14 ` Paul Eggert
2012-09-30 22:08   ` Eli Zaretskii
2012-10-01  0:45   ` Stefan Monnier
2012-10-01  2:08     ` Paul Eggert
2012-10-08 10:36       ` Michael Albinus
2012-10-01  1:16 ` Stefan Monnier
2012-10-01  2:04   ` Juanma Barranquero [this message]
2012-10-01 12:59   ` Eli Zaretskii
2012-10-01 14:31     ` Stefan Monnier
2012-10-01 14:56       ` Eli Zaretskii

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='CAAeL0SRf0zPX6XhB-StnjRQZ=u+tStsAaVPNVXamw=E2J+Q5iw@mail.gmail.com' \
    --to=lekktu@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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.