                (expected-definition (el-patch--resolve-definition
                                      patch-definition nil))
                (name (cadr expected-definition))
-               (actual-definition (el-patch--find-symbol name type)))
+               (actual-definition (el-patch--locate expected-definition)))
           (cond
            ((not actual-definition)
             (display-warning

allowed. The values are names of functions and variables,
respectively, that are defined by the definition form. This
argument is mandatory.

`:declare' - a list to be put in a `declare' form of the
resulting `el-patch' macro, like:

be defined permanently."
  :type 'hook)

(defun el-patch--locate (definition)
  "Return the Lisp form corresponding to the given DEFINITION.
Return nil if such a definition cannot be found. (That would
happen if the definition were generated dynamically.) TYPE is a
symbol `defun', `defmacro', etc. which is used to determine
whether the symbol is a function or variable."
  (let* ((type (nth 0 definition))
         (props (alist-get type el-patch-deftype-alist))
         (locator (plist-get props :locate)))
    (unless locator
      (error
       "Definition type `%S' has no `:locate' in `el-patch-deftype-alist'"))
    (funcall locator definition)))

;;;###autoload
(defun el-patch-validate (name type &optional nomsg run-hooks)
