 (require 'url)
 (require 'json)
 
+(defun plaster-read-type (&optional (default "text"))
+  (let ((completion-ignore-case t))
+    (completing-read "Paste type:" plaster-types nil t nil nil default)))
+
 (defun plaster-find-session-token (cookies)
   "Find the radiance-session token in the cookie jar.
 

  (let* ((mode major-mode)
         (type (or type
                   (plaster-mode-type major-mode)
                   (read-string "Paste type: " "text")))
         (title (or title
                    (read-string "Paste title: " (buffer-name))))
         (text (buffer-substring (mark) (point))))

The remote paste will be automatically created when the buffer
is opened."
  (interactive)
  (let* ((title (read-string "Paste title: "))
         (type (plaster-read-type)))
    (with-current-buffer (generate-new-buffer title)
      (insert " ")
      (switch-to-buffer (current-buffer))
