Elisp: Check If Function / Variable is Defined

By Xah Lee. Date: . Last updated: .

Check If Function is Defined

;; check if a function is defined
(fboundp 'setq)
; t

(fboundp 'xyz)
; nil

Technically, fboundp check a Symbol's function cell.

Check If Variable is Defined

;; check if a variable is defined

(boundp 'tab-width)
;; t

(boundp 'xyz)
;; nil

Technically, boundp checks a Symbol's value cell.

Check Feature

Emacs Lisp, symbol

Emacs Lisp, Get Version, OS Type, System Info, etc