   "Construct the URL to view the paste with the given ID."
   (concat plaster-root "view/" id))
 
-(defun plaster-to-string (a)
-  "Turn A into a string."
-  (with-output-to-string (princ a)))
-
 (defun plaster-type-mode (type)
   "Return the name of a suitable mode for the given paste TYPE if any."
-  (let ((explicit-mode (cdr (assoc type plaster-type-mode-map)))
+  (let ((explicit-mode (alist-get type plaster-type-mode-map))
         (implicit-mode (intern-soft (concat type "-mode"))))
     (or (and explicit-mode (fboundp explicit-mode) explicit-mode)
         (and implicit-mode (fboundp implicit-mode) implicit-mode))))

    (when (equal id "") (return))
    (let* ((data (plaster-request (plaster-api "view")
                                  `(("id" . ,id))))
           (mode (plaster-type-mode (cdr (assoc 'type data)))))
      (with-current-buffer (generate-new-buffer (cdr (assoc 'title data)))
        (setq plaster-id (plaster-to-string (cdr (assoc '_id data))))
        (insert (cdr (assoc 'text data)))
        (goto-char (point-min))
        (replace-string "
\n" "\n")

Optional argument PARENT The ID of the parent paste to annotate."
  (interactive)
  (let ((id (or parent plaster-parent plaster-id (read-string "Parent paste: "))))
    (with-current-buffer (generate-new-buffer (concat "Annotation to " (format "%s" id)))
      (setq plaster-parent id)
      (plaster-mode)
      (switch-to-buffer (current-buffer)))))
