]> git.donarmstrong.com Git - lib.git/blobdiff - emacs_el/org-google-weather.el
update more stuff; ditch old cperl mode and vc-bzr
[lib.git] / emacs_el / org-google-weather.el
index e86ec2ea737d9450ae21e7642638d9eca2f05eab..63f601bf786e6ac9ff3b9abc4dc6d9a2e212dadc 100644 (file)
@@ -73,13 +73,17 @@ Valid %-sequences are:
   '((chance_of_rain . "weather-showers-scattered.png")
     (chance_of_snow . "weather-snow.png")
     (chance_of_storm . "weather-storm.png")
+    (cn_cloudy . "weather-overcast.png")
     (cn_heavyrun . "weather-showers.png")
+    (cn_sunny . "weather-clear.png")
     (cloudy . "weather-overcast.png")
     (dust . "weather-fog.png")
     (flurries . "weather-storm.png")
     (fog . "weather-fog.png")
     (haze . "weather-fog.png")
     (icy . "weather-snow.png")
+    (jp_sunny . "weather-clear.png")
+    (jp_cloudy . "weather-overcast.png")
     (mist . "weather-storm.png")
     (mostly_cloudy . "weather-overcast.png")
     (mostly_sunny . "weather-clear.png")
@@ -91,7 +95,7 @@ Valid %-sequences are:
     (storm . "weather-storm.png")
     (thunderstorm . "weather-storm.png")
     (sunny . "weather-clear.png"))
-  "Icons to used to illustrate the weather.")
+  "Icons to use to illustrate the weather.")
 
 ;;;###autoload
 (defun org-google-weather (&optional location language)
@@ -108,25 +112,25 @@ If LOCATION is not set, use org-google-weather-location."
             (high (cadr (assoc 'high forecast)))
             (city (google-weather-data->city data))
             ;; But *they* told me it's just about calling functions!
-            (icon (cdr
-                   (assoc
-                    (intern
-                     (file-name-sans-extension
-                      (file-name-nondirectory
-                       (cadr (assoc 'icon forecast)))))
-                    org-google-weather-icon-alist)))
+            (icon (when (window-system)
+                    (cdr
+                     (assoc
+                      (intern
+                       (file-name-sans-extension
+                        (file-name-nondirectory
+                         (cadr (assoc 'icon forecast)))))
+                      org-google-weather-icon-alist))))
             (temp-symbol (google-weather-data->temperature-symbol data)))
         (format-spec org-google-weather-format
-                     `((?i . ,(if org-google-weather-display-icon-p
-                                  (concat (propertize "icon"
-                                                      'display
-                                                      (create-image
-                                                       (concat
-                                                        org-google-weather-icon-directory
-                                                        "/"
-                                                        icon))
-                                                      'rear-nonsticky '(display))
-                                          " ")
+                     `((?i . ,(if (and icon org-google-weather-display-icon-p)
+                                  (propertize "icon"
+                                              'display
+                                              (create-image
+                                               (concat
+                                                org-google-weather-icon-directory
+                                                "/"
+                                                icon))
+                                              'rear-nonsticky '(display))
                                 ""))
                        (?c . ,condition)
                        (?L . ,location)