logo       

tty-format.el -- ANSI SGR and backspace overstriking: msg#00007

emacs.sources

Subject: tty-format.el -- ANSI SGR and backspace overstriking

This is another idea I've had bouncing around and hadn't until now
worked up properly. I struck a few text files with backspace
overstriking (to make bold on a line printer) and some ANSI escapes
(likewise) and wanted a nice way to view them, so this is a couple of
format-alist entries to do that.

I know ansi-color.el can apply overlays, but I made text properties so
in theory you can cut and paste into another formatted document.
Dunno quite how often that would arise though.

The ansi would almost be a sensible format to save, perhaps with some
marker sequence at the start of the file, but I suspect its time has
passed. You'd have thought backspace overstriking definitely would
have died with the printers it was for, yet it's still found in for
instance the current debian groff meintro.txt documentation.

The foo.txt below is a sample showing what happens on decode (if it
hasn't been mangled by the mail).

M-x format-decode-buffer ansi-sgr
and/or
M-x format-decode-buffer backspace-overstrike

The `tty-format-guess' function is my best idea to automate detection
of this sort of thing. Far from ideal, but works ok in practice.

Attachment: tty-format.el
Description: application/emacs-lisp

Attachment: tty-format.el.asc.txt
Description: Text document

Attachment: foo.txt
Description: Text document

_______________________________________________
gnu-emacs-sources mailing list
gnu-emacs-sources@xxxxxxx
http://lists.gnu.org/mailman/listinfo/gnu-emacs-sources
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise