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: Michael Albinus
Subject: Re: empty-directory predicate, native implementation
Date: Mon, 19 Oct 2020 09:51:55 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Drew Adams <drew.adams@oracle.com> writes:

Hi Drew,

> IOW, what's different, AFAICS, is the match data: the match.
>
> So if you use the regexp only with `string-match-p' (which
> doesn't care about the match data), or if you use it only
> with `directory-files', then there's no real difference in
> the effect.  But if you use it for some context where the
> matched parts are important, that is, where the match-data
> matters, then there's a big difference.

Yes. But to be fair, the docstring of directory-files-no-dot-files-regexp
didn't promise to return any kind of match data. Using it was just using
an undocumented side effect.

> I didn't complain about Emacs changing the value of the
> variable - no lobbying is needed.  What I said was that
> "it's not clear to me" why people were claiming that the
> new regexp is "more correct" than the old one.  (No one
> ever responded to that, explaining in what way the old
> one was somehow incorrect.)

I believe this statement was rather for the different instances of
regexps over the code, all of them claiming to match just "." and
"..". And some of them might have been wrong.

> [BTW, neither manual nor doc string for `directory-files'
> says what MATCH is matched against, other than "file names".
> But apparently it's matched only against the nondirectory
> part of file names, even if FULL is non-nil.]

I've fixed the docstrings of directory-files-no-dot-files-regexp,
directory-files and directory-files-and-attributes.

Best regards, Michael.



reply via email to

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