Function: xor

xor is a byte-compiled function defined in subr.el.gz.

Signature

(xor COND1 COND2)

Documentation

Return the boolean exclusive-or of COND1 and COND2.

If only one of the arguments is non-nil, return it; otherwise return nil.

View in manual

Probably introduced at or before Emacs version 27.1.

Aliases

spam-xor (obsolete since 27.1) proced-xor (obsolete since 27.1) 5x5-xor (obsolete since 27.1) org-xor diff-xor (obsolete since 27.1) idlwave-xor (obsolete since 27.1)

Source Code

;; Defined in /usr/src/emacs/lisp/subr.el.gz
(defsubst xor (cond1 cond2)
  "Return the boolean exclusive-or of COND1 and COND2.
If only one of the arguments is non-nil, return it; otherwise
return nil."
  (declare (pure t) (side-effect-free error-free))
  (cond ((not cond1) cond2)
        ((not cond2) cond1)))