Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
From: Ichimusai <ichi@ichimusai.org>
Subject: Re: HTML in mail (or perhaps replace-regexp might work?)
Date: 28 Aug 2002 22:31:23 +0200	[thread overview]
Message-ID: <m3r8gibu90.fsf@ichimusai.org> (raw)
In-Reply-To: <m33csyd9kn.fsf@ichimusai.org>

Ichimusai <ichi@ichimusai.org> writes:

> Vasily Korytov <moderator@faqteam.org> writes:
> 
> > Try this function:
> > 
> > (defun vk-remove-tags ()
> >   "Remove everything, that fits the  regexp in current buffer."
> >   (interactive)
> >   (save-excursion
> >     (beginning-of-buffer)
> >     (while (re-search-forward "" nil t)
> >       (replace-match "" nil nil))))
> > 
> > Besides, I don't recommend binding it globally, esp. to C-backspace.
> 
> Brilliant!
> 
> I was close to the solution myself, I had it this way:
> 
> (defun wash-ugly-html ()
>     (while (re-search-forward "\\(<.*>\\)\\|\\(&.*;\\)" nil t)
>       (replace-match "" nil nil)))
> 
> (global-set-key "\C-\M-H" 'wash-ugly-html)
> 
> But of course that did not work very well. Replaced the regexp in your
> function and it works pretty well so far I have tested it, with one
> exception, is it possible to position just after the headers and not
> at the top of the buffer before replacing? 
> 
> Because otherwise the References: line is caught in the <.*> part of
> the regexp.

I solved the references lines problem by narrowing my regexp a bit, it
now looks like "\\(<[^<>.@]*>\\)\\|\\(&.*;\\)" instead.

Thus something like

<html>
> You said that you are using HTML?<BR>
</html>

Will remove the apropriate tags but leave the ">" quote mark.

Sorry guys if I am talking to myself, I'm rather excited though.

-- 
  // AA#769 ICQ: 1645566 http://www.ichimusai.org/
\X/  ASCII ribbon campaign - No HTML, RTF or MS Word in mail
Noone is perfect, but some parts of you are rather exquisite!
    -- Ichimusai (7 beers later 3 seconds before the slap)


  reply	other threads:[~2002-08-28 20:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-28 16:26 HTML in mail Ichimusai
2002-08-28 16:29 ` Ichimusai
2002-08-28 17:00 ` Vasily Korytov
     [not found]   ` <m3it1ueqkj.fsf_-_@ichimusai.org>
     [not found]     ` <871y8ig4cy.fsf@unix.home>
2002-08-28 19:54       ` HTML in mail (or perhaps replace-regexp might work?) Vasily Korytov
2002-08-28 20:15       ` Ichimusai
2002-08-28 20:31         ` Ichimusai [this message]
     [not found]       ` <5llm6qwvio.fsf@rum.cs.yale.edu>
     [not found]         ` <wupr9gda.fsf@ID-23066.news.dfncis.de>
2002-09-13 15:26           ` Stefan Monnier <foo@acm.com>
2002-09-14 15:15             ` Clemens Fischer

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=m3r8gibu90.fsf@ichimusai.org \
    --to=ichi@ichimusai.org \
    /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).