From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.user/1193 Path: news.gmane.org!not-for-mail From: Kin Cho Newsgroups: gmane.emacs.gnus.user Subject: Re: html mail filter in gnus Date: 19 Sep 2002 13:28:27 -0700 Message-ID: <7i8z1xzpuc.fsf__40305.4620758214$1138667981$gmane$org@neoscale.com> References: <7ifzw8tp5z.fsf@neoscale.com> <87hegnjc3f.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 1138667981 10132 80.91.229.2 (31 Jan 2006 00:39:41 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 31 Jan 2006 00:39:41 +0000 (UTC) Original-X-From: nobody Tue Jan 17 17:28:46 2006 Original-Path: quimby.gnus.org!lackawana.kippona.com!stargate.gts.cz!fu-berlin.de!uni-berlin.de!12.24.46.66!not-for-mail Original-Newsgroups: gnu.emacs.help,gnu.emacs.gnus Original-Sender: kin@nscldt26 Original-NNTP-Posting-Host: 12.24.46.66 Original-X-Trace: fu-berlin.de 1032467644 5325447 12.24.46.66 (16 [151019]) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Original-Xref: bridgekeeper.physik.uni-ulm.de gnus-emacs-gnus:1333 Original-Lines: 48 X-Gnus-Article-Number: 1333 Tue Jan 17 17:28:46 2006 Xref: news.gmane.org gmane.emacs.gnus.user:1193 Archived-At: D. Goel writes: > > Hi, > > > > I'm getting html mail quite often now and it's getting annoying. > > Does anyone has a gnus filter to filter out the html tags and > > leave the plain text behind? > > > this shows you the lynxed mail.. this got into my .gnus from an > earlier post in g.e.gnus ---> > > > ;; function to call to handle text/html attachments > (defun my:gnus-html2text (handle) > (let (text) > (with-temp-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) > ))) Hi, This approach seems to best fit my need. How do you hook my:gnus-html2text into gnus so that it is run automatically on html mail? Thanks. -kin