# HG changeset patch # User Katsumi Yamaoka # Date 1283390982 0 # Node ID 8c2040cb14d7e5e0f9a7aed8b3eecf1cc725ab72 # Parent 5412f2e311ef1d12cdc2f2322a6982f603c15219 gnus-html.el (gnus-html-wash-tags): Don't show images that are really small. They're probably tracking images; nntp.el (nntp-request-set-mark): Refuse to do marks if nntp-marks-file-name is nil. diff -r 5412f2e311ef -r 8c2040cb14d7 lisp/gnus/ChangeLog --- a/lisp/gnus/ChangeLog Thu Sep 02 01:24:21 2010 +0000 +++ b/lisp/gnus/ChangeLog Thu Sep 02 01:29:42 2010 +0000 @@ -1,3 +1,11 @@ +2010-09-01 Lars Magne Ingebrigtsen + + * gnus-html.el (gnus-html-wash-tags): Don't show images that are really + small. They're probably tracking images. + + * nntp.el (nntp-request-set-mark): Refuse to do marks if + nntp-marks-file-name is nil. + 2010-09-01 Teodor Zlatanov * gnus-html.el (gnus-html-wash-tags) diff -r 5412f2e311ef -r 8c2040cb14d7 lisp/gnus/gnus-html.el --- a/lisp/gnus/gnus-html.el Thu Sep 02 01:24:21 2010 +0000 +++ b/lisp/gnus/gnus-html.el Thu Sep 02 01:29:42 2010 +0000 @@ -94,7 +94,7 @@ "-o" "pre_conv=1" "-t" (format "%s" tab-width) "-cols" (format "%s" gnus-html-frame-width) - "-o" "display_image=off" + "-o" "display_image=on" "-T" "text/html")))) (gnus-html-wash-tags)))) @@ -142,19 +142,30 @@ (with-current-buffer gnus-summary-buffer gnus-blocked-images) gnus-blocked-images)) - (let ((file (gnus-html-image-id url))) - (if (file-exists-p file) - ;; It's already cached, so just insert it. - (let ((string (buffer-substring start end))) - ;; Delete the ALT text. - (delete-region start end) - (gnus-html-put-image file (point) string)) - ;; We don't have it, so schedule it for fetching - ;; asynchronously. - (push (list url - (set-marker (make-marker) start) - (point-marker)) - images))))))) + (let ((file (gnus-html-image-id url)) + width height) + (when (string-match "height=\"?\\([0-9]+\\)" parameters) + (setq height (string-to-number (match-string 1 parameters)))) + (when (string-match "width=\"?\\([0-9]+\\)" parameters) + (setq width (string-to-number (match-string 1 parameters)))) + ;; Don't fetch images that are really small. They're + ;; probably tracking pictures. + (when (and (or (null height) + (> height 4)) + (or (null width) + (> width 4))) + (if (file-exists-p file) + ;; It's already cached, so just insert it. + (let ((string (buffer-substring start end))) + ;; Delete the ALT text. + (delete-region start end) + (gnus-html-put-image file (point) string)) + ;; We don't have it, so schedule it for fetching + ;; asynchronously. + (push (list url + (set-marker (make-marker) start) + (point-marker)) + images)))))))) ;; Add a link. ((or (equal tag "a") (equal tag "A")) diff -r 5412f2e311ef -r 8c2040cb14d7 lisp/gnus/nntp.el --- a/lisp/gnus/nntp.el Thu Sep 02 01:24:21 2010 +0000 +++ b/lisp/gnus/nntp.el Thu Sep 02 01:29:42 2010 +0000 @@ -1109,7 +1109,8 @@ t) (deffoo nntp-request-set-mark (group actions &optional server) - (unless nntp-marks-is-evil + (when (and (not nntp-marks-is-evil) + nntp-marks-file-name) (nntp-possibly-create-directory group server) (nntp-open-marks group server) (dolist (action actions) @@ -1129,7 +1130,8 @@ nil) (deffoo nntp-request-update-info (group info &optional server) - (unless nntp-marks-is-evil + (when (and (not nntp-marks-is-evil) + nntp-marks-file-name) (nntp-possibly-create-directory group server) (when (nntp-marks-changed-p group server) (nnheader-message 8 "Updating marks for %s..." group)