You want to match all files whose relative file names (no directory part) match ^build$
. The answer, in the version of dired+.el
that you have, is to use a negative prefix arg. That's the short answer, for the version you have, but please read on.
The Dired+ command didn't correspond to the doc string (which was correct), concerning what the regexp is matched against. I've fixed that now.
In the version before the fix, as just mentioned, you needed to use a negative prefix arg (e.g. M--
) to match against only the relative file-name part (no directory part).
Now (after the fix) that's the default behavior, just as the doc string said - no prefix arg (to mark) or a plain prefix arg (C-u
, to unmark) means match against the relative file name.
In any case, there's a lot of functionality (controlled by the prefix arg) that's rolled into % m
(command dired-mark-files-regexp
), so it can be confusing.
C-h f
tells you:
dired-mark-files-regexp
is an interactive Lisp function in
dired+.el
.
(dired-mark-files-regexp REGEXP &optional MARKER-CHAR LOCALP)
Mark all file names matching REGEXP
for use in later commands.
.
and ..
are never marked or unmarked by this command.
Whether to mark or unmark, and what form of file name to match, are
governed by the prefix argument. For this, a plain (C-u
) or a
double-plain (C-u C-u
) prefix arg is considered only as such - it is
not considered numerically.
Whether to mark or unmark:
No prefix arg, a positive arg, or a negative arg means mark.
Plain (C-u
), double-plain (C-u C-u
), or zero (e.g. M-0
) means
unmark.
The form of a file name used for matching:
No prefix arg (to mark) or a plain prefix arg (C-u
, to unmark)
means use the relative file name (no directory part).
A negative arg (e.g. M--
, to mark) or a zero arg (e.g. M-0
, to
unmark) means use the absolute file name, that is, including all
directory components.
A positive arg (e.g. M-+
, to mark) or a double plain arg (C-u C-u
, to unmark) means construct the name relative to
default-directory
. For an entry in an inserted subdir listing,
this means prefix the relative file name (no directory part) with
the subdir name relative to default-directory
.
Note that the default matching behavior of this command is different
for Dired+ than it is for vanilla Emacs. Using a positive prefix arg
or a double plain prefix arg (C-u C-u
) gives you the same behavior
as vanilla Emacs (marking or unmarking, respectively): matching
against names that are relative to the default-directory
.
What Dired+ offers in addition is the possibility to match against
names that are relative (have no directory part - no prefix arg or
C-u
to mark and unmark, respectively) or absolute (M--
or M-0
,
respectively).
The default behavior uses relative names because this
is likely to be the more common use case. But matching against
absolute names gives you more flexibility.
REGEXP
is an Emacs regexp, not a shell wildcard. Thus, use \.o$
for object files -- just .o
might mark more than you might expect.
REGEXP
is added to regexp-search-ring
, for regexp search.
Non-interactively: