Function: hack-dir-local-variables

hack-dir-local-variables is a byte-compiled function defined in files.el.gz.

Signature

(hack-dir-local-variables)

Documentation

Read per-directory local variables for the current buffer.

Store the directory-local variables in dir-local-variables-alist and file-local-variables-alist, without applying them.

This does nothing if either enable-local-variables or enable-dir-local-variables are nil.

Source Code

;; Defined in /usr/src/emacs/lisp/files.el.gz
(defun hack-dir-local-variables ()
  "Read per-directory local variables for the current buffer.
Store the directory-local variables in `dir-local-variables-alist'
and `file-local-variables-alist', without applying them.

This does nothing if either `enable-local-variables' or
`enable-dir-local-variables' are nil."
  (let* ((items (hack-dir-local--get-variables nil))
         (dir-name (car items))
         (variables (cdr items)))
    (when variables
      (dolist (elt variables)
        (if (eq (car elt) 'coding)
            (unless hack-dir-local-variables--warned-coding
              (setq hack-dir-local-variables--warned-coding t)
              (display-warning 'files
                               "Coding cannot be specified by dir-locals"))
          (unless (memq (car elt) '(eval mode))
            (setq dir-local-variables-alist
                  (assq-delete-all (car elt) dir-local-variables-alist)))
          (push elt dir-local-variables-alist)))
      (hack-local-variables-filter variables dir-name))))