Skip to content

Display images in the REPL (slime-media, insert-image) #49

Description

@vindarel

It's shipped in the slime-media contrib.

Example

(setq slime-enable-evaluate-in-emacs t)
(insert-image (create-image "/tmp/test.png"))

Show images in a separate pop-up buffer

https://readevalprint.tumblr.com/post/617089509006491648/previewing-images-in-and-out-of-slime-repl

(defun view-file-slime (file &key (bufname "*image-viewer*"))
  (let ((ns (namestring file)))
    (swank::eval-in-emacs
     `(progn
        (slime-with-popup-buffer (,bufname :connection t :package t)
          (insert-image (create-image ,ns))
          (image-mode)
          (setf buffer-file-name ,ns)
          (not-modified)
          (image-toggle-display-image))
        ;; try to resize the image after the buffer is displayed
        (with-current-buffer ,bufname (image-toggle-display-image))))))


Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    replslimeslySpecific to SLY. Feature not available on SLIME.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions