]> git.eshelyaron.com Git - emacs.git/commitdiff
Make the `f' command work in image-mode again
authorLars Ingebrigtsen <larsi@gnus.org>
Mon, 24 Jan 2022 10:22:49 +0000 (11:22 +0100)
committerLars Ingebrigtsen <larsi@gnus.org>
Mon, 24 Jan 2022 10:22:57 +0000 (11:22 +0100)
* lisp/image.el (image-show-frame): Protect against not having
computed the animation data yed (bug#53489).

lisp/image.el

index af30353b95623c4335cd50b2b5eaf3d5a9ce8d64..ea1a22698c6636e5643f0c2f98ef011e0ab5eaeb 100644 (file)
@@ -872,8 +872,9 @@ Frames are indexed from 0.  Optional argument NOCHECK non-nil means
 do not check N is within the range of frames present in the image."
   (unless nocheck
     (if (< n 0) (setq n 0)
-      (setq n (min n (1- (car (plist-get (cdr image)
-                                         :animate-multi-frame-data)))))))
+      (setq n (min n (1- (car (or (plist-get (cdr image)
+                                             :animate-multi-frame-data)
+                                  (image-multi-frame-p image))))))))
   (plist-put (cdr image) :index n)
   (force-window-update (plist-get (cdr image) :animate-buffer)))