 (defvar gnu-elpa-recipe)
 (defvar emacsmirror-recipe)
 
+(defun straight--get-melpa-recipe (package &optional cause)
+  "Look up a PACKAGE recipe in MELPA.
+PACKAGE should be a symbol. If the package has a recipe listed in
+MELPA, return it; otherwise return nil. If MELPA is not
+available, clone it automatically before looking up the recipe.
+CAUSE is a string explaining why MELPA might need to be cloned."
+  (unless (straight--repository-is-available-p melpa-recipe)
+    (straight--clone-repository melpa-recipe cause))
+  (with-temp-buffer
+    (when
+        (condition-case nil
+            (insert-file-contents-literally
+             (straight--with-plist melpa-recipe
+                 (local-repo)
+               (straight--file "repos" local-repo "recipes"
+                               (symbol-name package))))
+          (error nil))
+      (read (current-buffer)))))
+
 (defun straight--get-gnu-elpa-recipe (package &optional cause)
   "Look up a PACKAGE recipe in GNU ELPA.
 PACKAGE should be a symbol. If the package is maintained in GNU
 ELPA, a MELPA-style recipe is returned. Otherwise nil is
 returned. If GNU ELPA is not available, clone it automatically
-before looking up the recipe."
+before looking up the recipe. CAUSE is a string explaining why
+GNU ELPA might need to be cloned."
   (unless (straight--repository-is-available-p gnu-elpa-recipe)
     (straight--clone-repository gnu-elpa-recipe cause))
   (straight--with-plist gnu-elpa-recipe

      ;; Next most preferred is GNU ELPA.
      (or (and (member 'gnu-elpa sources)
               (straight--get-gnu-elpa-recipe package cause))
          ;; EmacsMirror comes after GNU ELPA because we prefer
          ;; "official" sources, so that it is easier to figure out
          ;; what upstream to submit changes against.
          (and (member 'emacsmirror sources)
               (straight--get-emacsmirror-recipe package cause))
          ;; This shouldn't be possible in normal cases, since
          ;; EmacsMirror ostensibly contains all packages that are in
          ;; MELPA. But you never know. It's better to return a
          ;; non-Git recipe than to error out entirely.
          melpa-recipe

  "Interactively select a recipe from one of the recipe repositories.
All three recipe repositories will first be cloned. If a prefix
argument is provided, copy the recipe to the kill ring;
otherwise, insert it into the current buffer. From Lisp code,
copying is achieved by passing ACTION as `copy'; insertion is
achieved by passing ACTION as `insert'; neither are done if
ACTION is nil or omitted."
  (interactive (list (if current-prefix-arg
                         'copy
                       'insert)))
