Function: c-lang-setvar

c-lang-setvar is a macro defined in cc-langs.el.gz.

Signature

(c-lang-setvar VAR VAL)

Documentation

Make variable VAR buffer local and set it to value VAL.

VAL is evaluated and assigned at mode initialization. More precisely, VAL is evaluated and bound to VAR when the result from the macro c-init-language-vars is evaluated. VAR is typically a standard Emacs variable like comment-start.

c-lang-const is typically used in VAL to get the right value for the language being initialized, and such calls will be macro expanded to the evaluated constant value at compile time.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/cc-langs.el.gz
(defmacro c-lang-setvar (var val)
  "Make variable VAR buffer local and set it to value VAL.
VAL is evaluated and assigned at mode initialization.  More
precisely, VAL is evaluated and bound to VAR when the result from the
macro `c-init-language-vars' is evaluated.  VAR is typically a standard
Emacs variable like `comment-start'.

`c-lang-const' is typically used in VAL to get the right value for the
language being initialized, and such calls will be macro expanded to
the evaluated constant value at compile time."
  (declare (debug (&define name def-form)))
  (let ((elem (assq var (cdr c-emacs-variable-inits))))
    (if elem
	(setcdr elem (list val)) ; Maybe remove "list", sometime. 2006-07-19
      (setcdr c-emacs-variable-inits-tail (list (list var val)))
      (setq c-emacs-variable-inits-tail (cdr c-emacs-variable-inits-tail))))

  ;; Return the symbol, like the other def* forms.
  `',var)