From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juanma Barranquero Newsgroups: gmane.emacs.devel Subject: Re: Enhancement for file-attributes Date: Mon, 1 Oct 2012 04:04:58 +0200 Message-ID: References: <83a9w7egdd.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1349057147 6024 80.91.229.3 (1 Oct 2012 02:05:47 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 1 Oct 2012 02:05:47 +0000 (UTC) Cc: Eli Zaretskii , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 01 04:05:52 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TIVOG-0004Rr-U2 for ged-emacs-devel@m.gmane.org; Mon, 01 Oct 2012 04:05:49 +0200 Original-Received: from localhost ([::1]:55583 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TIVOB-0005Hf-83 for ged-emacs-devel@m.gmane.org; Sun, 30 Sep 2012 22:05:43 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:49333) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TIVO9-0005HV-Cn for emacs-devel@gnu.org; Sun, 30 Sep 2012 22:05:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TIVO8-0003wS-JH for emacs-devel@gnu.org; Sun, 30 Sep 2012 22:05:41 -0400 Original-Received: from mail-we0-f169.google.com ([74.125.82.169]:59595) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TIVO7-0003vs-8d; Sun, 30 Sep 2012 22:05:39 -0400 Original-Received: by weyu3 with SMTP id u3so2852851wey.0 for ; Sun, 30 Sep 2012 19:05:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=8uzAM2j9+M4KRPFMDt7H+8fF1Za7/plZ0/8U1w1VCXw=; b=gQb4m3j9FGgu8vqxqn54G98XmEPdLaEp3E9REGQs0ekFqMSxP64ac3OkzEB13+VuU5 Mf3F9zt0871QyTXLWBv7Z5qhLJQTQsR1ooqAw6SgNzWH0YPGtNv/5HuVRFyiLfBKHfa+ AFOOtOjFBwpCPMxFpjwlxFVOb8X+uV4qI0+JlQeQiX+WvtDZsbf249f1u/IeS9dzU/OI 6epUcIbFBYrnT7UcOG6BSYpS0lROKeO0J8nEmXCIXPRwwZnBqjr4fXdhg+UoBrIZwDKj MSKWj5jlTVQN27aB0l9ZVa1iXcrdE4rN5l4CyhQiAY0TGHQdIayqqP2gln/Oj4ZcZReE CfqQ== Original-Received: by 10.180.94.164 with SMTP id dd4mr11236976wib.1.1349057138254; Sun, 30 Sep 2012 19:05:38 -0700 (PDT) Original-Received: by 10.223.155.132 with HTTP; Sun, 30 Sep 2012 19:04:58 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 74.125.82.169 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:153794 Archived-At: On Mon, Oct 1, 2012 at 3:16 AM, Stefan Monnier 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