all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: emacs-devel@gnu.org
Subject: Re: emacs-26 99f92da: Improve documentation of 'directory-files-and-attributes'
Date: Fri, 01 Jun 2018 16:09:22 +0300	[thread overview]
Message-ID: <83h8mmfybh.fsf@gnu.org> (raw)
In-Reply-To: <m34limq01u.fsf@gnus.org> (message from Lars Ingebrigtsen on Fri,  01 Jun 2018 12:21:49 +0200)

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Cc: Eli Zaretskii <eliz@gnu.org>
> Date: Fri, 01 Jun 2018 12:21:49 +0200
> 
> eliz@gnu.org (Eli Zaretskii) writes:
> 
> > +Value is a list of the form:
> > +
> > +  ((FILE1 FILE1-ATTRS) (FILE2 FILE2-ATTRS) ...)
> > +
> > +where each FILEn-ATTRS is the attributes of FILEn as returned
> > +by `file-attributes'.
> 
> Heh, I read the same reddit post, apparently, and fixed it like this on
> master: 

Please always fix documentation issues on the release branch, not on
master.  Unless they document features that are only available on
master, of course.

> +The list returned has elements that contain the data from
> +`file-attributes' for each file -- with the file name prepended.  So
> +the structure of each element is
> +`(FILE-NAME FILE-ATTRIBUTE1 FILE-ATTRIBUTE2 ...)'.

I find "has elements that contain the data from `file-attributes' for
each file -- with the file name prepended" less clear than what I
wrote.  YMMV, of course, and I'll let others tell which text they
prefer.

> +For instance, to get the size of the fourth element in a directory,
> +you could say:
> +
> +  (file-attribute-size (cdr (nth 3 (directory-files-and-attributes "/"))))

That's redundant, I think; we never provide such "hints" anywhere else
where we describe lists being returned.

> Because (FILE1 FILE1-ATTRS) is a bit ambiguous, since it could mean
> 
> ("file-name" (t 27 0 0 (23311 56666 366991 953000) (23220 586 761023 102000) (23220 586 761023 102000) 4096 "drwxr-xr-x" t 2 66306))

No, it cannot mean that, because the text says

  where each FILEn-ATTRS is the attributes of FILEn as returned by
  `file-attributes'

It doesn't say it's a list.  If we think that's not clear enough we
can use this instead:

   ((FILE1 FILE1-ATTRS...) (FILE2 FILE2-ATTRS...) ...)



  parent reply	other threads:[~2018-06-01 13:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20180601082809.7179.74843@vcs0.savannah.gnu.org>
     [not found] ` <20180601082810.7BF3721297@vcs0.savannah.gnu.org>
2018-06-01 10:21   ` emacs-26 99f92da: Improve documentation of 'directory-files-and-attributes' Lars Ingebrigtsen
2018-06-01 12:10     ` Stefan Monnier
2018-06-01 13:09     ` Eli Zaretskii [this message]
2018-06-01 13:20       ` Lars Ingebrigtsen

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=83h8mmfybh.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=larsi@gnus.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.