all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Arthur Miller <arthur.miller@live.com>
To: Michael Albinus <michael.albinus@gmx.de>
Cc: Eli Zaretskii <eliz@gnu.org>, emacs-devel@gnu.org
Subject: Re: empty-directory predicate, native implementation
Date: Thu, 15 Oct 2020 13:33:54 +0200	[thread overview]
Message-ID: <AM6PR06MB4518BCD25B93987390D7D6D596020@AM6PR06MB4518.eurprd06.prod.outlook.com> (raw)
In-Reply-To: <87sgafq2e2.fsf@gmx.de> (Michael Albinus's message of "Thu, 15 Oct 2020 11:12:05 +0200")

Michael Albinus <michael.albinus@gmx.de> writes:

> Arthur Miller <arthur.miller@live.com> writes:
>
> Hi Arthur,
>
>> Attached is patch which return nil early.
>
> Thanks for this. I haven't seen your name on the FSF file; I guess your
> legal papers are on the way?
They are not, but they can be if someone send me link. I've been looking
at this page:

https://www.gnu.org/prep/maintain/html_node/Copyright-Papers.html#Copyright-Papers

but I am not really sure where do I send request.

> In the meantime, we could prepare the other changes. These are
>
> - Adapt the description of directory-files and
>   directory-files-and-attributes in doc/lispref/files.texi.
>
> - Add an entry to etc/NEWS.
>
> - Adapt the file name handlers. These are ange-ftp-directory-files,
>   ange-ftp-directory-files-and-attributes, tramp-handle-directory-files,
>   tramp-handle-directory-files-and-attributes,
>   tramp-adb-handle-directory-files-and-attributes,
>   tramp-crypt-handle-directory-files,
>   tramp-rclone-handle-directory-files,
>   tramp-sh-handle-directory-files-and-attributes,
>   tramp-smb-handle-directory-files.

Aha, so it is how it works; didn't have time to look into tramp yet.
Ok, I'll do; I'll sent in patch(es) when I am done. Probably not today
though but during the weekend of beginning of the next week.

So many changes just for one signature :-).
> - Adapt resp extend ERT tests. These are tramp-test16-directory-files,
>   tramp-test19-directory-files-and-attributes,
>   tramp-archive-test16-directory-files and
>   tramp-archive-test19-directory-files-and-attributes.
>
> - Optionally (but much appreciated), write new ERT tests for
>   directory-files and directory-files-and-attributes.

Will have to look at ERT, I suppose it is not too complicated,
opportunity to learn it.

> And here are some minor comments about your patch:
>
>> +      if (FIXNATP(return_count))
>> +        {
>> +          if (ind == last)
>> +            break;
>> +          ind ++;
>> +        }
>> +
>
> Wouldn't it be more efficient to test
>
>       if (!last && ind == last)
> 	break;
>       ind ++;
It will :-)

I mainly try to be clear "what I intent" for some future reader; since
previous code uses lisp.h macros, I used same. I thought that one extra
'if' is not that much of a penalty, I'll gladly shortcircut with !last.

>> +DEFUN ("directory-files", Fdirectory_files, Sdirectory_files, 1, 5, 0,
>>         doc: /* Return a list of names of files in DIRECTORY.
>>  There are three optional arguments:
>>  If FULL is non-nil, return absolute file names.  Otherwise return names
>> @@ -296,9 +312,14 @@
>>  If MATCH is non-nil, mention only file names that match the regexp MATCH.
>>  If NOSORT is non-nil, the list is not sorted--its order is unpredictable.
>>   Otherwise, the list returned is sorted with `string-lessp'.
>> - NOSORT is useful if you plan to sort the result yourself.  */)
>> + NOSORT is useful if you plan to sort the result yourself.
>> +If COUNT is  non-nil, the function will return max of COUNT and length
>> + files, where length is number of files in the directory. Order
>> + in which files are returned is not guaranteed and is file system and
>> + OS dependent. COUNT has to be an integral number in interval
>> + [1,COUNT]. If 0 files are requested the function will return nil. */)
>
> I know what you mean, but I had to read it twice in order to
> understand. Why not simply
>
> If COUNT is a natural number, the function will return up to COUNT files.
I was thinking myself that the last argument took as much doc-space as
comment for the rest of entire function :-). I tried to be as
no-doubt-clear as well as not-so-mathematical, but I definitely think
your version is much nicer. We go with that.

>>  DEFUN ("directory-files-and-attributes", Fdirectory_files_and_attributes,
>> -       Sdirectory_files_and_attributes, 1, 5, 0,
>> -       doc: /* Return a list of names of files and their attributes in DIRECTORY.
>> +       Sdirectory_files_and_attributes, 1, 6, 0, doc
>> +       : /* Return a list of names of files and their attributes in DIRECTORY.
>>  Value is a list of the form:
>>
>> -  ((FILE1 . FILE1-ATTRS) (FILE2 . FILE2-ATTRS) ...)
>> +((FILE1 . FILE1-ATTRS) (FILE2 . FILE2-ATTRS) ...)
>
> Why do you remove the indentation? It is intentional, I believe.
I don't. It is my Emacs. I have by defualt "linux" as identation
style; and changed to "gnu" and even setq default, but Emacs arsed
about identing "linux" style anyway; so I "manually" idented everything
I sent in that changed, and I have just missed those since I didn't
edited those at all.




  reply	other threads:[~2020-10-15 11:33 UTC|newest]

Thread overview: 71+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-13  2:22 empty-directory predicate, native implementation Arthur Miller
2020-10-13  8:01 ` Michael Albinus
2020-10-13 11:42   ` Arthur Miller
2020-10-13 13:16     ` Michael Albinus
2020-10-13 18:32       ` Arthur Miller
2020-10-13 18:39         ` Michael Albinus
2020-10-13 23:20           ` Arthur Miller
2020-10-14  9:19             ` Michael Albinus
2020-10-14 13:53               ` Arthur Miller
2020-10-13 14:48 ` Eli Zaretskii
2020-10-13 18:43   ` Arthur Miller
2020-10-13 19:12     ` Eli Zaretskii
2020-10-13 19:59       ` Arthur Miller
2020-10-14 14:08         ` Eli Zaretskii
2020-10-14 14:43           ` Arthur Miller
2020-10-13 18:44   ` Michael Albinus
2020-10-13 19:14     ` Eli Zaretskii
2020-10-13 20:08       ` Arthur Miller
2020-10-14  1:52       ` Arthur Miller
2020-10-14  9:21         ` Michael Albinus
2020-10-14 13:56           ` Arthur Miller
2020-10-14 14:41             ` Michael Albinus
2020-10-14 15:07               ` Arthur Miller
2020-10-14 15:53                 ` Michael Albinus
2020-10-14 16:12                   ` Eli Zaretskii
2020-10-14 16:21                     ` Michael Albinus
2020-10-14 16:29                       ` Eli Zaretskii
2020-10-15  5:53                         ` Arthur Miller
2020-10-15  9:12                           ` Michael Albinus
2020-10-15 11:33                             ` Arthur Miller [this message]
2020-10-15 12:21                               ` Michael Albinus
2020-10-15 13:29                                 ` Arthur Miller
2020-10-15 14:01                                 ` Arthur Miller
2020-10-15 14:41                                   ` Michael Albinus
2020-10-15 15:22                                     ` Arthur Miller
2020-10-16 23:31                                 ` Arthur Miller
2020-10-17  8:13                                   ` Michael Albinus
2020-10-17 19:03                                     ` Arthur Miller
2020-10-17 20:03                                       ` Drew Adams
2020-10-17 20:27                                         ` Arthur Miller
2020-10-17 21:18                                           ` Drew Adams
2020-10-17 22:06                                             ` Arthur Miller
2020-10-17 21:02                                         ` Arthur Miller
2020-10-17 21:27                                           ` Drew Adams
2020-10-17 21:58                                             ` Arthur Miller
2020-10-18 12:06                                               ` Michael Albinus
2020-10-18  2:47                                         ` Eli Zaretskii
2020-10-18 11:52                                       ` Michael Albinus
2020-10-18 16:15                                         ` Drew Adams
2020-10-18 16:43                                           ` Michael Albinus
2020-10-18 20:15                                           ` Stefan Monnier
2020-10-18 21:25                                             ` Drew Adams
2020-10-19  0:03                                           ` Arthur Miller
2020-10-18 22:21                                         ` Arthur Miller
2020-10-19  8:04                                           ` Michael Albinus
2020-10-19 14:01                                             ` Arthur Miller
2020-10-19 14:50                                               ` Michael Albinus
     [not found]                                         ` <VI1PR06MB45266BE5DFC72AEB27567A6C961E0@VI1PR06MB4526.eurprd06.prod.outlook.com>
     [not found]                                           ` <87a6wixoim.fsf@gmx.de>
     [not found]                                             ` <VI1PR06MB4526280D5B81531D06E58BC1961D0@VI1PR06MB4526.eurprd06.prod.outlook.com>
     [not found]                                               ` <87wnzev6i3.fsf@gmx.de>
     [not found]                                                 ` <VI1PR06MB45264E1CB34EECE86672581C96100@VI1PR06MB4526.eurprd06.prod.outlook.com>
2020-11-02 17:02                                                   ` Michael Albinus
2020-11-03 15:20                                                     ` Arthur Miller
2020-10-15 13:38                               ` Stefan Monnier
2020-10-16 23:33                                 ` Arthur Miller
2020-10-14 14:49             ` Arthur Miller
     [not found] <<VI1PR06MB4526ACBABDE795DDD49A5A5896040@VI1PR06MB4526.eurprd06.prod.outlook.com>
     [not found] ` <<83y2ka18t7.fsf@gnu.org>
     [not found]   ` <<87y2kaj799.fsf@gmx.de>
     [not found]     ` <<83blh60wgr.fsf@gnu.org>
     [not found]       ` <<VI1PR06MB452688C9C71D5463D9497A2A96050@VI1PR06MB4526.eurprd06.prod.outlook.com>
     [not found]         ` <<87h7qxjh7g.fsf@gmx.de>
     [not found]           ` <<VI1PR06MB45269B3924B44A555428F00596050@VI1PR06MB4526.eurprd06.prod.outlook.com>
     [not found]             ` <<878sc8kgy8.fsf@gmx.de>
     [not found]               ` <<VI1PR06MB4526FDD3D3EB4867AF837C8F96050@VI1PR06MB4526.eurprd06.prod.outlook.com>
     [not found]                 ` <<87imbcls71.fsf@gmx.de>
     [not found]                   ` <<83eem0zt0b.fsf@gnu.org>
     [not found]                     ` <<87k0vsrd6m.fsf@gmx.de>
     [not found]                       ` <<83a6wozs7h.fsf@gnu.org>
     [not found]                         ` <<VI1PR06MB45267C7D83E77C3F307FF34E96020@VI1PR06MB4526.eurprd06.prod.outlook.com>
     [not found]                           ` <<87sgafq2e2.fsf@gmx.de>
     [not found]                             ` <<AM6PR06MB4518BCD25B93987390D7D6D596020@AM6PR06MB4518.eurprd06.prod.outlook.com>
     [not found]                               ` <<87h7qvptm3.fsf@gmx.de>
     [not found]                                 ` <<VI1PR06MB452605D66CDE84BAA25A257696030@VI1PR06MB4526.eurprd06.prod.outlook.com>
     [not found]                                   ` <<871rhxp8we.fsf@gmx.de>
     [not found]                                     ` <<VI1PR06MB45261F3309D31EC7DEDE4C8B96000@VI1PR06MB4526.eurprd06.prod.outlook.com>
     [not found]                                       ` <<237bd21b-96c7-4433-a5bc-34b64a9f4250@default>
     [not found]                                         ` <<83ft6cs10u.fsf@gnu.org>
2020-10-18  4:05                                           ` Drew Adams
  -- strict thread matches above, loose matches on Subject: below --
2020-10-18 21:13 Drew Adams
2020-10-18 22:15 ` Stefan Monnier
2020-10-19  7:54   ` Michael Albinus
2020-10-19  0:24 ` Arthur Miller
2020-10-19  0:37   ` Drew Adams
2020-10-19  2:15     ` Arthur Miller
2020-10-19  7:51 ` Michael Albinus
2020-10-19 15:25   ` 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=AM6PR06MB4518BCD25B93987390D7D6D596020@AM6PR06MB4518.eurprd06.prod.outlook.com \
    --to=arthur.miller@live.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=michael.albinus@gmx.de \
    /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.