packages icon
File:  README.xfilter

/**********************************************************************
*  Copyright (c) 1991, 1992 Iris Computing Laboratories.
*
*  This software is provided for demonstration purposes only.  As
*  freely-distributed, modifiable source code, this software carries
*  absolutely no warranty.  Iris Computing Laboratories disclaims
*  all warranties for this software, including any implied warranties
*  of merchantability and fitness, and shall not be liable for
*  damages of any type resulting from its use.
*  Permission to use, copy, modify, and distribute this source code
*  for any purpose and without fee is hereby granted, provided that
*  the above copyright and this permission notice appear in all copies
*  and supporting documentation, and provided that Iris Computing
*  Laboratories not be named in advertising or publicity pertaining
*  to the redistribution of this software without specific, written
*  prior permission.
**********************************************************************/

`xfilter.tar.Z' includes the source code for an X-based interface
to UNIX filters.  Note that you must have X and the Motif libraries
to compile `xfilter'.  This X client is further described in the
book "Designing X clients with Xt/Motif," by Jerry D. Smith,
Morgan Kaufmann, 1992 (available @ July 1992).

Programmers:  See the comments near the end of this file regarding
the makefile, Motif versions, etc.

`xfilter' is a simple application for filtering data through
UNIX commands such as tr(1), spell(1), etc.  `xfilter' has no
command-line options; it is started as follows:

{your prompt} xfilter

`xfilter' simply maps the selectable input and output locations
to UNIX's standard input and output for a UNIX filter command.

The input/output panel contains option menus for setting the
data source and the location for the output from the filter.
For example, the default input is "Primary selection" and the
default output is "Text window".  Thus, if you select text from
a window any where on the screen and then press "Filter" in the
filter panel, the selected text will simply be taken from the
primary selection and written to the top-level text window.  That
is, if no filter has been specified, the filter operation defaults
to a simple copy operation.

Spell-checking is an example of a more useful operation.  For
example, if you (1) specify "spell" as the filter in the single-
line text window to the right of "Filter:", (2) select text in a
window, and (3) press "Filter", questionable spellings, as
reported by spell(1), will be displayed in the main text window.

The source and target can also be files; see the help information
on files.

Note:  Various UNIX filters are inconsistent with respect to
whether or not they will accept incomplete lines, e.g., a single
word, or several lines, plus part of another line.

You can use `xfilter' as a facility for "X repository-to-UNIX file"
data transfer, and vice versa.  For example, to save the primary
selection to a file (without passing it through a filter), you would
(1) select the text, (2) set the filename, and (3) press "Filter"
(after making sure that the "Filter:" text window is empty).

Since the source and targets can both be files, you can, AT LEAST IN
PRINCIPLE, use `xfilter' as a substitute for cp(1) or a similar
operation in a file manager.  This is an inefficient approach,
however, because with `xfilter' all data transfer is accomplished
via computer memory.  Thus, file-to-file data transfer should be
done with a more appropriate utility/command.

NOTICE:  The X selection and property mechanism is not intended for
copying large bodies of text--some X servers (and Motif clients
including this one) may crash if you select a huge amount of text.

Programmers
-----------
There is a simple makefile in `xfilter.make', so that you can simple copy
the entire project into a working directory and type `make -f xfilter.make',
if you don't want to install `xfilter' in the MIT or Motif X source tree.

This source code has been tested extensively in a Sun SPARCstation, MIT X
environment with Motif 1.1.x under CodeCenter/Saber-C.  There are
no known errors/problems.

THIS APPLICATION CURRENTLY USES THE DEFAULT XT ERROR HANDLER AND CAN
TERMINATE UNEXPECTEDLY--WITH UNSAVED CHANGES IN THE EDIT WINDOW.
YOU MAY WANT TO ADD A CUSTOMIZED ERROR HANDLER.

Jerry Smith
Iris Computing Laboratories
jsmith@spectro.com