Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!tut.cis.ohio-state.edu!ucbvax!techunix.BITNET!devil From: devil@techunix.BITNET (Gil Tene) Newsgroups: comp.windows.open-look Subject: Re: textsw filters Summary: Simple, RTFM. Message-ID: <9918@discus.technion.ac.il> Date: 25 Mar 91 14:59:01 GMT References: Sender: daemon@ucbvax.BERKELEY.EDU Reply-To: devil%techunix.bitnet@lilac.berkeley.edu (Gil Tene) Organization: Technion, Israel Inst. of Technology Lines: 54 Hello OpenPeople, There have been some requests for info on textsw filters for the extras menu. First, let me note that textedit(1) explians this quite well, except for a few typos with file names. In short, Filters are simple programs that get data in stdin and put it out to stdout, modifying it if needed. textsw calls filters giving them the current selection as input, and replacing it with whatever they output. This means they can also be used as simple "function key to string" bindings, if you don't wish to use xmodmap. Filters in textsw can be bound to keys using the .textswrc file in one's login dir. They can also be bound to the Extras menu in one of several ways. The basic extras menu resides in /usr/lib/.text_extras_menu. You can choose to modify this file (yuck!), or you can set an environment variable or a .Xdefaults entry to point to another file (see textedit(1)). An example of binding keys to filters is given in /usr/lib/.textswrc, this file is NOT used unless you have it in your home dir. below is a simple filter program I use to indent mail in mailtool, since I don't like the way mailtool does it. Below that is my .textswrc file, binding the filter to F9 on my SLC keyboard... When I wish to indent someone's mail, I paste it in, select it all, press F9, and presto! Have Fun. -- Gil. /home/devil/filters/rep_mail.c : #include char in_line[1000]; main() { while(gets(in_line)) printf("> %s\n",in_line); } /home/devil/.textswrc : # bind F9 to my rep_mail filter : F9 FILTER /home/devil/filters/rep_mail -- -------------------------------------------------------------------- -- Gil Tene "Some days it just doesn't pay -- -- devil@techunix.technion.ac.il to go to sleep in the morning." -- --------------------------------------------------------------------