Function: custom-initialize-default

custom-initialize-default is a byte-compiled function defined in custom.el.gz.

Signature

(custom-initialize-default SYMBOL EXP)

Documentation

Initialize SYMBOL with EXP.

This will do nothing if symbol already has a default binding. Otherwise, if symbol has a saved-value property, it will evaluate the car of that and use it as the default binding for symbol. Otherwise, EXP will be evaluated and used as the default binding for symbol.

Source Code

;; Defined in /usr/src/emacs/lisp/custom.el.gz
;;; The `defcustom' Macro.

(defun custom-initialize-default (symbol exp)
  "Initialize SYMBOL with EXP.
This will do nothing if symbol already has a default binding.
Otherwise, if symbol has a `saved-value' property, it will evaluate
the car of that and use it as the default binding for symbol.
Otherwise, EXP will be evaluated and used as the default binding for
symbol."
  (condition-case nil
      (default-toplevel-value symbol)   ;Test presence of default value.
    (void-variable
     ;; The var is not initialized yet.
     (set-default-toplevel-value
      symbol (eval (let ((sv (get symbol 'saved-value)))
                     (if sv (car sv) exp))
                   t)))))