From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: D. Goel Newsgroups: gmane.emacs.help Subject: Re: html mail filter in gnus Date: 18 Sep 2002 16:07:32 -0400 Organization: Posted via Supernews, http://www.supernews.com Sender: help-gnu-emacs-admin@gnu.org Message-ID: <87hegnjc3f.fsf@computer.localdomain> References: <7ifzw8tp5z.fsf@neoscale.com> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1032380169 1556 127.0.0.1 (18 Sep 2002 20:16:09 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 18 Sep 2002 20:16:09 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 17rlF1-0000Oy-00 for ; Wed, 18 Sep 2002 22:16:08 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 17rlFC-0001fP-00; Wed, 18 Sep 2002 16:16:18 -0400 Original-Path: shelby.stanford.edu!nntp.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!sn-xit-03!sn-xit-06!sn-post-01!supernews.com!corp.supernews.com!not-for-mail Original-Newsgroups: gnu.emacs.help,gnu.emacs.gnus User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Original-X-Complaints-To: abuse@supernews.com Original-Lines: 49 Original-Xref: nntp.stanford.edu gnu.emacs.help:105045 gnu.emacs.gnus:60674 Original-To: help-gnu-emacs@gnu.org Errors-To: help-gnu-emacs-admin@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.help:1599 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:1599 > 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) ))) (And of course, after that, to see the actual html mail in lynx itself, you can always type "lynx ~/tmp/email.html" on a term once gnus has put it there.. in fact alias browseemail='lynx ~/tmp/email.html' or alias browseemail='w3m ~/tmp/email.html' )