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.
tty-format.el
Description: application/emacs-lisp
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQBGQ7QrLFMCIV9q3ToRAnYGAJ4iLAoOXbx9K6Dca0ZrxAekHxbXGACgsz7z Dzj08Lbu7iTbWP8EEEcLWv0= =o8Ca -----END PGP SIGNATURE-----
_BB_oo_ll_dd_++_uu_nn_dd_ee_rr_ll_ii_nn_ee_ _bb_yy_ _oo_vv_ee_rr_ss_tt_rr_ii_kk_ee. BBoolldd bbyy oovveerrssttrriikkee. _U_n_d_e_r_l_i_n_e _b_y _o_v_e_r_s_t_r_i_k_e. Overstruck bullet: +o bold bullet ++oo ANSI attributes [1mbold[0;10m [4munderline[0;10m [1m[4mbold+underline[0;10m ANSI foreground colours: normal: [31m red [32m green [33m yellow [34m blue [35m magenta [36m cyan [37m white[0;10m bold: [1m[31m red [32m green [33m yellow [34m blue [35m magenta [36m cyan [37m white[0;10m
_______________________________________________ gnu-emacs-sources mailing list [email protected] http://lists.gnu.org/mailman/listinfo/gnu-emacs-sources
