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)

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)
  "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 nil))
      ;; The order here is important.
      (dolist (f (list file-2 file-1))
        (when (and f
                   (file-readable-p f)
                   ;; FIXME: Aren't file-regular-p and
                   ;; file-directory-p mutually exclusive?
                   (file-regular-p f)
                   (not (file-directory-p f)))
          (push f out)))
      out)))