all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: "Mattias Engdegård" <mattiase@acm.org>,
	emacs-devel <emacs-devel@gnu.org>
Subject: RE: Scan of Emacs regexp mistakes
Date: Tue, 14 Apr 2020 08:47:42 -0700 (PDT)	[thread overview]
Message-ID: <c5580c11-cdb0-45ca-bad1-0f9a808e9fc4@default> (raw)
In-Reply-To: <140DB045-4529-4862-99B8-5F0DEF1EE8D4@acm.org>

> 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.



  parent reply	other threads:[~2020-04-14 15:47 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-05 12:30 Scan of Emacs regexp mistakes Mattias Engdegård
2020-04-14 10:52 ` Mattias Engdegård
2020-04-14 11:15   ` Andreas Schwab
2020-04-16 10:15     ` Mattias Engdegård
2020-04-14 15:47   ` Drew Adams [this message]
2020-04-15 18:19   ` Paul Eggert
2020-04-16 10:29     ` Mattias Engdegård
2020-04-16 10:37   ` Mattias Engdegård
2020-04-16 16:08     ` Paul Eggert
2020-04-16 18:01       ` Mattias Engdegård

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=c5580c11-cdb0-45ca-bad1-0f9a808e9fc4@default \
    --to=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    --cc=mattiase@acm.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.