From: Ichimusai <ichi@ichimusai.org>
Subject: Re: HTML in mail (or perhaps replace-regexp might work?)
Date: 28 Aug 2002 22:15:04 +0200 [thread overview]
Message-ID: <m33csyd9kn.fsf@ichimusai.org> (raw)
In-Reply-To: <871y8ig4cy.fsf@unix.home>
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.
Oh, and one more thing, if you can help me, a message buffer is
usually read only, is it possible to have this operate on it anyway,
so that I don't have to reply to it and then wash it?
--
// AA#769 ICQ: 1645566 http://www.ichimusai.org/
\X/ ASCII ribbon campaign - No HTML, RTF or MS Word in mail
6 curses equals 1 hexahex.
next prev parent reply other threads:[~2002-08-28 20:15 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 [this message]
2002-08-28 20:31 ` Ichimusai
[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=m33csyd9kn.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).