Function: setq-default

setq-default is a macro defined in subr.el.gz.

Signature

(setq-default [VAR VALUE]...)

Documentation

Set the default value of variable VAR to VALUE.

VAR, the variable name, is literal (not evaluated); VALUE is an expression: it is evaluated and its value returned. The default value of a variable is seen in buffers that do not have their own values for the variable.

More generally, you can use multiple variables and values, as in
  (setq-default VAR VALUE VAR VALUE...)
This sets each VAR's default value to the corresponding VALUE. The VALUE for the Nth VAR can refer to the new default values of previous VARs.

View in manual

Probably introduced at or before Emacs version 18.

Source Code

;; Defined in /usr/src/emacs/lisp/subr.el.gz
(defmacro setq-default (&rest args)
  "Set the default value of variable VAR to VALUE.
VAR, the variable name, is literal (not evaluated);
VALUE is an expression: it is evaluated and its value returned.
The default value of a variable is seen in buffers
that do not have their own values for the variable.

More generally, you can use multiple variables and values, as in
  (setq-default VAR VALUE VAR VALUE...)
This sets each VAR's default value to the corresponding VALUE.
The VALUE for the Nth VAR can refer to the new default values
of previous VARs.

\(fn [VAR VALUE]...)"
  (declare (debug setq))
  (let ((exps nil))
    (while args
      (push `(set-default ',(pop args) ,(pop args)) exps))
    `(progn . ,(nreverse exps))))