Function: bound-and-true-p

bound-and-true-p is a macro defined in bindings.el.gz.

Signature

(bound-and-true-p VAR)

Documentation

Return the value of symbol VAR if it is bound, else nil.

Note that if lexical-binding is in effect, this function isn't meaningful if it refers to a lexically bound variable.

Aliases

org-bound-and-true-p (obsolete since 9.0)

Source Code

;; Defined in /usr/src/emacs/lisp/bindings.el.gz
(defmacro bound-and-true-p (var)
  "Return the value of symbol VAR if it is bound, else nil.
Note that if `lexical-binding' is in effect, this function isn't
meaningful if it refers to a lexically bound variable."
  (unless (symbolp var)
    (signal 'wrong-type-argument (list 'symbolp var)))
  `(and (boundp (quote ,var)) ,var))