         (error "You must specify an `el-patch-feature' directive for `%S'"
                function-name))
       (eval
-       (el-patch--autoload-function function-name el-patch--feature)))
+       (el-patch--autoload-function (car definition)
+                                    function-name
+                                    el-patch--feature)))
     (advice-add function-name :override advice-name)))
 
 ;;;###autoload

etc. Update `el-patch--patches', create the advice, and activate
it."
  (let* ((function-name (cadr patch-definition))
         (advice-name (el-patch--advice-name function-name)))
    (puthash function-name patch-definition el-patch--patches)
    (setq el-patch--feature nil)
    (eval (el-patch--function-to-advice
           (el-patch--resolve-definition patch-definition t)))
    ;; FIXME should not require `el-patch-feature' directive if the
    ;; function is autoloaded
    (unless (and (fboundp function-name)

  "Patch an inline function. The ARGS are the same as for `defsubst'."
  (declare (indent defun))
  `(el-patch--definition ',(cons 'defsubst args)))

;;;###autoload
(defmacro el-patch-define-minor-mode (&rest args)
  "Patch a minor mode. The ARGS are the same as for `define-minor-mode'."
  (declare (doc-string 2)
           (indent defun))
  `(el-patch--definition ',(cons 'define-minor-mode args)))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; Patch directives
