What are filters?

Filters are generally programs which read some input text from standard input, perform some modifications on it, and write the modified text to standard output. boxes is such a program.

Some text editors support filters, that is to say they offer a way to let filter programs make changes to the text being edited. The way this works is by pressing a key, the user tells the editor to start the filter program (e.g. boxes) and feed it the lines of text which you have marked in the editor. Those lines are subsequently replaced with the output from the filter program.

Here's an example using "boxes":

Imagine your editor (in this case, it's vim) shows the following C code (it could be any text, of course):

text before filtering

Now you mark some of the lines ...

text to be filtered is marked

... and press the key which makes vim call the filter program boxes:

after the filter was applied

Voilá! The marked lines have been fed to boxes and replaced by the output of boxes. You've got yourself a box! Of course the same mechanism works for box removal - or anything else you can find a filter for. :-)

Editors known to support filters are vim, emacs, and jed. If you know of others - and there are certainly many, many more - drop me a line and I'll add them here.

Please see the installation section in the boxes docs for more info on how to make your editor work with boxes.


boxes ©1999 by Thomas Jensen <boxes(at)thomasjensen.com>
Page created April 06, 1999, last touched: 9-Aug-2003. All rights reserved.