GNU bug report logs - #60819
28.2; `ls-lisp.el' regression introduced in Emacs 26

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Sat, 14 Jan 2023 22:29:02 UTC

Severity: normal

Found in version 28.2

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 60819 <at> debbugs.gnu.org
Subject: bug#60819: 28.2; `ls-lisp.el' regression introduced in Emacs 26
Date: Sun, 15 Jan 2023 19:25:30 +0200
> From: Drew Adams <drew.adams <at> oracle.com>
> CC: "60819-done <at> debbugs.gnu.org" <60819-done <at> debbugs.gnu.org>
> Date: Sun, 15 Jan 2023 17:04:05 +0000
> 
> > > In general, the character / in a glob pattern cannot be matched by a
> > > wildcard.  E.g., Wikipedia says "Normally, the path separator character
> > > (/ on Linux/Unix, MacOS, etc. or \ on Windows) will never be matched."
> > > and Linux man page glob(7) says "A '/' in a pathname cannot be matched
> > > by a '?' or '*' wildcard, or by a range like "[.-0]"."
> > 
> > This is incorrect.  A wildcard like "*b*/" should expand to the list
> > of directories whose names match "*b*", whereas "*b*" should expand to
> > the list of files _and_ directories with matching names.  This is how
> > Dired behaves on Posix platforms (where such an expansion is done by
> > the 'ls' program), and we want a similar behavior with ls-lisp.
> 
> Excellent.  That's in fact what I was naively expecting
> or hoping for.
> 
> But googling for info about what such a glob pattern
> should match, I couldn't find anything that supported
> such an interpretation.  Could you maybe point me to a
> source that covers this - so I can read more and point
> others to it?  If you don't have the time to find that
> then don't worry about it.  Thx.

I'm not sure this should be documented in some special way.  Since a
wildcard match cannot cross a slash, it follows that a slash can only
match itself.  So you are looking for files whose names end in a
slash, and those by convention are directories, both in Emacs and with
GNU Coreutils.  Cf directory-name-p and file-name-as-directory.




This bug report was last modified 1 year and 154 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.