Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
From: Kin Cho <kin@neoscale.com>
Subject: Re: html mail filter in gnus
Date: 19 Sep 2002 13:28:27 -0700	[thread overview]
Message-ID: <7i8z1xzpuc.fsf__40305.4620758214$1138667981$gmane$org@neoscale.com> (raw)
In-Reply-To: <87hegnjc3f.fsf@computer.localdomain>

D. Goel <deego@glue.umd.edu> 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


  parent reply	other threads:[~2002-09-19 20:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <7ifzw8tp5z.fsf@neoscale.com>
2002-09-17 22:16 ` James Cozine
2002-09-18  8:57 ` Jonas Steverud
     [not found] ` <87hegnjc3f.fsf@computer.localdomain>
2002-09-19 20:28   ` Kin Cho [this message]
     [not found]   ` <7i8z1xzpuc.fsf@neoscale.com>
     [not found]     ` <87r8fp1yue.fsf@computer.localdomain>
     [not found]       ` <87n0qd1ypw.fsf@computer.localdomain>
2002-09-20 15:17         ` Nils Goesche
     [not found]         ` <lky99wlmg2.fsf@pc022.bln.elmeg.de>
     [not found]           ` <87it10vccm.fsf@computer.localdomain>
     [not found]             ` <lklm5wleze.fsf@pc022.bln.elmeg.de>
2002-09-24 22:06               ` D. Goel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='7i8z1xzpuc.fsf__40305.4620758214$1138667981$gmane$org@neoscale.com' \
    --to=kin@neoscale.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).