Amongst the uses I find for xp are :

1) displaying a manual page in a window which i can then search
& make a selection from, for pasting elsewhere (unlike xman), with a
shell script such as

#!/bin/sh
man $@ | col -b | cat -s | xp -i -n xm:$* -geometry 70x40&

or even

#!/bin/sh
for i
do
  case $i in
  /*) comm="-command $i";;
  *)  opt="$opt $i" ;;
  esac
done
man $opt | col -b | cat -s |xp -i -n  xm:"$*" ${comm}  -geometry 420x500 &

which i use as in

xm ls /OPTIONS

to jump straight to the OPTIONS section of the ls manual page.

2) displaying groups of files from a twm menu eg part of my .twmrc reads:

Menu "files"
{
        "files" f.title
        "logs" ! "xp /var/adm/messages /var/local/adm/amd.log &"
        "printers" ! "xp /etc/printcap  /var/spool/lpd/*/acct /var/spool/lpd/*/*log /var/adm/lpd-errs&"
        "misc"     ! "xp /etc/hosts /etc/*.conf /etc/rc  /local/etc/rc.local  /local/etc/amd.map /etc/passwd /etc/group  /etc/fstab&"
}



3) looking at a file that's  growing : selecting the current file
   from the  xp files menu by hitting mouse button 2
   reopens the currently displayed file & positions the caret at the
   same offset (if possible). If the caret was initially at eof
   you can easily  see if its grown.

4) to look at  and/or keep around a long message in elm
   by typing 

|xp&

5) in conjunction with archie 

eg. I often find

archie -c something |xp&

more convenient that using xarchie.

6) to display files or stdin or even the current selection to another
 (consenting friendly) user.

 eg. xp -display friend:0 *


7)  in conjunction with ftp

eg.

ftp> get README |xp

puts the file  README into an xp window - if i want to print it
i can do so within xp, i.e  "| lpr"  or
if i want to carry with ftp & keep the the file displayed i can  type
"| xp&" before quitting the original xp. (since  saying "|xp&" to ftp
doesn't give what you might expect)

ftp> mls -l |xp 

is also useful.

Also, the shell script getrfc

#!/bin/sh
ftp src.doc.ic.ac.uk  << X
get rfc/rfc$1.txt.Z -
quit
X

allows the shell script 
 
#!/bin/sh
getrfc $1 | zcat | xp -n rfc$1&


to easily pull an rfc into an xp window assuming you have
something like

machine src.doc.ic.ac.uk login anonymous password your.name@uk.ac.ncl
macdef init
bin

as an entry in your .netrc file.

(Splitting the command into two scripts stops the ftp from waiting
for you to finish viewing the rfc.)

	Gerry.

(Gerry.Tomlinson@uk.ac.newcastle)

