help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: When is a text file not a text file?


From: sebyte
Subject: Re: When is a text file not a text file?
Date: Fri, 09 Jan 2004 18:17:23 +0000
User-agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.4) Gecko/20030624 Netscape/7.1


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*.

Could that be the case? It would explain why dumping such a file on
the tty---unlike visiting it with a text editor---would display it
correctly.

If this *is* the case, then you probably could do something with
ansi-color.el, though I don't know offhand how exactly.

    Oliver

Hi Oliver,

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
 property and responsibility of its author; for reprint rights, please contact
 the author directly.
 -----------------------------------------------------------------------------
 Let me repeat that: OS X is not Unix.
Consider the following: all of Apple.com's _^Hm_^Ha_^Hr_^Hk_^He_^Ht_^Hi_^Hn_^Hg_^H _^Hp_^Ha_^Hg_^He_^Hs on the subject of
 their darling new operating system are extremely careful to note that OS X is
 "_^HU_^HN_^HI_^HX_^H-_^Hb_^Ha_^Hs_^He_^Hd".


Here is how it looks on a tty or in an Emacs *shell* buffer:


 Copyright notice: All reader-contributed material on freshmeat.net is the
 property and responsibility of its author; for reprint rights, please contact
 the author directly.
 -----------------------------------------------------------------------------
 Let me repeat that: OS X is not Unix.
 Consider the following: all of Apple.com's marketing pages on the subject of
 their darling new operating system are extremely careful to note that OS X is
 "UNIX-based".


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.

(After days spent looking for information, I discovered that html2text comes with a manpage and all was revealed. DOH!)


sebyte



reply via email to

[Prev in Thread] Current Thread [Next in Thread]