Subject: bug#17616: patch for svg-clock.el

From: [email-masked]
Date: Wed, 28 May 2014 11:24:19 +0000 (GMT)

Hi,
I am using GNU Emacs 24.4.50.2 (x86_64-unknown-linux-gnu, GTK+ Version
3.4.2) of 2014-05-28
and  svg-clock 0.5.
I found that because svg-clock calls (image-mode) every second, the message
"Type C-c C-c to view the image as an image."
is displayed at the bottom of the screen every second. 
That overwrites all other messages.
The following patch works for me:
- it switched on image-mode when svg-clock is started
- it only calls image-toggle-display-image when the buffer is in
image-mode.
I have seen that the latest commit fixes an issue with image-mode, but as
far as I can tell,
my patch does not introduce a regression.
diff --git a/packages/svg-clock/svg-clock.el
b/packages/svg-clock/svg-clock.el
index 3897243..ff98e5b 100644
--- a/packages/svg-clock/svg-clock.el
+++ b/packages/svg-clock/svg-clock.el
@@ -186,8 +186,8 @@ TIME must have the form (SECOND MINUTE HOUR ...), as
returned by `decode-time'."
       (svg-clock-replace "%SIZE%" (format "%d" svg-clock--actual-size))
       (svg-clock-replace "%SCALE%"
                          (format "%f" (/ svg-clock--actual-size 100.0)))
-      (image-mode)
-      (image-toggle-display-image))))
+      (when (derived-mode-p 'image-mode)
+        (image-toggle-display-image)))))
 (defun svg-clock-update ()
   "Update the clock."
@@ -245,6 +245,7 @@ Optionally PERFORM-UPDATE immediately."
     (setq svg-clock-timer
           (run-with-timer 0 1 'svg-clock-update))
     (svg-clock-mode)
+    (image-mode)
     (message "Clock started")))
kind regards,
dieter