Function: setq-mode-local
setq-mode-local is a macro defined in mode-local.el.gz.
Signature
(setq-mode-local MODE &rest ARGS)
Documentation
Assign new values to variables local in MODE.
MODE must be a major mode symbol. ARGS is a list (SYM VAL SYM VAL ...). The symbols SYM are variables; they are literal (not evaluated). The values VAL are expressions; they are evaluated. Set each SYM to the value of its VAL, locally in buffers already in MODE, or in buffers switched to that mode. Return the value of the last VAL.
Source Code
;; Defined in /usr/src/emacs/lisp/cedet/mode-local.el.gz
(defmacro setq-mode-local (mode &rest args)
"Assign new values to variables local in MODE.
MODE must be a major mode symbol.
ARGS is a list (SYM VAL SYM VAL ...).
The symbols SYM are variables; they are literal (not evaluated).
The values VAL are expressions; they are evaluated.
Set each SYM to the value of its VAL, locally in buffers already in
MODE, or in buffers switched to that mode.
Return the value of the last VAL."
(declare (debug (symbolp &rest symbolp form)))
(when args
(let (i ll bl sl tmp sym val)
(setq i 0)
(while args
(setq tmp (make-symbol (format "tmp%d" i))
i (1+ i)
sym (car args)
val (cadr args)
ll (cons (list tmp val) ll)
bl (cons `(cons ',sym ,tmp) bl)
sl (cons `(set (make-local-variable ',sym) ,tmp) sl)
args (cddr args)))
`(let* ,(nreverse ll)
;; Save mode bindings
(mode-local-bind (list ,@bl) '(mode-variable-flag t) ',mode)
;; Assign to local variables in all existing buffers in MODE
(mode-local-map-mode-buffers (lambda () ,@sl) ',mode)
;; Return the last value
,tmp)
)))