(sixel-image-to-xpm-pixels sixel-image) "};")
(error "Incorrecly formatted sixel string"))))
+(defun sixel-render-images-in-buffer ()
+ "Find and render any sixel images in the current buffer."
+ (interactive)
+ (save-excursion
+ (goto-char (point-min))
+ (while (re-search-forward "\eP[[:ascii:]]*\e\\\\" nil t)
+ (let ((sixel-string (match-string 0))
+ (inhibit-read-only t))
+ (delete-region (match-beginning 0)
+ (match-end 0))
+ (insert-image
+ (create-image (sixel-to-xpm sixel-string) 'xpm t))
+ (insert "\n")))))
+
;;; sixel.el ends here