From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.user/1001 Path: news.gmane.org!not-for-mail From: Ichimusai Newsgroups: gmane.emacs.gnus.user Subject: Re: HTML in mail (or perhaps replace-regexp might work?) Date: 28 Aug 2002 22:15:04 +0200 Organization: ichimusai.org Message-ID: References: <87k7maor4i.fsf@unix.home> <871y8ig4cy.fsf@unix.home> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1138667843 9283 80.91.229.2 (31 Jan 2006 00:37:23 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 31 Jan 2006 00:37:23 +0000 (UTC) Original-X-From: nobody Tue Jan 17 17:28:28 2006 Original-Path: quimby.gnus.org!lackawana.kippona.com!news.teledanmark.no!news.telebyte.nl!fr.usenet-edu.net!usenet-edu.net!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news.algonet.se!algonet!news2.tninet.se!not-for-mail Original-Newsgroups: gnu.emacs.gnus Original-Sender: krikkit@algonet.invalid Original-NNTP-Posting-Host: wilhelmina.algonet.se Original-X-Trace: green.tninet.se 1030565756 7325 194.213.75.170 (28 Aug 2002 20:15:56 GMT) Original-X-Complaints-To: abuse@telenordia.se Original-NNTP-Posting-Date: Wed, 28 Aug 2002 20:15:56 +0000 (UTC) X-Home-Page: http://www.ichimusai.org/ X-PGP: Key ID: 1024D/930B07E8, Valid to: 2002-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: bridgekeeper.physik.uni-ulm.de gnus-emacs-gnus:1141 Original-Lines: 40 X-Gnus-Article-Number: 1141 Tue Jan 17 17:28:28 2006 Xref: news.gmane.org gmane.emacs.gnus.user:1001 Archived-At: Vasily Korytov 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.