feat(emacs): display animated gifs inline

This commit is contained in:
2026-01-30 13:40:58 -07:00
parent fc299c84d1
commit b1c36bd094
2 changed files with 28 additions and 0 deletions

View File

@@ -39,6 +39,7 @@
syd/org/noter
syd/org/tufte-latex
syd/org/srs
syd/org/inline-animation
syd/smartparens
syd/snippets
syd/ptemplate

View File

@@ -0,0 +1,27 @@
;; -*- lexical-binding: t; -*-
(require 'syd/base)
(require 'syd/org)
(use-package org-inline-anim
:hook (org-mode . org-inline-anim-mode)
:config
(defun syd-inline-animation-get-image-overlay ()
"Return image overlay at point or nil. Extracted from
`org-inline-anim-animate'."
(save-excursion
(when-let* ((element (org-element-at-point)))
(if (eq (org-element-type element) 'src-block)
(org-inline-anim--get-image-overlay-in-result-of-this)
(if (and (eq (org-element-type element) 'paragraph)
(org-element-property :results element))
(org-inline-anim--get-image-overlay-in-element element)
(org-inline-anim--get-image-overlay-at-point))))))
(syd-add-hook 'org-ctrl-c-ctrl-c-hook
(defun syd-inline-animation--ctrl-c-ctrl-c-h ()
(interactive)
(when (syd-inline-animation-get-image-overlay)
(call-interactively #'org-inline-anim-animate)))))
(provide 'syd/org/inline-animation)