Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

pstags(1)

PSINDENT(1)  —  USER COMMANDS

NAME

psindent − format POSTSCRIPT language or NeWS source

SYNOPSIS

psindent [ [ −ba | +ba ] [ −bb | +bb ] [ −bs | +bs ] [ −cba | +cba ] [ −cbb | +cbb ] [ −cea | +cea ] [ −ceb | +ceb ] [ −da | +da ] [ −db | +db ] [ −dba | +dba ] [ −dbb | +dbb ] [ −dea | +dea ] [ −deb | +deb ] [ −ea | +ea ] [ −eb | +eb ] [ −gra | +gra ] [ −grb | +grb ] [ −gsa | +gsa ] [ −gsb | +gsb ] [ −ia | +ia ] [ −ib | +ib ] [ −ib | +ib ] [ −lba | +lba ] [ −lbb | +lbb ] [ −lca | +lca ] [ −lcb | +lcb ] [ −rba | +rba ] [ −rbb | +rbb ] [ −rca | +rca ] [ −rcb | +rcb ] ] [ input-file ...  ]

DESCRIPTION

psindent is a POSTSCRIPT language formatter that also understands NeWS elements.  It reformats the POSTSCRIPT language program in one or more input-files, according to the switches.  The switches that can be specified are described below.  They may appear before or after the filenames.  If only the input-file is specified, the formatting is done in place, that is, the formatted file is written back into input-file, after a backup copy named input-file.BAK has been written in the current directory.  If no input-file is given, psindent acts as a filter: the standard input is formatted and the results written to the standard output.  This is most useful from within editors. 

In addition to being specified on the command line, switches may be given in the user’s own profile of defaults.  When psindent is run, it checks for the file .psindent in the user’s login directory.  If that file exists, it is read to set the defaults of psindent.  However, switches on the command line always override profile switches.  The switches should be separated by SPACE, TAB, or NEWLINE characters.  Finally, switches may also be indicated by embedding them in the source code itself, at the beginning of a comment line. 

Lines beginning with a # or a % are passed through unmodified.  Lines beginning with the keyword cdef are assumed to be CPS (C to POSTSCRIPT) calls under NeWS.  This causes the lines until either the next cdef or the end of the file to be indented once. 

OPTIONS

The options listed below control the formatting style imposed by psindent.  A + sets the option, and a - deselects it. 

−ba,+ba If ba is specified, a NEWLINE is forced after every begin.  Default: +ba

−bb,+bb If bb is specified, a NEWLINE is forced before every begin.  Default: +bb. 

−bs,+bs Backslash inner strings, such as (\(\)).  Default: +bs. 

−cba,+cba If cba is specified, a NEWLINE is forced after every classbegin.  Default: +cba. 

−cbb,+cbb If cbb is specified, a NEWLINE is forced before every classbegin.  Default: +cbb. 

−cea,+cea If cea is specified, a NEWLINE is forced after every classend.  Default: +cea. 

−ceb,+ceb If ceb is specified, a NEWLINE is forced before every classend.  Default: +ceb. 

−da,+da If da is specified, a NEWLINE is forced after every def.  Default: +da. 

−db,+db If db is specified, a NEWLINE is forced before every def.  Default: −db. 

−dba,+dba If dba is specified, a NEWLINE is forced after every dictbegin.  Default: +dba. 

−dbb,+dbb If dbb is specified, a NEWLINE is forced before every dictbegin.  Default: +dbb. 

−dea,+dea If dea is specified, a NEWLINE is forced after every dictend.  Default: +dea. 

−deb,+deb If deb is specified, a NEWLINE is forced before every dictend.  Default: +deb. 

−ea,+ea If ea is specified, a NEWLINE is forced after every end.  Default: +ea. 

−eb,+eb If eb is specified, a NEWLINE is forced before every end.  Default: +eb. 

−gra,+gra If gra is specified, a NEWLINE is forced after every grestore.  Default: -gra. 

−grb,+grb If grb is specified, a NEWLINE is forced before every grestore Default: -grb. 

−gsa,+gsa If gsa is specified, a NEWLINE is forced after every gsave.  Default: -gsa. 

−gsb,+gsb If gsb is specified, a NEWLINE is forced before every gsave.  Default: -gsb. 

−ia,+ia If ia is specified, a NEWLINE is forced after every if or ifelse.  Default: +ia. 

−ib,+ib If ib is specified, a NEWLINE is forced before every if or ifelse.  Default: −ib. 

−lba,+lba If lba is specified, a NEWLINE is forced after every [.  Default: -lba. 

−lbb,+lbb If lbb is specified, a NEWLINE is forced before every [.  Default: -lbb. 

−lca,+lca If lca is specified, a NEWLINE is forced after every {.  Default: +lca. 

−lcb,+lcb If lcb is specified, a NEWLINE is forced before every {.  Default: -lcb. 

−rba,+rba If rba is specified, a NEWLINE is forced after every ].  Default: -rba. 

−rbb,+rbb If rbb is specified, a NEWLINE is forced before every ].  Default: -rbb. 

−rca,+rca If rca is specified, a NEWLINE is forced after every }.  Default: -rca. 

−rcb,+rcb If rcb is specified, a NEWLINE is forced before every }.  Default: +rcb. 

EXAMPLES

The following illustrate the three methods for setting option switches. 

On the command line:

psindent -bs +cea -dba file_name.ps

In the file ~/.psindent:

-bs +cea -dba

Within a source file file.ps:

<beginning-of-line>%%= -bs +cea -dba

From within vi(1) the editing buffer may be formatted by typing:

:%!psindent

FILES

~/.psindent profile file

SEE ALSO

pstags(1)

NOTES

psindent(1) and pstags(1) are the same program. 

TRADEMARK

POSTSCRIPT is a registered trademark of Adobe Systems Inc. 

BUGS

psindent switches embedded in the source are only recognized at the beginning of a comment line.  If a profile file exists in the current directory, it should be read, and its settings should have precedence over those in the profile file in the login directory, if one exists. 

AUTHOR

Josh Siegel (siegel@hc.dspo.gov)

Sun Release 4.1  —  Last change: 15 June 1989

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026