Function: dir-locals--all-files

dir-locals--all-files is a byte-compiled function defined in files.el.gz.

Signature

(dir-locals--all-files DIRECTORY &optional BASE-EL-ONLY)

Documentation

Return a list of all readable dir-locals files in DIRECTORY.

The returned list is sorted by increasing priority. That is, values specified in the last file should take precedence over those in the first.

Source Code

;; Defined in /usr/src/emacs/lisp/files.el.gz
(defun dir-locals--all-files (directory &optional base-el-only)
  "Return a list of all readable dir-locals files in DIRECTORY.
The returned list is sorted by increasing priority.  That is,
values specified in the last file should take precedence over
those in the first."
  (when (file-readable-p directory)
    (let* ((file-1 (expand-file-name (if (eq system-type 'ms-dos)
                                         (dosified-file-name dir-locals-file)
                                       dir-locals-file)
                                     directory))
           (file-2 (when (string-match "\\.el\\'" file-1)
                     (replace-match "-2.el" t nil file-1)))
           out)
      (dolist (f (or (and base-el-only (list file-1))
                     ;; The order here is important.
                     (list file-2 file-1)))
        (when (and f
                   (file-readable-p f)
                   (file-regular-p f))
          (push f out)))
      out)))