Function: hydra--make-callable

hydra--make-callable is a byte-compiled function defined in hydra.el.

Signature

(hydra--make-callable X)

Documentation

Generate a callable symbol from X.

If X is a function symbol or a lambda, return it. Otherwise, it should be a single statement. Wrap it in an interactive lambda.

Source Code

;; Defined in ~/.emacs.d/elpa/hydra-20250316.1254/hydra.el
(defun hydra--make-callable (x)
  "Generate a callable symbol from X.
If X is a function symbol or a lambda, return it.  Otherwise, it
should be a single statement.  Wrap it in an interactive lambda."
  (cond ((or (symbolp x) (functionp x))
         x)
        ((and (consp x) (eq (car x) 'function))
         (cadr x))
        (t
         `(lambda ()
            (interactive)
            ,x))))