Function: hack-dir-local--get-variables
hack-dir-local--get-variables is a byte-compiled function defined in
files.el.gz.
Signature
(hack-dir-local--get-variables &optional PREDICATE)
Documentation
Read per-directory local variables for the current buffer.
Return a cons of the form (DIR . ALIST), where DIR is the
directory name (maybe nil) and ALIST is an alist of all variables
that might apply. These will be filtered according to the
buffer's directory, but not according to its mode.
PREDICATE is passed to dir-locals-collect-variables.
Source Code
;; Defined in /usr/src/emacs/lisp/files.el.gz
(defun hack-dir-local--get-variables (&optional predicate)
"Read per-directory local variables for the current buffer.
Return a cons of the form (DIR . ALIST), where DIR is the
directory name (maybe nil) and ALIST is an alist of all variables
that might apply. These will be filtered according to the
buffer's directory, but not according to its mode.
PREDICATE is passed to `dir-locals-collect-variables'."
(when (and enable-local-variables
enable-dir-local-variables
(or enable-remote-dir-locals
(not (file-remote-p (or (buffer-file-name)
default-directory)))))
;; Find the variables file.
(let ((dir-or-cache (dir-locals-find-file
(or (buffer-file-name) default-directory)))
(class nil)
(dir-name nil))
(cond
((stringp dir-or-cache)
(setq dir-name dir-or-cache
class (dir-locals-read-from-dir dir-or-cache)))
((consp dir-or-cache)
(setq dir-name (nth 0 dir-or-cache))
(setq class (nth 1 dir-or-cache))))
(when class
(cons dir-name
(dir-locals-collect-variables
(dir-locals-get-class-variables class)
dir-name nil predicate))))))