[Top][All Lists]

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

Re: Readability of troff documents (Was: [Groff] Bug in gxditview)

From: Alejandro Lopez-Valencia
Subject: Re: Readability of troff documents (Was: [Groff] Bug in gxditview)
Date: Fri, 23 May 2003 07:32:37 -0500

At 12:41 a.m. 23/05/2003, Giorgos Magos wrote:
Is there a way (other than preprocessing through some sed
filter) of inserting these the way they're inserted in

Besides the sed (or awk) way, there are other alternatives.

1. If you are in control of your editor, you can use a mechanism to map key-codes to groff char-codes. See for example the attached keymap files for vim. You need a vim compiled with the +keymap feature. This approach has its disadvantages, namely, you need that the particular character be assigned a key-code! (Thusly, you still need to type \[em] or use sed...). But this cold be worked around using a language map (+langmap feature). I haven't explored this possibiity though. (B. Moolenaar, vim's BDFL, considers this a thorough perversion of the original purpose, btw). I am sure you can do the same with a Mule enabled Emacs (and lots of coding ;-).

2. Use the right language for the job. Python allows you to write special purpose codecs that don't necessarily have to be actual computer codepages nor character vector encodings. Soo... You can write the web application code you give as an example of (very practical and contemporaneous uses of troff) in some Python web-application framework (there are several each appealing to different audiences) and use an special purpose codec to decode your input text into groff source on-the-fly. I haven't tried this yet, but to my taste this beats hands-down writing sed scripts :-)

Description: Zip archive

reply via email to

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