Function: add-dir-local-variable

add-dir-local-variable is an autoloaded, interactive and byte-compiled function defined in files-x.el.gz.

Signature

(add-dir-local-variable MODE VARIABLE VALUE)

Documentation

Add directory-local VARIABLE with its VALUE and MODE to .dir-locals.el.

Probably introduced at or before Emacs version 23.2.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/files-x.el.gz
;;;###autoload
(defun add-dir-local-variable (mode variable value)
  "Add directory-local VARIABLE with its VALUE and MODE to .dir-locals.el."
  (interactive
   (let (variable)
     (list
      (read-file-local-variable-mode)
      (setq variable (read-file-local-variable "Add directory-local variable"))
      (read-file-local-variable-value variable))))
  (modify-dir-local-variable mode variable value 'add-or-replace))