diff options
| author | Lars Magne Ingebrigtsen | 2011-09-24 23:09:56 +0000 |
|---|---|---|
| committer | Katsumi Yamaoka | 2011-09-24 23:09:56 +0000 |
| commit | 728518c3e476131e09848e44570709f81c7d8b09 (patch) | |
| tree | ae6ad52378c1002f64410ae0663fb3867652ded3 | |
| parent | b02ba905b4a8b0b95b858639db8bd6632a9fe57f (diff) | |
| download | emacs-728518c3e476131e09848e44570709f81c7d8b09.tar.gz emacs-728518c3e476131e09848e44570709f81c7d8b09.zip | |
Support a new variable `shr-ignore-cache' to re-fetch images when hitting `g' in Gnus.
gnus-sum.el (gnus-summary-show-article): Bind `shr-ignore-cache' to re-fetch images.
shr.el (shr-tag-img): Support a new variable `shr-ignore-cache' to re-fetch images when hitting `g' in Gnus.
| -rw-r--r-- | lisp/gnus/ChangeLog | 8 | ||||
| -rw-r--r-- | lisp/gnus/gnus-sum.el | 6 | ||||
| -rw-r--r-- | lisp/gnus/shr.el | 9 |
3 files changed, 20 insertions, 3 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index fa97128634b..2cd76486bd7 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2011-09-24 Lars Magne Ingebrigtsen <larsi@gnus.org> | ||
| 2 | |||
| 3 | * gnus-sum.el (gnus-summary-show-article): Bind `shr-ignore-cache' to | ||
| 4 | re-fetch images. | ||
| 5 | |||
| 6 | * shr.el (shr-tag-img): Support a new variable `shr-ignore-cache' to | ||
| 7 | re-fetch images when hitting `g' in Gnus. | ||
| 8 | |||
| 1 | 2011-09-22 Katsumi Yamaoka <yamaoka@jpl.org> | 9 | 2011-09-22 Katsumi Yamaoka <yamaoka@jpl.org> |
| 2 | 10 | ||
| 3 | * mml.el (mml-inhibit-compute-boundary): New internal variable. | 11 | * mml.el (mml-inhibit-compute-boundary): New internal variable. |
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index 423de352453..66b661884e9 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el | |||
| @@ -9611,8 +9611,10 @@ C-u g', show the raw article." | |||
| 9611 | (when (gnus-summary-goto-subject (cdr gnus-article-current) nil t) | 9611 | (when (gnus-summary-goto-subject (cdr gnus-article-current) nil t) |
| 9612 | (gnus-summary-update-secondary-mark (cdr gnus-article-current)))))) | 9612 | (gnus-summary-update-secondary-mark (cdr gnus-article-current)))))) |
| 9613 | ((not arg) | 9613 | ((not arg) |
| 9614 | ;; Select the article the normal way. | 9614 | (require 'shr) |
| 9615 | (gnus-summary-select-article nil 'force)) | 9615 | (let ((shr-ignore-cache t)) |
| 9616 | ;; Select the article the normal way. | ||
| 9617 | (gnus-summary-select-article nil 'force))) | ||
| 9616 | ((equal arg '(16)) | 9618 | ((equal arg '(16)) |
| 9617 | ;; C-u C-u g | 9619 | ;; C-u C-u g |
| 9618 | (let ((gnus-inhibit-article-treatments t)) | 9620 | (let ((gnus-inhibit-article-treatments t)) |
diff --git a/lisp/gnus/shr.el b/lisp/gnus/shr.el index 8faa5071616..fc2f5777fb7 100644 --- a/lisp/gnus/shr.el +++ b/lisp/gnus/shr.el | |||
| @@ -112,6 +112,7 @@ cid: URL as the argument.") | |||
| 112 | (defvar shr-table-depth 0) | 112 | (defvar shr-table-depth 0) |
| 113 | (defvar shr-stylesheet nil) | 113 | (defvar shr-stylesheet nil) |
| 114 | (defvar shr-base nil) | 114 | (defvar shr-base nil) |
| 115 | (defvar shr-ignore-cache nil) | ||
| 115 | 116 | ||
| 116 | (defvar shr-map | 117 | (defvar shr-map |
| 117 | (let ((map (make-sparse-keymap))) | 118 | (let ((map (make-sparse-keymap))) |
| @@ -896,10 +897,16 @@ ones, in case fg and bg are nil." | |||
| 896 | (if (> (string-width alt) 8) | 897 | (if (> (string-width alt) 8) |
| 897 | (shr-insert (truncate-string-to-width alt 8)) | 898 | (shr-insert (truncate-string-to-width alt 8)) |
| 898 | (shr-insert alt)))) | 899 | (shr-insert alt)))) |
| 899 | ((url-is-cached (shr-encode-url url)) | 900 | ((and (not shr-ignore-cache) |
| 901 | (url-is-cached (shr-encode-url url))) | ||
| 900 | (funcall shr-put-image-function (shr-get-image-data url) alt)) | 902 | (funcall shr-put-image-function (shr-get-image-data url) alt)) |
| 901 | (t | 903 | (t |
| 902 | (insert alt) | 904 | (insert alt) |
| 905 | (when (and shr-ignore-cache | ||
| 906 | (url-is-cached (shr-encode-url url))) | ||
| 907 | (let ((file (url-cache-create-filename (shr-encode-url url)))) | ||
| 908 | (when (file-exists-p file) | ||
| 909 | (delete-file file)))) | ||
| 903 | (funcall | 910 | (funcall |
| 904 | (if (fboundp 'url-queue-retrieve) | 911 | (if (fboundp 'url-queue-retrieve) |
| 905 | 'url-queue-retrieve | 912 | 'url-queue-retrieve |