Function: dir-locals-set-directory-class

dir-locals-set-directory-class is a byte-compiled function defined in files.el.gz.

Signature

(dir-locals-set-directory-class DIRECTORY CLASS &optional MTIME)

Documentation

Declare that the DIRECTORY root is an instance of CLASS.

DIRECTORY is the name of a directory, a string. CLASS is the name of a project class, a symbol. MTIME is either the modification time of the directory-local variables file that defined this class, or nil.

When a file beneath DIRECTORY is visited, the mode-specific variables from CLASS are applied to the buffer. The variables for a class are defined using dir-locals-set-class-variables.

Probably introduced at or before Emacs version 23.1.

Source Code

;; Defined in /usr/src/emacs/lisp/files.el.gz
(defun dir-locals-set-directory-class (directory class &optional mtime)
  "Declare that the DIRECTORY root is an instance of CLASS.
DIRECTORY is the name of a directory, a string.
CLASS is the name of a project class, a symbol.
MTIME is either the modification time of the directory-local
variables file that defined this class, or nil.

When a file beneath DIRECTORY is visited, the mode-specific
variables from CLASS are applied to the buffer.  The variables
for a class are defined using `dir-locals-set-class-variables'."
  (setq directory (file-name-as-directory (expand-file-name directory)))
  (unless (assq class dir-locals-class-alist)
    (error "No such class `%s'" (symbol-name class)))
  (push (list directory class mtime) dir-locals-directory-cache))