emacs-devel
[Top][All Lists]
Advanced

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

RE: Scan of Emacs regexp mistakes


From: Drew Adams
Subject: RE: Scan of Emacs regexp mistakes
Date: Tue, 14 Apr 2020 08:47:42 -0700 (PDT)

> The filename-matching regexp glitches were fixed separately by the
> attached patch, pushed to emacs-27, since these were actual or latent
> bugs.
> 
> Several different regexps were used for matching anything but "." and
> "..", all wrong. These were all replaced with the concise and correct
> (rx (or (not ".") "...")), meaning "[^.]\\|\\.\\.\\." for
> traditionalists.
> 
> It is quite clear that returning . and .. from directory-files etc was
> a mistake; they are practically never useful but requires callers to
> take steps to filter them out. It's likely that nothing would break if
> we stopped returning those entries, but that is not a change that I'm
> proposing right now.

FWIW -

That "quite clear" is not clear to me.

And it's not clear to me why you think "[^.]\\|\\.\\.\\."
is more correct than "^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*",
which is what Dired has used for a file name other than `.'
and `..'.

This kind of wholescale changing of regexps seems unwise,
to me.  Who knows how long it will take for each of the
changes to actually be checked in practice, to see
whether it is an improvement or breaks things?

The changes from ^ ... $ to \\` ... \\' are probably
good, or at least OK (no, I didn't check them
individually).  But the filename-except-.-or-.. change
seems wrong, in general.



reply via email to

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