help-gnu-emacs
[Top][All Lists]
Advanced

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

RE: [External] : Re: How to setup default program to launch directory?


From: Drew Adams
Subject: RE: [External] : Re: How to setup default program to launch directory?
Date: Sun, 17 Oct 2021 14:57:40 +0000

> (require 'seq)
> (defun dir-common-files (&optional dir)
>   "Get a list of all files in the working directory."
>   (let*((all-files (directory-files (or dir default-directory)))
>         (files     (seq-difference all-files '("." ".."))) )
>     files) )

(directory-files (or  dir default-directory)
                 nil
                 "[^.]\\|\\.\\.\\.")
___

`C-h f directory-files':

directory-files is a built-in function in 'C source code'.

(directory-files DIRECTORY &optional FULL MATCH NOSORT)
                                          ^^^^^
Return a list of names of files in DIRECTORY.
There are three optional arguments:
If FULL is non-nil, return absolute file names.  Otherwise return names
 that are relative to the specified directory.
If MATCH is non-nil, mention only file names that match the regexp MATCH.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
If NOSORT is non-nil, the list is not sorted--its order is unpredictable.
 Otherwise, the list returned is sorted with `string-lessp'.
 NOSORT is useful if you plan to sort the result yourself.

<<attachment: winmail.dat>>


reply via email to

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