emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: empty-directory predicate, native implementation


From: Arthur Miller
Subject: Re: empty-directory predicate, native implementation
Date: Wed, 14 Oct 2020 16:49:02 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Arthur Miller <arthur.miller@live.com> writes:

> Michael Albinus <michael.albinus@gmx.de> writes:
>
>> Arthur Miller <arthur.miller@live.com> writes:
>>
>> Hi Arthur,
>>
>>> The only thing I am not sure about is how to deal with 0 count; I
>>> mean if user explicitly ask for 0 count; the case when count is not
>>> NILP.
>>
>>>I have chosen not to deal with it all, I check for zer set
>>> explicit limit for count to be [1,COUNT]. I am not sure if that is best
>>> thing to do; maybe just to return Qnil? I am probably doing something
>>> else wrong, advice apprecaiated.
>>
>> Returning Qnil seems to be OK, when count is 0.
>>
>> Best regards, Michael.
> What about return the length, number of the files in that case?
>
> In order to get number of the files currently we would get list of files
> and get length of the list afterwards; if we asked to get 0 files, it
> could return the length; I thought of it afterwards.

Ok; just a very-very fast hack; I am in very rush today, so this was my
coffee pause :-)

I have tested with those previous tests, seems to work, but I don't have
time to test on windows. I am also not sure if I can circut that early,
please see just as an idea.

If cunt 0 is asked, then directory-files will return number of files in
directory. If also "match" is provided it *should* give only number of
files that match the given regex and sort will have no effect (no
sorting). I don't have time to test with match or to write docs; but can
do probably tomorrow or on friday.

Attachment: dired.c.patch
Description: dired.c.patch


reply via email to

[Prev in Thread] Current Thread [Next in Thread]