I want to open gif image link (in Org-mode) with emacs lisp function image-animate. Here is my try. https://gist.github.com/e2e05b28e0a6bf3bd9f27f345696892d But I got some problems, how to open a temp buffer window to display the image? and Seems image-animate require IMAGE as absolute path. I don't know how to use org-file-apps parameters FILE and LINK.

Usually the org-mode GIF file link looks like this: [[file:data/eb/cf96ad-9e34-4ef6-b0c2-5c31bb869aa6/59715_170807115059_1.gif]]


1 Answer 1


I think you were already very close.

Starting from your code I ended up with the entry

(lambda (file link)
  (let ((my-image (create-image file))
        (tmpbuf (get-buffer-create "*gif")))
    (switch-to-buffer tmpbuf)
    (insert-image my-image)
    (image-animate my-image)))

for ".gif" in variable org-file-apps.

I think the main issue with your code was that you did not give the buffer enough time to live.

  • Do you know how to loop playing the gif? Oct 15, 2017 at 5:23
  • Set the third parameter to image-animate to t for endless repetition. For the example above this is (image-animate my-image nil t). See the documentation of image-animate for further information.
    – Marco Wahl
    Oct 15, 2017 at 12:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.