From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Ichimusai Newsgroups: gmane.emacs.help Subject: Re: html mail filter in gnus Date: 18 Sep 2002 08:38:48 +0200 Organization: Lutefisk & Pickled Herring Inc. Sender: help-gnu-emacs-admin@gnu.org Message-ID: References: <7ifzw8tp5z.fsf@neoscale.com> <87d6rccle8.fsf@myahle.kadomony.org> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1032331563 4034 127.0.0.1 (18 Sep 2002 06:46:03 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 18 Sep 2002 06:46:03 +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 17rYb3-00012t-00 for ; Wed, 18 Sep 2002 08:46:02 +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 17rYbH-0002Ig-00; Wed, 18 Sep 2002 02:46:15 -0400 Original-Path: shelby.stanford.edu!nntp.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!colt.net!diablo.netcom.net.uk!netcom.net.uk!news.tele.dk!small.news.tele.dk!195.54.122.107!newsfeed1.bredband.com!bredband!newsfeed1.telenordia.se!algonet!news2.tninet.se!not-for-mail Original-Newsgroups: gnu.emacs.help,gnu.emacs.gnus Original-Lines: 58 Original-NNTP-Posting-Host: wilhelmina.algonet.se Original-X-Trace: green.tninet.se 1032331183 28513 194.213.75.170 (18 Sep 2002 06:39:43 GMT) Original-X-Complaints-To: abuse@telenordia.se Original-NNTP-Posting-Date: Wed, 18 Sep 2002 06:39:43 +0000 (UTC) X-Home-Page: http://www.ichimusai.org/ X-PGP: Key ID: 1024D/930B07E8, Valid to: 2003-07-05, Fingerprint: D42D B550 2D76 4FE9 5E2D 3B99 2FD7 69DF 930B 07E8, Keyserver: pgp.mit.edu User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Original-Xref: nntp.stanford.edu gnu.emacs.help:105012 gnu.emacs.gnus:60648 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:1567 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:1567 James Cozine writes: > Kin Cho 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? > > > > -kin > > ,----[ C-h v mm-discouraged-alternatives RET ] > | mm-discouraged-alternatives's value is > | ("text/html" "text/richtext") This works best if there is a plain text part to the message. However I receive lots of mails which does not have a plain text message in them at all and that is annoying. W3 catches some of them, and renders them nicely enough, but if it is MS Exchange who has converted the mail into HTML or if it is sent by Outlook or Outlook Express, the HTML is so bad that W3 gives up and the message is shown in HTML source instead. It's ugly. It got worse since I upgraded W3. If everything else fails I use this: ;; Remove HTML tags from a buffer (defun wash-ugly-html () "Remove ugly HTML tags" (interactive) (toggle-read-only -1) (save-excursion (beginning-of-buffer) (while (re-search-forward "<[^<@>]*>" nil t) (replace-match "" nil nil)) (beginning-of-buffer) (while (re-search-forward ">" nil t) (replace-match ">" nil nil)) (beginning-of-buffer) (while (re-search-forward "<" nil t) (replace-match "<" nil nil)) (beginning-of-buffer) (while (re-search-forward "&.*;" nil t) (replace-match "" nil nil)))) Bind it to a key of your liking and use it when all else fails. Not the most elegant solution, but it works. It leaves a few tags in sometimes, it's made to leave the References: line in the header and email addresses, but it makes things a lot more readable. -- // AA#769 ICQ: 1645566 http://www.ichimusai.org/ \X/ ASCII ribbon campaign - No HTML, RTF or MS Word in mail Morality is doing what is right, no matter what you're told. Religion is doing what you're told, not matter what is right. -- Jerry Sturdivant, alt.atheism