From 9019d095dfd04fffc000c2f00515c661f1a083f3 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 17 Sep 2013 21:26:19 -0700 Subject: [PATCH] * image.el (image-multi-frame-p): Remove --without-x warning/error. --- lisp/ChangeLog | 3 ++- lisp/image.el | 15 ++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 747a2bf5265..9b18e252aff 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,6 +1,7 @@ 2013-09-18 Glenn Morris - * 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. diff --git a/lisp/image.el b/lisp/image.el index 8afe3e14b10..91cc3addb06 100644 --- a/lisp/image.el +++ b/lisp/image.el @@ -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." -- 2.11.4.GIT