              `((declare ,@declare)))
          (list #'el-patch--definition (cl-list* ',type name args))))))
 
+;;;;; Classification functions
+
+(defun el-patch-classify-variable (definition)
+  "Classify the items defined by a variable DEFINITION.
+DEFINITION is a list starting with `defvar' or similar."
+  (list (cons 'variable (nth 1 definition))))
+
+(defun el-patch-classify-function (definition)
+  "Classify the items defined by a function DEFINITION.
+DEFINITION is a list starting with `defun' or similar."
+  (list (cons 'function (nth 1 definition))))
+
+(defun el-patch-classify-define-minor-mode (definition)
+  "Classify the items defined by a minor mode DEFINITION.
+DEFINITION is a list starting with `define-minor-mode' or
+similar."
+  (let* ((function-name (nth 1 definition))
+         (variable-name (nth 1 definition))
+         (kw-args (nthcdr 3 definition)))
+    (dotimes (_ 3)
+      (unless (keywordp (car kw-args))
+        (setq kw-args (cdr kw-args))))
+    (while (keywordp (car kw-args))
+      (when (eq (car kw-args) :variable)
+        (setq variable-name (car kw-args)))
+      (setq kw-args (nthcdr 2 kw-args)))
+    (list (cons 'function function-name)
+          (cons 'variable variable-name))))
+
+;;;;; Predefined patch types
+
 ;;;###autoload
 (el-patch-deftype defconst
   :classify el-patch-classify-variable

          ,definition
          "This function was patched by `el-patch'.")))))

(defun el-patch-classify-variable (definition)
  "Classify the items defined by a variable DEFINITION.
DEFINITION is a list starting with `defvar' or similar."
  (list (cons 'variable (nth 1 definition))))

(defun el-patch-classify-function (definition)
  "Classify the items defined by a function DEFINITION.
DEFINITION is a list starting with `defun' or similar."
  (list (cons 'function (nth 1 definition))))

(defun el-patch-classify-define-minor-mode (definition)
  "Classify the items defined by a minor mode DEFINITION.
DEFINITION is a list starting with `define-minor-mode' or
similar."
  (let* ((function-name (nth 1 definition))
         (variable-name (nth 1 definition))
         (kw-args (nthcdr 3 definition)))
    (dotimes (_ 3)
      (unless (keywordp (car kw-args))
        (setq kw-args (cdr kw-args))))
    (while (keywordp (car kw-args))
      (when (eq (car kw-args) :variable)
        (setq variable-name (car kw-args)))
      (setq kw-args (nthcdr 2 kw-args)))
    (list (cons 'function function-name)
          (cons 'variable variable-name))))

;;;###autoload
(progn
  (cl-defmacro el-patch-deftype

         "*el-patch expected*" expected-definition)
        (when (equal actual-definition expected-definition)
          (message "No conflict")))
    (error "There is no patch for %S %S" type name)))

;;;; use-package integration
