Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!ontek!mikey From: mikey@ontek.UUCP (Mike Lee) Newsgroups: comp.unix.questions Subject: Re: Vi Summary: YAFF: yet another fmt freebie Message-ID: <297@ontek.UUCP> Date: 13 Jun 89 17:16:33 GMT Organization: Ontek Corporation Lines: 44 I got tired of ragged edges in my paragraphs, so here is yet another shell script to invoke nroff. It done in the C-shell. A possible portability problem is that it uses "shift_lines" which I know is a given with SunOS 4.0, but other OS's may not be so generous. If I get some complaints, I could probably make a few lines of C code do the same thing. These paragraphs were adjusted using this script. To use the script, go !} N, where you, YES YOU, get to choose the name of the script. N is the number of columns to shift the paragraph to the right. The default is currently two columns. If the paragraph is already indented to column two, the script won't keep on indenting it. I suggest you change the default to whatever suits you best. Pass 0 to jam stuff up against the left column. NOTE: I know little or nothing about nroff. Some other kind soul may see fit to add some more echo statements to use some of nroff's neater feature eaters. Here goes..................................................... # csh script to call up nroff on a paragraph # set temp_file = /tmp/foom.$$ # change default indentation to your liking set columns = 2 if ( $1 != "" ) set columns = $1 echo ".hy 0" >! $temp_file echo ".pl 1" >> $temp_file cat | shift_lines -$columns >> $temp_file nroff $temp_file | shift_lines $columns rm $temp_file ............................................................. Mike Lee mikey@ontek.uucp ...uunet!ontek!mikey 1-714-768-0301