First draft of rendering mode.
authorTim Vaughan <tgvaughan@gmail.com>
Tue, 21 May 2019 12:06:49 +0000 (14:06 +0200)
committerTim Vaughan <tgvaughan@gmail.com>
Tue, 21 May 2019 12:06:49 +0000 (14:06 +0200)
sixel.el

index 5448ab4..efb1d95 100644 (file)
--- a/sixel.el
+++ b/sixel.el
@@ -208,4 +208,16 @@ Returns a sixel image object."
          (create-image (sixel-to-xpm sixel-string) 'xpm t))
         (insert "\n")))))
 
+(defgroup sixel nil
+  "Render sixel images."
+  :group 'multimedia)
+
+(define-minor-mode sixel-mode
+  "A minor mode which renders sixel graphics." nil "sixel" nil
+  (add-hook 'after-change-functions
+            (lambda (start end size)
+              (sixel-render-images-in-buffer)
+              (message "Render complete."))
+            nil t))
+  
 ;;; sixel.el ends here