[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: When is a text file not a text file?
From: |
Oliver Scholz |
Subject: |
Re: When is a text file not a text file? |
Date: |
Fri, 09 Jan 2004 19:48:37 +0100 |
User-agent: |
Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3.50 (windows-nt) |
sebyte <sdt133@netscape.net> writes:
>> What "tags" are these? I don't know the actual program you are
>> using. But I seem to recall that I once had a program "html2text" or
>> "htmltotxt" or whatever that procuced a text file as output
>> *containing ANSI escape sequences for colours*.
[...]
> Thanks for your time. Here's an example of html2text's output,
> displayed in an Emacs buffer:
>
>
> C^HCo^Hop^Hpy^Hyr^Hri^Hig^Hgh^Hht^Ht n^Hno^Hot^Hti^Hic^Hce^He:^H:
> All reader-contributed material on freshmeat.net is the
[...]
> I had thought that they might be remnants of HTML tags, (I must admit
> I didn't look very closely), but I have found out since they are
> actually ANSI 'backspace control sequences', used to preserve things
> like underlining and boldface. The html2text option '-nobs' gets rid
> of them.
[...]
Untested: You could also try to call
(ansi-color-apply-on-region (point-min) (point-max))
on a buffer containing such ANSI control sequences (after a `(require
'ansi-color)' that is).
Oliver
--
20 Nivôse an 212 de la Révolution
Liberté, Egalité, Fraternité!