From: Katsumi Yamaoka Date: Fri, 19 Nov 2010 04:55:16 +0000 (+0000) Subject: Assume that gnus-inhibit-images may be a group parameter. X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~438^2~45^2~195 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b59a9eefbce999421559ae174d90b0a7de0fea51;p=emacs.git Assume that gnus-inhibit-images may be a group parameter. gnus-art.el (gnus-mime-display-single) gnus-html.el (gnus-html-wash-images, gnus-html-prefetch-images) mm-decode.el (mm-shr): Assume that gnus-inhibit-images may be a group parameter. --- diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index df914bc5551..18a576930a4 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,10 @@ +2010-11-19 Katsumi Yamaoka + + * gnus-art.el (gnus-mime-display-single) + * gnus-html.el (gnus-html-wash-images, gnus-html-prefetch-images) + * mm-decode.el (mm-shr): Assume that gnus-inhibit-images may be a group + parameter. + 2010-11-18 Lars Magne Ingebrigtsen * shr.el (shr-table-horizontal-line): Renamed from shr-table-line. diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index 4ff36e7a589..51d3246b79b 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -5851,7 +5851,10 @@ If displaying \"text/html\" is discouraged \(see (while ignored (when (string-match (pop ignored) type) (throw 'ignored nil))) - (if (and (not (and gnus-inhibit-images + (if (and (not (and (if (gnus-buffer-live-p gnus-summary-buffer) + (with-current-buffer gnus-summary-buffer + gnus-inhibit-images) + gnus-inhibit-images) (string-match "\\`image/" type))) (setq not-attachment (and (not (mm-inline-override-p handle)) diff --git a/lisp/gnus/gnus-html.el b/lisp/gnus/gnus-html.el index 4df9a0fbedc..90814faeddd 100644 --- a/lisp/gnus/gnus-html.el +++ b/lisp/gnus/gnus-html.el @@ -169,7 +169,14 @@ CHARS is a regexp-like character alternative (e.g., \"[)$]\")." (defun gnus-html-wash-images () "Run through current buffer and replace img tags by images." - (let (tag parameters string start end images url alt-text) + (let (tag parameters string start end images url alt-text + inhibit-images blocked-images) + (if (buffer-live-p gnus-summary-buffer) + (with-current-buffer gnus-summary-buffer + (setq inhibit-images gnus-inhibit-images + blocked-images (gnus-blocked-images))) + (setq inhibit-images gnus-inhibit-images + blocked-images (gnus-blocked-images))) (goto-char (point-min)) ;; Search for all the images first. (while (re-search-forward "]*\\)>" nil t) @@ -200,7 +207,7 @@ CHARS is a regexp-like character alternative (e.g., \"[)$]\")." ;; immediately. (let* ((handle (mm-get-content-id (substring url (match-end 0)))) (image (when (and handle - (not gnus-inhibit-images)) + (not inhibit-images)) (gnus-create-image (mm-with-part handle (buffer-string)) nil t)))) @@ -222,13 +229,8 @@ CHARS is a regexp-like character alternative (e.g., \"[)$]\")." :keymap gnus-html-image-map :button-keymap gnus-html-image-map))) ;; Normal, external URL. - (if (or gnus-inhibit-images - (gnus-html-image-url-blocked-p - url - (if (buffer-live-p gnus-summary-buffer) - (with-current-buffer gnus-summary-buffer - (gnus-blocked-images)) - (gnus-blocked-images)))) + (if (or inhibit-images + (gnus-html-image-url-blocked-p url blocked-images)) (widget-convert-button 'link start end :action 'gnus-html-insert-image @@ -505,13 +507,15 @@ Return a string with image data." ;;;###autoload (defun gnus-html-prefetch-images (summary) (when (buffer-live-p summary) - (let ((blocked-images (with-current-buffer summary - (gnus-blocked-images)))) + (let (inhibit-images blocked-images) + (with-current-buffer summary-buffer + (setq inhibit-images gnus-inhibit-images + blocked-images (gnus-blocked-images))) (save-match-data (while (re-search-forward "]+src=[\"']\\(http[^\"']+\\)" nil t) (let ((url (gnus-html-encode-url (mm-url-decode-entities-string (match-string 1))))) - (unless (or gnus-inhibit-images + (unless (or inhibit-images (gnus-html-image-url-blocked-p url blocked-images)) (when (gnus-html-cache-expired url gnus-html-image-cache-ttl) (gnus-html-schedule-image-fetching nil diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el index f27cc5907b0..bd9e704144e 100644 --- a/lisp/gnus/mm-decode.el +++ b/lisp/gnus/mm-decode.el @@ -1694,18 +1694,19 @@ If RECURSIVE, search recursively." ;; Require since we bind its variables. (require 'shr) (let ((article-buffer (current-buffer)) - (shr-blocked-images (if (and (boundp 'gnus-summary-buffer) - (buffer-name gnus-summary-buffer)) - (with-current-buffer gnus-summary-buffer - (gnus-blocked-images)) - shr-blocked-images)) (shr-content-function (lambda (id) (let ((handle (mm-get-content-id id))) (when handle (mm-with-part handle (buffer-string)))))) - (shr-inhibit-images gnus-inhibit-images) - charset) + shr-inhibit-images shr-blocked-images charset) + (if (and (boundp 'gnus-summary-buffer) + (buffer-name gnus-summary-buffer)) + (with-current-buffer gnus-summary-buffer + (setq shr-inhibit-images gnus-inhibit-images + shr-blocked-images (gnus-blocked-images))) + (setq shr-inhibit-images gnus-inhibit-images + shr-blocked-images (gnus-blocked-images))) (unless handle (setq handle (mm-dissect-buffer t))) (setq charset (mail-content-type-get (mm-handle-type handle) 'charset))