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