* image.el (image-multi-frame-p): Remove --without-x warning/error.
authorGlenn Morris <rgm@gnu.org>
Wed, 18 Sep 2013 04:26:19 +0000 (21:26 -0700)
committerGlenn Morris <rgm@gnu.org>
Wed, 18 Sep 2013 04:26:19 +0000 (21:26 -0700)
lisp/ChangeLog
lisp/image.el

index 747a2bf..9b18e25 100644 (file)
@@ -1,6 +1,7 @@
 2013-09-18  Glenn Morris  <rgm@gnu.org>
 
-       * image.el (image-type-from-buffer): Remove --without-x warning/error.
+       * image.el (image-type-from-buffer, image-multi-frame-p):
+       Remove --without-x warning/error.
 
        * mouse.el (mouse-yank-primary):
        Reorder to silence --without-x compilation.
index 8afe3e1..91cc3ad 100644 (file)
@@ -625,13 +625,14 @@ The actual return value is a cons (NIMAGES . DELAY), where NIMAGES is
 the number of frames (or sub-images) in the image and DELAY is the delay
 in seconds that the image specifies between each frame.  DELAY may be nil,
 in which case you might want to use `image-default-frame-delay'."
-  (let* ((metadata (image-metadata image))
-        (images (plist-get metadata 'count))
-        (delay (plist-get metadata 'delay)))
-    (when (and images (> images 1))
-      (if (or (not (numberp delay)) (< delay 0))
-         (setq delay image-default-frame-delay))
-      (cons images delay))))
+  (when (fboundp 'image-metadata)
+    (let* ((metadata (image-metadata image))
+          (images (plist-get metadata 'count))
+          (delay (plist-get metadata 'delay)))
+      (when (and images (> images 1))
+       (if (or (not (numberp delay)) (< delay 0))
+           (setq delay image-default-frame-delay))
+       (cons images delay)))))
 
 (defun image-animated-p (image)
   "Like `image-multi-frame-p', but returns nil if no delay is specified."