diff options
| author | Katsumi Yamaoka | 2010-11-19 04:55:16 +0000 |
|---|---|---|
| committer | Katsumi Yamaoka | 2010-11-19 04:55:16 +0000 |
| commit | b59a9eefbce999421559ae174d90b0a7de0fea51 (patch) | |
| tree | 7afaf12eb0d9a53104526d83df7f641219b56adc | |
| parent | 1265829ec33f6d23787733a3f312984f4f268a33 (diff) | |
| download | emacs-b59a9eefbce999421559ae174d90b0a7de0fea51.tar.gz emacs-b59a9eefbce999421559ae174d90b0a7de0fea51.zip | |
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.
| -rw-r--r-- | lisp/gnus/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/gnus/gnus-art.el | 5 | ||||
| -rw-r--r-- | lisp/gnus/gnus-html.el | 28 | ||||
| -rw-r--r-- | lisp/gnus/mm-decode.el | 15 |
4 files changed, 35 insertions, 20 deletions
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 @@ | |||
| 1 | 2010-11-19 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 2 | |||
| 3 | * gnus-art.el (gnus-mime-display-single) | ||
| 4 | * gnus-html.el (gnus-html-wash-images, gnus-html-prefetch-images) | ||
| 5 | * mm-decode.el (mm-shr): Assume that gnus-inhibit-images may be a group | ||
| 6 | parameter. | ||
| 7 | |||
| 1 | 2010-11-18 Lars Magne Ingebrigtsen <larsi@gnus.org> | 8 | 2010-11-18 Lars Magne Ingebrigtsen <larsi@gnus.org> |
| 2 | 9 | ||
| 3 | * shr.el (shr-table-horizontal-line): Renamed from shr-table-line. | 10 | * 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 | |||
| 5851 | (while ignored | 5851 | (while ignored |
| 5852 | (when (string-match (pop ignored) type) | 5852 | (when (string-match (pop ignored) type) |
| 5853 | (throw 'ignored nil))) | 5853 | (throw 'ignored nil))) |
| 5854 | (if (and (not (and gnus-inhibit-images | 5854 | (if (and (not (and (if (gnus-buffer-live-p gnus-summary-buffer) |
| 5855 | (with-current-buffer gnus-summary-buffer | ||
| 5856 | gnus-inhibit-images) | ||
| 5857 | gnus-inhibit-images) | ||
| 5855 | (string-match "\\`image/" type))) | 5858 | (string-match "\\`image/" type))) |
| 5856 | (setq not-attachment | 5859 | (setq not-attachment |
| 5857 | (and (not (mm-inline-override-p handle)) | 5860 | (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., \"[)$]\")." | |||
| 169 | 169 | ||
| 170 | (defun gnus-html-wash-images () | 170 | (defun gnus-html-wash-images () |
| 171 | "Run through current buffer and replace img tags by images." | 171 | "Run through current buffer and replace img tags by images." |
| 172 | (let (tag parameters string start end images url alt-text) | 172 | (let (tag parameters string start end images url alt-text |
| 173 | inhibit-images blocked-images) | ||
| 174 | (if (buffer-live-p gnus-summary-buffer) | ||
| 175 | (with-current-buffer gnus-summary-buffer | ||
| 176 | (setq inhibit-images gnus-inhibit-images | ||
| 177 | blocked-images (gnus-blocked-images))) | ||
| 178 | (setq inhibit-images gnus-inhibit-images | ||
| 179 | blocked-images (gnus-blocked-images))) | ||
| 173 | (goto-char (point-min)) | 180 | (goto-char (point-min)) |
| 174 | ;; Search for all the images first. | 181 | ;; Search for all the images first. |
| 175 | (while (re-search-forward "<img_alt \\([^>]*\\)>" nil t) | 182 | (while (re-search-forward "<img_alt \\([^>]*\\)>" nil t) |
| @@ -200,7 +207,7 @@ CHARS is a regexp-like character alternative (e.g., \"[)$]\")." | |||
| 200 | ;; immediately. | 207 | ;; immediately. |
| 201 | (let* ((handle (mm-get-content-id (substring url (match-end 0)))) | 208 | (let* ((handle (mm-get-content-id (substring url (match-end 0)))) |
| 202 | (image (when (and handle | 209 | (image (when (and handle |
| 203 | (not gnus-inhibit-images)) | 210 | (not inhibit-images)) |
| 204 | (gnus-create-image | 211 | (gnus-create-image |
| 205 | (mm-with-part handle (buffer-string)) | 212 | (mm-with-part handle (buffer-string)) |
| 206 | nil t)))) | 213 | nil t)))) |
| @@ -222,13 +229,8 @@ CHARS is a regexp-like character alternative (e.g., \"[)$]\")." | |||
| 222 | :keymap gnus-html-image-map | 229 | :keymap gnus-html-image-map |
| 223 | :button-keymap gnus-html-image-map))) | 230 | :button-keymap gnus-html-image-map))) |
| 224 | ;; Normal, external URL. | 231 | ;; Normal, external URL. |
| 225 | (if (or gnus-inhibit-images | 232 | (if (or inhibit-images |
| 226 | (gnus-html-image-url-blocked-p | 233 | (gnus-html-image-url-blocked-p url blocked-images)) |
| 227 | url | ||
| 228 | (if (buffer-live-p gnus-summary-buffer) | ||
| 229 | (with-current-buffer gnus-summary-buffer | ||
| 230 | (gnus-blocked-images)) | ||
| 231 | (gnus-blocked-images)))) | ||
| 232 | (widget-convert-button | 234 | (widget-convert-button |
| 233 | 'link start end | 235 | 'link start end |
| 234 | :action 'gnus-html-insert-image | 236 | :action 'gnus-html-insert-image |
| @@ -505,13 +507,15 @@ Return a string with image data." | |||
| 505 | ;;;###autoload | 507 | ;;;###autoload |
| 506 | (defun gnus-html-prefetch-images (summary) | 508 | (defun gnus-html-prefetch-images (summary) |
| 507 | (when (buffer-live-p summary) | 509 | (when (buffer-live-p summary) |
| 508 | (let ((blocked-images (with-current-buffer summary | 510 | (let (inhibit-images blocked-images) |
| 509 | (gnus-blocked-images)))) | 511 | (with-current-buffer summary-buffer |
| 512 | (setq inhibit-images gnus-inhibit-images | ||
| 513 | blocked-images (gnus-blocked-images))) | ||
| 510 | (save-match-data | 514 | (save-match-data |
| 511 | (while (re-search-forward "<img[^>]+src=[\"']\\(http[^\"']+\\)" nil t) | 515 | (while (re-search-forward "<img[^>]+src=[\"']\\(http[^\"']+\\)" nil t) |
| 512 | (let ((url (gnus-html-encode-url | 516 | (let ((url (gnus-html-encode-url |
| 513 | (mm-url-decode-entities-string (match-string 1))))) | 517 | (mm-url-decode-entities-string (match-string 1))))) |
| 514 | (unless (or gnus-inhibit-images | 518 | (unless (or inhibit-images |
| 515 | (gnus-html-image-url-blocked-p url blocked-images)) | 519 | (gnus-html-image-url-blocked-p url blocked-images)) |
| 516 | (when (gnus-html-cache-expired url gnus-html-image-cache-ttl) | 520 | (when (gnus-html-cache-expired url gnus-html-image-cache-ttl) |
| 517 | (gnus-html-schedule-image-fetching nil | 521 | (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." | |||
| 1694 | ;; Require since we bind its variables. | 1694 | ;; Require since we bind its variables. |
| 1695 | (require 'shr) | 1695 | (require 'shr) |
| 1696 | (let ((article-buffer (current-buffer)) | 1696 | (let ((article-buffer (current-buffer)) |
| 1697 | (shr-blocked-images (if (and (boundp 'gnus-summary-buffer) | ||
| 1698 | (buffer-name gnus-summary-buffer)) | ||
| 1699 | (with-current-buffer gnus-summary-buffer | ||
| 1700 | (gnus-blocked-images)) | ||
| 1701 | shr-blocked-images)) | ||
| 1702 | (shr-content-function (lambda (id) | 1697 | (shr-content-function (lambda (id) |
| 1703 | (let ((handle (mm-get-content-id id))) | 1698 | (let ((handle (mm-get-content-id id))) |
| 1704 | (when handle | 1699 | (when handle |
| 1705 | (mm-with-part handle | 1700 | (mm-with-part handle |
| 1706 | (buffer-string)))))) | 1701 | (buffer-string)))))) |
| 1707 | (shr-inhibit-images gnus-inhibit-images) | 1702 | shr-inhibit-images shr-blocked-images charset) |
| 1708 | charset) | 1703 | (if (and (boundp 'gnus-summary-buffer) |
| 1704 | (buffer-name gnus-summary-buffer)) | ||
| 1705 | (with-current-buffer gnus-summary-buffer | ||
| 1706 | (setq shr-inhibit-images gnus-inhibit-images | ||
| 1707 | shr-blocked-images (gnus-blocked-images))) | ||
| 1708 | (setq shr-inhibit-images gnus-inhibit-images | ||
| 1709 | shr-blocked-images (gnus-blocked-images))) | ||
| 1709 | (unless handle | 1710 | (unless handle |
| 1710 | (setq handle (mm-dissect-buffer t))) | 1711 | (setq handle (mm-dissect-buffer t))) |
| 1711 | (setq charset (mail-content-type-get (mm-handle-type handle) 'charset)) | 1712 | (setq charset (mail-content-type-get (mm-handle-type handle) 'charset)) |