summaryrefslogtreecommitdiff
path: root/lisp/image-mode.el
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2013-02-15 20:58:20 -0500
committerGlenn Morris <rgm@gnu.org>2013-02-15 20:58:20 -0500
commitbb9dfee1d6d0e67b3564d25580f144d25284c0ea (patch)
tree48504bfef887e8c395e18cd46f7b974bbc17017a /lisp/image-mode.el
parentef5ae980aad7c1b67b4171f7a2c106d1f69aa94f (diff)
downloademacs-bb9dfee1d6d0e67b3564d25580f144d25284c0ea.tar.gz
Display a mode-line frame counter for animated images
* lisp/image.el (image-current-frame): New variable. (image-animate-timeout): Set image-current-frame. * lisp/image-mode.el (image-mode): For animated images, display a frame counter via mode-line-process.
Diffstat (limited to 'lisp/image-mode.el')
-rw-r--r--lisp/image-mode.el11
1 files changed, 9 insertions, 2 deletions
diff --git a/lisp/image-mode.el b/lisp/image-mode.el
index 196336717db..fcbea945714 100644
--- a/lisp/image-mode.el
+++ b/lisp/image-mode.el
@@ -409,11 +409,18 @@ to toggle between display as an image and display as text."
(run-mode-hooks 'image-mode-hook)
(let ((image (image-get-display-property))
(msg1 (substitute-command-keys
- "Type \\[image-toggle-display] to view the image as ")))
+ "Type \\[image-toggle-display] to view the image as "))
+ animated)
(cond
((null image)
(message "%s" (concat msg1 "an image.")))
- ((image-animated-p image)
+ ((setq animated (image-animated-p image))
+ (setq image-current-frame (or (plist-get (cdr image) :index) 0)
+ mode-line-process
+ `(:eval (propertize (format " [%s/%s]"
+ (1+ image-current-frame)
+ ,(car animated))
+ 'help-echo "Frame number")))
(message "%s"
(concat msg1 "text, or "
(substitute-command-keys