1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-02-03 14:10:47 -08:00

* image.el (image-multi-frame-p): Remove --without-x warning/error.

This commit is contained in:
Glenn Morris 2013-09-17 21:26:19 -07:00
parent 67645389fc
commit 9019d095df
2 changed files with 10 additions and 8 deletions

View 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.

View 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."