Fix up the w3m/curl dependencies.
authorLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Tue, 14 Sep 2010 17:17:20 +0000 (19:17 +0200)
committerLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Tue, 14 Sep 2010 17:17:20 +0000 (19:17 +0200)
* mm-decode.el (mm-text-html-renderer): Don't have gnus-article-html
depend on curl, which isn't essential.

* gnus-html.el (gnus-html-schedule-image-fetching)
(gnus-html-prefetch-images): Check for curl before using it.

lisp/ChangeLog
lisp/gnus-html.el
lisp/mm-decode.el

index 4f96504..35259af 100644 (file)
@@ -1,5 +1,11 @@
 2010-09-14  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
+       * gnus-html.el (gnus-html-schedule-image-fetching)
+       (gnus-html-prefetch-images): Check for curl before using it.
+
+       * mm-decode.el (mm-text-html-renderer): Don't have gnus-article-html
+       depend on curl, which isn't essential.
+
        * imap.el: Revert back to version
        cb950ed8ff3e0f40dac437a51b269166f9ffb60d, since some of the changes
        seem problematic.
index 8bfbaaa..ffa5ff1 100644 (file)
@@ -288,18 +288,19 @@ fit these criteria."
 (defun gnus-html-schedule-image-fetching (buffer images)
   (gnus-message 8 "gnus-html-schedule-image-fetching: buffer %s, images %s"
                 buffer images)
-  (let* ((url (caar images))
-        (process (start-process
-                  "images" nil "curl"
-                  "-s" "--create-dirs"
-                  "--location"
-                  "--max-time" "60"
-                  "-o" (gnus-html-image-id url)
-                  (mm-url-decode-entities-string url))))
-    (process-kill-without-query process)
-    (set-process-sentinel process 'gnus-html-curl-sentinel)
-    (gnus-set-process-plist process (list 'images images
-                                         'buffer buffer))))
+  (when (executable-find "curl")
+    (let* ((url (caar images))
+          (process (start-process
+                    "images" nil "curl"
+                    "-s" "--create-dirs"
+                    "--location"
+                    "--max-time" "60"
+                    "-o" (gnus-html-image-id url)
+                    (mm-url-decode-entities-string url))))
+      (process-kill-without-query process)
+      (set-process-sentinel process 'gnus-html-curl-sentinel)
+      (gnus-set-process-plist process (list 'images images
+                                           'buffer buffer)))))
 
 (defun gnus-html-image-id (url)
   (expand-file-name (sha1 url) gnus-html-cache-directory))
@@ -441,7 +442,8 @@ This only works if the article in question is HTML."
 ;;;###autoload
 (defun gnus-html-prefetch-images (summary)
   (let (blocked-images urls)
-    (when (buffer-live-p summary)
+    (when (and (buffer-live-p summary)
+              (executable-find "curl"))
       (with-current-buffer summary
        (setq blocked-images gnus-blocked-images))
       (save-match-data
index 725adcf..c4cbce4 100644 (file)
         ,disposition ,description ,cache ,id))
 
 (defcustom mm-text-html-renderer
-  (cond ((and (executable-find "w3m")
-             (executable-find "curl"))
-        'gnus-article-html)
+  (cond ((executable-find "w3m") 'gnus-article-html)
        ((executable-find "links") 'links)
        ((executable-find "lynx") 'lynx)
        ((locate-library "w3") 'w3)