+2010-10-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * gnus-art.el (gnus-blocked-images): New function. Allow the
+ `gnus-blocked-images' to be a function.
+
2010-10-20 Julien Danjou <julien@danjou.info>
* spam.el (spam-list-of-processors): Mark as obsolete.
:group 'gnus-article
:type 'boolean)
-(defcustom gnus-blocked-images "."
- "Images that have URLs matching this regexp will be blocked."
+(defcustom gnus-blocked-images 'gnus-block-private-groups
+ "Images that have URLs matching this regexp will be blocked.
+This can also be a function to be evaluated. If so, it will be
+called with the group name as the parameter, and should return a
+regexp."
:version "24.1"
:group 'gnus-art
:type 'regexp)
(point))
(set-buffer buf))))))
+(defun gnus-block-private-groups (group)
+ (if (gnus-news-group-p group)
+ ;; Block nothing in news groups.
+ nil
+ ;; Block everything anywhere else.
+ "."))
+
+(defun gnus-blocked-images ()
+ (if (functionp gnus-blocked-images)
+ (funcall gnus-blocked-images gnus-newsgroup-name)
+ gnus-blocked-images))
+
;;;
;;; Article editing
;;;
url
(if (buffer-live-p gnus-summary-buffer)
(with-current-buffer gnus-summary-buffer
- gnus-blocked-images)
- gnus-blocked-images))
+ (gnus-blocked-images))
+ (gnus-blocked-images)))
(progn
(widget-convert-button
'link start end
(defun gnus-html-prefetch-images (summary)
(when (buffer-live-p summary)
(let ((blocked-images (with-current-buffer summary
- gnus-blocked-images)))
+ (gnus-blocked-images))))
(save-match-data
(while (re-search-forward "<img[^>]+src=[\"']\\([^\"']+\\)" nil t)
(let ((url (gnus-html-encode-url (match-string 1))))
+2010-10-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * gnus.texi (HTML): Document the function value of
+ gnus-blocked-images.
+
2010-10-20 Julien Danjou <julien@danjou.info>
* emacs-mime.texi (Flowed text): Add a note about mml-enable-flowed
@item gnus-blocked-images
@vindex gnus-blocked-images
-Images that have @acronym{URL}s that match this regexp won't be
-fetched and displayed. For instance, do block all @acronym{URL}s that
-have the string ``ads'' in them, do the following:
+External images that have @acronym{URL}s that match this regexp won't
+be fetched and displayed. For instance, do block all @acronym{URL}s
+that have the string ``ads'' in them, do the following:
@lisp
(setq gnus-blocked-images "ads")
@end lisp
-The default is to block all external images.
+This can also be a function to be evaluated. If so, it will be
+called with the group name as the parameter. The default value is
+@code{gnus-block-private-groups}, which will return @samp{"."} for
+anything that isn't a newsgroup. This means that no external images
+will be fetched as a result of reading mail, so that nobody can use
+web bugs (and the like) to track whether you've read email.
@item gnus-html-cache-directory
@vindex gnus-html-cache-directory