From 78e0c74ddc361719d8be1b4f3eb6e58fa17f8fdb Mon Sep 17 00:00:00 2001 From: Lars Magne Ingebrigtsen Date: Tue, 14 Sep 2010 19:17:20 +0200 Subject: [PATCH] Fix up the w3m/curl dependencies. * 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 | 6 ++++++ lisp/gnus-html.el | 28 +++++++++++++++------------- lisp/mm-decode.el | 4 +--- 3 files changed, 22 insertions(+), 16 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4f9650401..35259af41 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,11 @@ 2010-09-14 Lars Magne Ingebrigtsen + * 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. diff --git a/lisp/gnus-html.el b/lisp/gnus-html.el index 8bfbaaa52..ffa5ff1ac 100644 --- a/lisp/gnus-html.el +++ b/lisp/gnus-html.el @@ -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 diff --git a/lisp/mm-decode.el b/lisp/mm-decode.el index 725adcf55..c4cbce4ab 100644 --- a/lisp/mm-decode.el +++ b/lisp/mm-decode.el @@ -105,9 +105,7 @@ ,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) -- 2.25.1