emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r105913: Support a new variable `shr-


From: Katsumi Yamaoka
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r105913: Support a new variable `shr-ignore-cache' to re-fetch images when hitting `g' in Gnus.
Date: Sat, 24 Sep 2011 23:09:56 +0000
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 105913
author: Lars Magne Ingebrigtsen <address@hidden>
committer: Katsumi Yamaoka <address@hidden>
branch nick: trunk
timestamp: Sat 2011-09-24 23:09:56 +0000
message:
  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.
modified:
  lisp/gnus/ChangeLog
  lisp/gnus/gnus-sum.el
  lisp/gnus/shr.el
=== modified file 'lisp/gnus/ChangeLog'
--- a/lisp/gnus/ChangeLog       2011-09-22 04:43:36 +0000
+++ b/lisp/gnus/ChangeLog       2011-09-24 23:09:56 +0000
@@ -1,3 +1,11 @@
+2011-09-24  Lars Magne Ingebrigtsen  <address@hidden>
+
+       * 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.
+
 2011-09-22  Katsumi Yamaoka  <address@hidden>
 
        * mml.el (mml-inhibit-compute-boundary): New internal variable.

=== modified file 'lisp/gnus/gnus-sum.el'
--- a/lisp/gnus/gnus-sum.el     2011-09-15 05:46:40 +0000
+++ b/lisp/gnus/gnus-sum.el     2011-09-24 23:09:56 +0000
@@ -9611,8 +9611,10 @@
        (when (gnus-summary-goto-subject (cdr gnus-article-current) nil t)
          (gnus-summary-update-secondary-mark (cdr gnus-article-current))))))
    ((not arg)
-    ;; Select the article the normal way.
-    (gnus-summary-select-article nil 'force))
+    (require 'shr)
+    (let ((shr-ignore-cache t))
+      ;; Select the article the normal way.
+      (gnus-summary-select-article nil 'force)))
    ((equal arg '(16))
     ;; C-u C-u g
     (let ((gnus-inhibit-article-treatments t))

=== modified file 'lisp/gnus/shr.el'
--- a/lisp/gnus/shr.el  2011-07-20 22:48:00 +0000
+++ b/lisp/gnus/shr.el  2011-09-24 23:09:56 +0000
@@ -112,6 +112,7 @@
 (defvar shr-table-depth 0)
 (defvar shr-stylesheet nil)
 (defvar shr-base nil)
+(defvar shr-ignore-cache nil)
 
 (defvar shr-map
   (let ((map (make-sparse-keymap)))
@@ -896,10 +897,16 @@
            (if (> (string-width alt) 8)
                (shr-insert (truncate-string-to-width alt 8))
              (shr-insert alt))))
-        ((url-is-cached (shr-encode-url url))
+        ((and (not shr-ignore-cache)
+              (url-is-cached (shr-encode-url url)))
          (funcall shr-put-image-function (shr-get-image-data url) alt))
         (t
          (insert alt)
+         (when (and shr-ignore-cache
+                    (url-is-cached (shr-encode-url url)))
+           (let ((file (url-cache-create-filename (shr-encode-url url))))
+             (when (file-exists-p file)
+               (delete-file file))))
          (funcall
           (if (fboundp 'url-queue-retrieve)
               'url-queue-retrieve


reply via email to

[Prev in Thread] Current Thread [Next in Thread]