Function: toolbarx-make-command

toolbarx-make-command is a byte-compiled function defined in toolbar-x.el.

Signature

(toolbarx-make-command COMM PREP APP)

Documentation

Return a command made from COMM, PREP and APP.

COMM is a command or a form. PREP and APP are forms. If PREP or APP are non-nil, they are added to the resulting command at the beginning and end, respectively. If both are nil and COMM is a command, COMM is returned.

Source Code

;; Defined in ~/.emacs.d/elpa/auctex-14.1.2/toolbar-x.el
(defun toolbarx-make-command (comm prep app)
  "Return a command made from COMM, PREP and APP.
COMM is a command or a form.  PREP and APP are forms.  If PREP or
APP are non-nil, they are added to the resulting command at the
beginning and end, respectively.  If both are nil and COMM is a
command, COMM is returned."
  (let ((comm-is-command (commandp comm)))
    (if (and (not prep)
             (not app)
             comm-is-command)
        comm
      (lambda () (interactive)
        (let (result)
          (when prep (setq result (eval prep t)))
          (when comm (setq result
                           (if comm-is-command
                               (call-interactively comm)
                             (eval comm t))))
          (when app  (setq result (eval app  t)))
          result)))))