From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.user/1196 Path: news.gmane.org!not-for-mail From: Nils Goesche Newsgroups: gmane.emacs.gnus.user Subject: Re: html mail filter in gnus Date: 20 Sep 2002 17:17:49 +0200 Organization: No Such Thing Message-ID: References: <7ifzw8tp5z.fsf@neoscale.com> <87hegnjc3f.fsf@computer.localdomain> <7i8z1xzpuc.fsf@neoscale.com> <87r8fp1yue.fsf@computer.localdomain> <87n0qd1ypw.fsf@computer.localdomain> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1138667983 10146 80.91.229.2 (31 Jan 2006 00:39:43 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 31 Jan 2006 00:39:43 +0000 (UTC) Original-X-From: nobody Tue Jan 17 17:28:47 2006 Original-Path: quimby.gnus.org!news.ccs.neu.edu!news.dfci.harvard.edu!news.harvard.edu!iad-peer.news.verio.net!news.verio.net!fu-berlin.de!uni-berlin.de!62.154.173.140!not-for-mail Original-Newsgroups: gnu.emacs.help,gnu.emacs.gnus Original-Sender: nils@pc022.bln.elmeg.de Original-NNTP-Posting-Host: 62.154.173.140 Original-X-Trace: fu-berlin.de 1032535071 5697901 62.154.173.140 (16 [125440]) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 Original-Xref: bridgekeeper.physik.uni-ulm.de gnus-emacs-gnus:1336 Original-Lines: 49 X-Gnus-Article-Number: 1336 Tue Jan 17 17:28:47 2006 Xref: news.gmane.org gmane.emacs.gnus.user:1196 Archived-At: D. Goel writes: [howto use lynx for HTML MIME parts] And after a few changes, it works fine for me, too. Thanks! Here everything together: (defun my:gnus-html2text (handle) (let (text) (with-temp-buffer (mm-with-unibyte-buffer (mm-insert-part handle) (save-window-excursion (my:html2text-region (point-min) (point-max)) (setq text (buffer-string))))) (mm-insert-inline handle text))) (defun my:html2text-region (min max) "Replace the HTML region from MIN to MAX with lynx --dump." (interactive "r") (let ((file "/tmp/email.html")) (unwind-protect (progn (write-region min max file) (delete-region min max) (insert (shell-command-to-string (concat "lynx " "lynx -dump " (shell-quote-argument (expand-file-name file)))))) (delete-file file)))) (setq mm-inline-media-tests (cons '("text/html" my:gnus-html2text (lambda (handle) (fboundp 'my:gnus-html2text))) (let ((old (assoc "text/html" mm-inline-media-tests))) (if old (delete old mm-inline-media-tests) mm-inline-media-tests)))) Regards, -- Nils Goesche "Don't ask for whom the tolls." PGP key ID 0x0655CFA0