Function: defvar-local
defvar-local is a macro defined in subr.el.gz.
Signature
(defvar-local SYMBOL &optional VALUE DOCSTRING)
Documentation
Define SYMBOL as a buffer-local variable with default value VALUE.
Like defvar but additionally marks the variable as being automatically
buffer-local wherever it is set.
Probably introduced at or before Emacs version 24.3.
Aliases
5x5-defvar-local (obsolete since 28.1)
Source Code
;; Defined in /usr/src/emacs/lisp/subr.el.gz
(defmacro defvar-local (symbol &rest args)
"Define SYMBOL as a buffer-local variable with default value VALUE.
Like `defvar' but additionally marks the variable as being automatically
buffer-local wherever it is set.
\n(fn SYMBOL &optional VALUE DOCSTRING)"
(declare (debug defvar) (doc-string 3) (indent defun))
;; Can't use backquote here, it's too early in the bootstrap.
(let ((value (car-safe args))
(docstring (car-safe (cdr-safe args))))
(list 'progn
(if (zerop (length args))
(list 'defvar symbol)
(list 'defvar symbol value docstring))
(list 'make-variable-buffer-local (list 'quote symbol)))))