(defadvice mm-inline-text-html-render-with-w3m (around follow-link (handle)
activate)
"Follow a link in nnrss group."
(if (string-match "\\`nnrss:" gnus-newsgroup-name)
(let* ((buffer (mm-handle-buffer handle))
(link (with-current-buffer buffer
(goto-char (point-max))
(when (re-search-backward
"link"
nil t)
(match-string 1))))
type contents)
(if (and link
(mm-with-unibyte-buffer
(when (setq type (w3m-retrieve link))
(setq contents (buffer-string)))))
(progn
(with-current-buffer buffer
(erase-buffer)
(mm-disable-multibyte)
(insert contents))
(setcar (cdr handle) (list type))
(let ((mail-parse-charset nil)
(w3mr (symbol-function 'w3m-region)))
(fset 'w3m-region
`(lambda (start end &optional url charset)
(funcall w3mr start end ,link charset)))
(unwind-protect
ad-do-it
(fset 'w3m-region w3mr))))
(message "Retrieving %s failed" link)
ad-do-it))
ad-do-it))