mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-17 11:20:39 -08:00
Further clarification of directory-files* doc
* doc/lispref/files.texi (Contents of Directories): Precise description of MATCH-REGEXP of directory-files. Add directory-files-no-dot-files-regexp. * lisp/files.el (directory-files-no-dot-files-regexp): Revert last fix. * src/dired.c (Fdirectory_files) (Fdirectory_files_and_attributes): Fix wording in docstring.
This commit is contained in:
parent
653eab4788
commit
74519db6df
3 changed files with 20 additions and 7 deletions
|
|
@ -2926,11 +2926,11 @@ absolute file names. Otherwise, it returns the names relative to
|
||||||
the specified directory.
|
the specified directory.
|
||||||
|
|
||||||
If @var{match-regexp} is non-@code{nil}, this function returns only
|
If @var{match-regexp} is non-@code{nil}, this function returns only
|
||||||
those file names that contain a match for that regular expression---the
|
those file names whose non-directory part contain a match for that
|
||||||
other file names are excluded from the list. On case-insensitive
|
regular expression---the other file names are excluded from the list.
|
||||||
filesystems, the regular expression matching is case-insensitive.
|
On case-insensitive filesystems, the regular expression matching is
|
||||||
|
case-insensitive.
|
||||||
|
|
||||||
@c Emacs 19 feature
|
|
||||||
If @var{nosort} is non-@code{nil}, @code{directory-files} does not sort
|
If @var{nosort} is non-@code{nil}, @code{directory-files} does not sort
|
||||||
the list, so you get the file names in no particular order. Use this if
|
the list, so you get the file names in no particular order. Use this if
|
||||||
you want the utmost possible speed and don't care what order the files
|
you want the utmost possible speed and don't care what order the files
|
||||||
|
|
@ -3007,6 +3007,19 @@ corresponding argument to @code{file-attributes} (@pxref{Definition
|
||||||
of file-attributes}).
|
of file-attributes}).
|
||||||
@end defun
|
@end defun
|
||||||
|
|
||||||
|
@defvr Constant directory-files-no-dot-files-regexp
|
||||||
|
This regular expression matches any file name except @samp{.} and
|
||||||
|
@samp{..}. More precisely, it matches parts of any nonempty string
|
||||||
|
except those two. It is useful as the @var{match-regexp} argument to
|
||||||
|
@code{directory-files} and @code{directory-files-and-attributes}:
|
||||||
|
|
||||||
|
@example
|
||||||
|
(directory-files "/foo" nil directory-files-no-dot-files-regexp)
|
||||||
|
@end example
|
||||||
|
|
||||||
|
returns @code{nil}, if directory @samp{/foo} is empty.
|
||||||
|
@end defvr
|
||||||
|
|
||||||
@defun file-expand-wildcards pattern &optional full
|
@defun file-expand-wildcards pattern &optional full
|
||||||
This function expands the wildcard pattern @var{pattern}, returning
|
This function expands the wildcard pattern @var{pattern}, returning
|
||||||
a list of file names that match it.
|
a list of file names that match it.
|
||||||
|
|
|
||||||
|
|
@ -5787,7 +5787,7 @@ If called interactively, then PARENTS is non-nil."
|
||||||
|
|
||||||
(defconst directory-files-no-dot-files-regexp
|
(defconst directory-files-no-dot-files-regexp
|
||||||
"[^.]\\|\\.\\.\\."
|
"[^.]\\|\\.\\.\\."
|
||||||
"Regexp matching any non-directory part of a file name except \".\" and \"..\".
|
"Regexp matching any file name except \".\" and \"..\".
|
||||||
More precisely, it matches parts of any nonempty string except those two.
|
More precisely, it matches parts of any nonempty string except those two.
|
||||||
It is useful as the regexp argument to `directory-files' and
|
It is useful as the regexp argument to `directory-files' and
|
||||||
`directory-files-and-attributes'.")
|
`directory-files-and-attributes'.")
|
||||||
|
|
|
||||||
|
|
@ -293,7 +293,7 @@ DEFUN ("directory-files", Fdirectory_files, Sdirectory_files, 1, 4, 0,
|
||||||
There are three optional arguments:
|
There are three optional arguments:
|
||||||
If FULL is non-nil, return absolute file names. Otherwise return names
|
If FULL is non-nil, return absolute file names. Otherwise return names
|
||||||
that are relative to the specified directory.
|
that are relative to the specified directory.
|
||||||
If MATCH is non-nil, mention only file names which non-directory part
|
If MATCH is non-nil, mention only file names whose non-directory part
|
||||||
matches the regexp MATCH.
|
matches the regexp MATCH.
|
||||||
If NOSORT is non-nil, the list is not sorted--its order is unpredictable.
|
If NOSORT is non-nil, the list is not sorted--its order is unpredictable.
|
||||||
Otherwise, the list returned is sorted with `string-lessp'.
|
Otherwise, the list returned is sorted with `string-lessp'.
|
||||||
|
|
@ -326,7 +326,7 @@ by `file-attributes'.
|
||||||
This function accepts four optional arguments:
|
This function accepts four optional arguments:
|
||||||
If FULL is non-nil, return absolute file names. Otherwise return names
|
If FULL is non-nil, return absolute file names. Otherwise return names
|
||||||
that are relative to the specified directory.
|
that are relative to the specified directory.
|
||||||
If MATCH is non-nil, mention only file names which non-directory part
|
If MATCH is non-nil, mention only file names whose non-directory part
|
||||||
matches the regexp MATCH.
|
matches the regexp MATCH.
|
||||||
If NOSORT is non-nil, the list is not sorted--its order is unpredictable.
|
If NOSORT is non-nil, the list is not sorted--its order is unpredictable.
|
||||||
NOSORT is useful if you plan to sort the result yourself.
|
NOSORT is useful if you plan to sort the result yourself.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue