[comp.sources.misc] v07i028: CRISP release 1.9 part 07/32

allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc) (06/11/89)

Posting-number: Volume 7, Issue 28
Submitted-by: fox@marlow.UUCP (Paul Fox)
Archive-name: crisp1.9/part08



#!/bin/sh
# this is part 7 of a multipart archive
# do not concatenate these parts, unpack them in order with /bin/sh
# file help/crisp/prim/K.cmd continued
#
CurArch=7
if test ! -r s2_seq_.tmp
then echo "Please unpack part 1 first!"
     exit 1; fi
( read Scheck
  if test "$Scheck" != $CurArch
  then echo "Please unpack part $Scheck next!"
       exit 1;
  else exit 0; fi
) < s2_seq_.tmp || exit 1
echo "x - Continuing file help/crisp/prim/K.cmd"
sed 's/^X//' << 'SHAR_EOF' >> help/crisp/prim/K.cmd
X.HU keyboard_flush
XSYNOPSIS:	(keyboard_flush)
X
XRETURN VALUE:
X
X	Nothing.
X
XDESCRIPTION:
X
X	keyboard_flush can be used to flush any pending input.
X.HU keyboard_pop
XSYNOPSIS:	(keyboard_pop [save])
X
XRETURN VALUE:
X
X	Nothing.
X
XDESCRIPTION:
X
X	This  macro  is  used  to  pop  the current keyboard off the
X	keyboard  stack;  save  is  an  integer expression. If it is
X	non-zero,  then  the current keyboard is saved for later use
X	(by  keyboard_push).  If  it  is zero, then the keyboard map
X	is discarded.
X
XEXAMPLES:
X
X	See  (keyboard_push)  for an example of creating a temporary
X	keyboard map.
X.HU keyboard_push
XSYNOPSIS:	(keyboard_push [kbd_id])
X
XRETURN VALUE:
X
X	Nothing.
X
XDESCRIPTION:
X
X	keyboard_push  is  used  to create a new keyboard table. The
X	current  keyboard  map  is  saved  on  a  stack,  and can be
X	retrieved by using keyboard_pop.
X
X	kbd_id  is  an  integer expression. If it is omitted, then a
X	new  keyboard  map  is  pushed  on the stack, and by default
X	all  the  keys  in  the  map  are  assigned to (nothing), ie
X	pressing  them  has  no  effect.  If kbd_id is specified, it
X	should  be  a  value  which  was  obtained  from  a previous
X	(inq_keyboard)  call.  This  will  push  the  keyboard whose
X	identifier is kbd_id on top of the stack.
X
X	A  keyboard  map  is  a table of all possible keys, together
X	with  the  macros  that  are bound to them. By default CRISP
X	comes  up  with the usual editing keys, but some macros need
X	to  temporarily  bind  macros  to  keys for their operation.
X	For  example,  the  buffer_list macro creates a new keyboard
X	and  binds  various keys to it, so that it can intercept the
X	users requests to delete and write away buffers.
X
X	Having  keyboard  maps saves the macro writer from having to
X	write complicated, and CPU expensive keyboard parsers.
X
XEXAMPLES:
X
X	The  following  example  shows  how  to  create  a temporary
X	keyboard mapping for use within a macro.
X
X    		(int curkbd)
X
X    		(= curkbd (inq_keyboard))
X    		(keyboard_push)
X    		(assign_to_key ".." "..")
X    		   .
X    		   .
X    		(process)
X    		(keyboard_pop)
X
X    		(keyboard_push curkbd)
X.HU keyboard_typeables
XSYNOPSIS:	(keyboard_typeables)
X
XRETURN VALUE:
X
X	Nothing.
X
XDESCRIPTION:
X
X	keyboard_typeables  is  a  quick  method  of  setting  up  a
X	keyboard   map  so  that  the  usual  insertable  characters
X	(ASCII 0-127) do their default actions of being insertable.
X
X	It is a shorthand way of doing the following:
X
X    		(assign_to_key "A" "self_insert")
X    		(assign_to_key "B" "self_insert")
X    			.
X    			.
X
X	It is useful after creating a new blank keyboard.
SHAR_EOF
echo "File help/crisp/prim/K.cmd is complete"
chmod 0644 help/crisp/prim/K.cmd || echo "restore of help/crisp/prim/K.cmd fails"
mkdir help help/crisp help/crisp/prim >/dev/null 2>&1
echo "x - extracting help/crisp/prim/L.cmd (Text)"
sed 's/^X//' << 'SHAR_EOF' > help/crisp/prim/L.cmd &&
X.HU left
XSYNOPSIS:	(left num)
X
XRETURN VALUE:
X
X	Nothing.
X
XDESCRIPTION:
X
X	Moves   the   cursor  one  character  to  the  left  or  num
X	characters to the left, if specified. num may be negative.
X
X	Unlike  BRIEF,  if the cursor is moved past the beginning of
X	the  current  line,  then the cursor wraps around to the end
X	of the previous line.
X.HU length_of_list
XSYNOPSIS:	(length_of_list list_expr)
X
XRETURN VALUE:
X
X	The number of atoms in the list.
X
XDESCRIPTION:
X
X	(length_of_list)  returns  the number of atoms in a list; it
X	only  counts  the  top  level  atoms.  For  example, if (car
X	list_expr)  is  a  list  expression  itself,  then this only
X	counts as one atom, not (length_of_list (car list_expr)).
X.HU list
XSYNOPSIS:	(list var1 var2 ..)
X
XRETURN VALUE:
X
X	Nothing.
X
XDESCRIPTION:
X
X	This   macro   is   used  to  define  list  variables.  List
X	variables  may  be  defined  as  global (see (global)). List
X	variables  are  given  an initial value of the NULL list (ie
X	(length_of_list) returns 0).
X
X	Lists   are  data  types  similar  to  arrays,  except  each
X	element  of  a list (referred to as an atom) may have any of
X	the  CRISP  primitive data types (including list), and lists
X	can  be  expanded at the end simply by concatenating entries
X	on the end (see (append_list) and (put_nth)).
X.HU load_macro
XSYNOPSIS:	(load_macro [file])
X
XRETURN VALUE:
X
X	Returns   1   if  macro  file  was  successfully  loaded;  0
X	otherwise.
X
XDESCRIPTION:
X
X	This  macro  is  used  to  load  a .m or .cm macro file into
X	CRISP.  file  is  a  string  expression  which specifies the
X	name of the macro file. If omitted, it is prompted for.
X
X	Note  that  unlike  BRIEF,  macros in source form (.m files)
X	can be loaded with this macro.
X
X	The  extension  can  be  omitted,  in which case CRISP looks
X	for  either  file.m or file.cm If the extension is supplied,
X	then  only  a  file  matching the extension will be searched
X	for.  Otherwise  CRISP  looks  for a .cm file before looking
X	for a .m file.
X
X	If  file  does  not contain a path specification, then CRISP
X	searches  all  the  directories  in  the  BPATH  environment
X	variable  (or  uses  an  internal  default  if  BPATH is not
X	specified).
X
X	When  searching  for a .m or .cm it searches the directories
X	in  order,  i.e.  if  a .cm file exists in a later path than
X	the .m, then the .m file will be loaded first.
X
X	When  loading  .cm files, CRISP checks the version number of
X	the  file  to  see  if  it  is  compatible  with the current
X	version  of  CRISP,  and  issues  an  error  message  if the
X	version number does not agree.
X
X	If  a  .m  file  has  a syntax error then the loading of the
X	file is aborted with an error message displayed.
X
X	If  a  macro  called  '_init' exists in the macro file being
X	loaded,  then  that  macro  is  executed  immediately.  This
X	facility  exists  to  allow macros to perform initialisation
X	functions.
X.HU lower
XSYNOPSIS:	(lower string)
X
XRETURN VALUE:
X
X	Returns  a  copy  of  string  with  all  upper  case letters
X	mapped to their lower case equivalents.
X
XDESCRIPTION:
X
X.HU ltrim
XSYNOPSIS:	(ltrim string)
X
XRETURN VALUE:
X
X	Returns  a  copy  of  string  with  all  leading white space
X	characters removed. (spaces, tabs and newlines).
X
XDESCRIPTION:
X
SHAR_EOF
chmod 0644 help/crisp/prim/L.cmd || echo "restore of help/crisp/prim/L.cmd fails"
mkdir help help/crisp help/crisp/prim >/dev/null 2>&1
echo "x - extracting help/crisp/prim/V.cmd (Text)"
sed 's/^X//' << 'SHAR_EOF' > help/crisp/prim/V.cmd &&
X.HU version
XSYNOPSIS:	(version)
X
XRETURN VALUE:
X
X	Returns the current version number * 100.
X
XDESCRIPTION:
X
X	Displays the current version on the status line.
SHAR_EOF
chmod 0644 help/crisp/prim/V.cmd || echo "restore of help/crisp/prim/V.cmd fails"
mkdir help help/crisp help/crisp/prim >/dev/null 2>&1
echo "x - extracting help/crisp/prim/Q.cmd (Text)"
sed 's/^X//' << 'SHAR_EOF' > help/crisp/prim/Q.cmd &&
X.HU quote_list
XSYNOPSIS:	(quote_list list_expr)
X
XRETURN VALUE:
X
X	The quoted list, list_expr.
X
XDESCRIPTION:
X
X	The  (quote_list)  macro  is the mechanism for creating list
X	literal   constants.  It  is  normally  used  for  assigning
X	initial  values  to lists, or for passing an anonymous macro
X	to another macro.
X
X	For  example,  the  following  sets  the list, l, to the two
X	element list ("one" "two"):
X
X    		(list l)
X    		(= l (quote_list "one" "two"))
X
X	If (quote_list) wasn't used, and the expression appeared as:
X
X    		(= l ("one" "two"))
X
X	CRISP  would  try  to evaluate the expression ("one" "two"),
X	which  would  evaluate to the string "one", and not the list
X	("one" "two").
X
X	Any  CRISP  expression  can  appear  after  the  quote_list,
X	including a sequence of commands.
X
XEXAMPLES:
X
X	The  following  example  shows how an anonymous macro can be
X	bound to a key:
X
X    		(assign_to_key "<Alt-X>" (quote_list 
X    			(
X    				(message "Have a nice day!")
X    				(exit)
X    			))
X.HU quote_regexp
XSYNOPSIS:	(quote_regexp string)
X
XRETURN VALUE:
X
X	Returns a string with all regular expression characters quoted.
X
XDESCRIPTION:
X
X	This  macro  is  used  to  quote  a string so that it can be
X	used in searches.
X
X	For  example,  suppose the macro writer wishes to search for
X	the  pattern  "<>" at the start of a line in the buffer. The
X	correct way to do this is to write something like:
X
X    		(search_fwd "<\\<\\>")
X
X	It  is  possible  for  the  macro writer to parse the string
X	and  insert  the  appropriate backslashes, but this would be
X	a  very  expensive operation. It is not adequate to turn off
X	regular  expression  parsing  with  (search_fwd)  since then
X	the  macro  couldnt be sure to match the string at the start
X	of the line.
X
X	In  this  case,  (quote_regexp)  does  the  tedious  work of
X	translating the string so that it will match exactly.
X
SHAR_EOF
chmod 0644 help/crisp/prim/Q.cmd || echo "restore of help/crisp/prim/Q.cmd fails"
mkdir help help/crisp help/crisp/roff >/dev/null 2>&1
echo "x - extracting help/crisp/roff/page1.mm (Text)"
sed 's/^X//' << 'SHAR_EOF' > help/crisp/roff/page1.mm &&
X\" .Fc title version date	Cover sheet
X\" .Fo section_name		Used for Name/Synopsis/Description
X\".tr ~
X\"-------------------------------------------------------------------------
X.de Fc				\" Define Standard Cover sheet.
X.ll 6i
X.page_size
X.po 1i
X.ev2
X.ll 6i
X.ev
X.nr Ej 1
X.SA 1
X.nr % -1
X.DS
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X.DE
X.ce
X.B
X\s+4\\$1\s-4
X.DS CB
X
X
XAuthor:		P. D. Fox 
XUsenet:		fox%marlow.uucp@stc.idec.co.uk
XBix:		fox
XVersion:        \\$2
XDate:           \\$3
X
X
X
X
X
X
X
X
X
X
X.DE
X.ds HF 3 3 3 3 3
X.ce
X.ul
X.B "SHAREWARE COPYRIGHT NOTICE"
X.sp 1
X.ll -7m
X.VL 7
X.LI \ 
XThis document and the software it describes is Copyright (C) 1989
Xby Paul Fox. This copyright notice will remain in effect at all times.
XThe software and documentation may be freely copied for personal or local
Xuse, and may be adapted and hacked as appropriate. It may not be sold
Xfor profit without consent with the above author. 
X.LE
X.ll +7m
X.PH "'\\$1''Page %'"
X.PF "'CRISP Reference Manual'\\$3'Version \\$2'"
X.bp
X..
X.de Fo				\" Negative indent Name/Synopsis etc.
X.in -.5i
X.B \\$1
X.br
X.in +.5i
X.sp
X..
X.de EL
X.LE
X..
X
SHAR_EOF
chmod 0644 help/crisp/roff/page1.mm || echo "restore of help/crisp/roff/page1.mm fails"
mkdir help help/crisp help/crisp/roff >/dev/null 2>&1
echo "x - extracting help/crisp/roff/Intro.mm (Text)"
sed 's/^X//' << 'SHAR_EOF' > help/crisp/roff/Intro.mm &&
X.H 1 "Introduction"
X.P
XThis is the user guide and reference
Xmanual for the CRISP programmers editor which runs under Unix\*F,
X.FS
XUnix is a trademark of AT&T.
X.FE
Xand VAX/VMS\*F
X.FS
XVAX/VMS is a trademark of the Digital Equipment Corporation.
X.FE
XThe document covers all aspects of using and programming CRISP.
X.P
XIt is designed for both novices and expert users.
XThis manual should be used in conjunction with the on-line help. The manual
Xitself is constructed from the files which form the on-line help,
Xand so some sections may appear a bit terse. I hope this doesn't
Xfrighten anyone.
X.P
XThis manual is divided up into the following parts:
X.AL
X.LI
XA description of the 'environment' of CRISP, the files constituting
Xthe release, environment variables, and command line switches.
X.LI
XAn introduction of the terms and concepts used within CRISP. This
Xshould be read by all new users.
X.LI
XA description of the high-level macros (\fIfeatures\fR) which
Xaffect the user interface and generally make the user's life
Xeasier.
X.LI
XA complete description of all the CRISP macro primitives.
X.LE
X.H 2 Overview
X.P
XCRISP is a window and buffer oriented editor. It is based on the
Xeditor BRIEF\*F, 
X.FS
XBRIEF is a trademark of UnderWare, Inc.
X.FE
Xwhich is available for MS-DOS and OS/2 based PC's. CRISP is an attempt
Xto emulate faithfully and extend the functionality of this editor.
X.P
XCRISP has a number of features which make it stand out from other
Xeditors in its class (viz. Emacs et al., and vi). Most of these
Xfeatures are emulations of BRIEFs capabilities, and others are extensions
Xincorporating some of the better features of Emacs and vi.
X.AL
X.LI
XMultiple windows on screen; windows can be tiled or overlapped.
X.LI
XInfinite number of buffers (limited by memory).
X.LI
XSupports color on those terminals which understand it. Color is used
Xfor effectiveness.
X.LI
XSupports highlited regions, for easy text selection and manipulation.
X.LI
XSupports infinite level of undo and redo.
X.LI
XWorks on a variety of Unix systems and display terminals and has been
Xported to VMS.
X.LI
XSupports keyboards with large number of function keys.
X.LI
XHas an extensible macro language similar to Lisp.
X.LI
XSupports hard or soft tabs.
X.LI
XComplete on-line help.
X.LI
XComes as standard with a set of very usable macros to enhance the editing
Xprocess: autoindenting, autosaving, make & lint, spelling checker, 
Xtext formatter, tower of hanoi, calculator, ASCII table, cross referencing
Xof programs, etc.
X.LE
X
X.H 2 "Acknowledgements"
X.P
XI would like to thank all those people which have stimulated the
Xgrowth and evolution of CRISP. There are many people to thank, some
Xcolleagues, some are people I have never met, but have had useful input
Xfrom the BIX\*F conferencing system.
X.BL
X.LI
XMany thanks to my colleagues, viz. M. Burgess, M. Melville,
XJ. Sweeting.
X.LI
XTo the original BRIEF author who made me think this was a worthwhile
Xexercise: Dave Nanian.
X.LI
XTo the many participants on Bix who have found various bugs and
Xsuggested improvements.
X.LI
XTo the users of USENET who have contributed to making the
Xproduct more portable and have suggested enhancements. Please
Xsee the THANKS file in the source release for a list of names.
X.LE
X.FS
XBIX is a trademark of McGraw Hill. It is a conferencing system
Xwith a large user population with users from many parts of the world,
Xespecially the USA, and Europe.
X.FE
X.H 2 "Copyright Restrictions"
X.P
XThis software is essentially public-domain. I have distributed it to the
Xworld and would therefore expect people to use the software in a
X\fIreasonable manner\fR, ie they are free to pass it on to anyone
Xthey so desire, but must pass on this copyright notice as well.
X.P
XThe major restriction is that you are not allowed to sell it for
Xprofit without prior consultation with the author.
X.P
XYou may feel free to modify it in any way you choose but you
Xshould point out any changes you have made to the people you pass it on
Xso that people do not take my name in vain if there are any bugs in
Xyour code.
X.P
XThis software is provided on an \fIas is\fR basis - I am not liable
Xfor any bugs that occur in the code.
X.P
XThe name CRISP is a synonym for BRIEF (from my Collins Thesaurus).
XThe previous name for this editor was GRIEF, but the name was changed
Xat the request of D. Nanian because of the concern of product confusion.
XYou may see occasional references to 'GRIEF' or 'grief'.
X.H 2 "Release History"
X.P
XPlease refer to the ChangeLog file in the crisp source tree for a list
Xof changes since the last release.
X.H 2 "My Usenet address"
XIf you wish to correspond with me, my mail address is:
X.DS I
X.ft CW
Xfox%marlow.uucp@idec.stc.co.uk
X.DE
X
X
SHAR_EOF
chmod 0644 help/crisp/roff/Intro.mm || echo "restore of help/crisp/roff/Intro.mm fails"
mkdir help help/crisp help/crisp/roff >/dev/null 2>&1
echo "x - extracting help/crisp/roff/Concepts.mm (Text)"
sed 's/^X//' << 'SHAR_EOF' > help/crisp/roff/Concepts.mm &&
X
X.H 1 "Concepts"
X.P
XThis section describes the general concepts and objects which
Xare manipulatable by CRISP.
X
SHAR_EOF
chmod 0644 help/crisp/roff/Concepts.mm || echo "restore of help/crisp/roff/Concepts.mm fails"
mkdir help help/crisp help/crisp/roff >/dev/null 2>&1
echo "x - extracting help/crisp/roff/Features.mm (Text)"
sed 's/^X//' << 'SHAR_EOF' > help/crisp/roff/Features.mm &&
X.H 1 "Features"
X.P
XThis section describes the high level features of CRISP. These \fIfeatures\fR
Xare provided by a set of macros, ie they are not built into CRISP, but
Xare provided to make life easier.
X
SHAR_EOF
chmod 0644 help/crisp/roff/Features.mm || echo "restore of help/crisp/roff/Features.mm fails"
mkdir help help/crisp help/crisp/roff >/dev/null 2>&1
echo "x - extracting help/crisp/roff/Lang.mm (Text)"
sed 's/^X//' << 'SHAR_EOF' > help/crisp/roff/Lang.mm &&
X
X.H 1 "The CRISP Macro Language"
X.P
XThis section describes the macro language. It describes about
Xthe data types supported, the syntax of the language and how to use
Xthe CRISP macro compiler. The next chapter lists all the macro
Xprimitives available from within CRISP.
X
SHAR_EOF
chmod 0644 help/crisp/roff/Lang.mm || echo "restore of help/crisp/roff/Lang.mm fails"
mkdir help help/crisp help/crisp/roff >/dev/null 2>&1
echo "x - extracting help/crisp/roff/Prim.mm (Text)"
sed 's/^X//' << 'SHAR_EOF' > help/crisp/roff/Prim.mm &&
X
X.H 1 "Macro Primitives"
X.P
XThis section describes each CRISP macro primitive, and also
Xprovides a list, by category, of the primitives. The primitives
Xare listed in alphabetical order.
X.H 2 "Macros for performing Arithmetic"
X.P
XThe following macros are used to do 32-bit logical or integer arithmetic.
X##Arith
X.H 2 "Buffer Manipulation"
X.P
XThe following macros are used to manipulate buffers.
X##Buffer
X.H 2 "Debugging"
X.P
XThe following macros are used aid in debugging macros.
X##Debug
X.H 2 "Primitives for accessing the Environment"
X.P
XThe following macros are used to modify or inquire about the environment,
Xe.g. window status, status line.
X##Env
X.H 2 "File Manipulation"
X.P
XThe following macros are used to process files.
X##File
X.H 2 "Keyboard Manipulation"
X.P
XThe following macros are used to manipulate keyboard definitions.
X##Kbd
X.H 2 "List Manipulation"
X.P
XThe following macros are used to manipulate the list data types.
X##List
X.H 2 "Macros"
X.P
XThe following macros are used in writing macros.
X##Macro
X.H 2 "Miscellaneous"
X.P
XThe following macros dont really fit into any of the other categories.
X##Misc
X.H 2 "Moving the Cursor"
X.P
XThe following macros are used to move the cursor around the buffer.
X##Movement
X.H 2 "Processes and PTYs"
X.P
XThe following macros are used to manipulate processes attached to buffers.
X##Proc
X.H 2 "Scrap Manipulation"
X.P
XThe following macros are used to manipulate the scrap.
X##Scrap
X.H 2 "Screen Manipulation"
X.P
XThe following macros are used to control certain features of the screen.
X##Screen
X.H 2 "Searching and Translating"
X.P
XThe following macros are used to perform string searching and translation.
X##Search
X.H 2 "String Functions"
X.P
XThe following functions are used for performing string functions on
Xstring variables.
X##String
X.H 2 "Variable Declarations"
X.P
XThe following primitives are used for declaring variables.
X##Var
X.H 2 "Window Manipulation"
X.P
XThe following primitives are used for manipulating windows.
X##Window
X
X
X
SHAR_EOF
chmod 0644 help/crisp/roff/Prim.mm || echo "restore of help/crisp/roff/Prim.mm fails"
mkdir help help/crisp help/crisp/roff >/dev/null 2>&1
echo "x - extracting help/crisp/roff/Env.mm (Text)"
sed 's/^X//' << 'SHAR_EOF' > help/crisp/roff/Env.mm &&
X
X.H 1 "The External Environment of CRISP"
X.P
XThis section describes some of the aspects of the external environment,
Xe.g. environment variables, directories, etc, which may not
Xbe modified once CRISP has started, but may affect the initial set up of
XCRISP, and can give you finer control of some aspects of the way CRISP
Xworks.
X.H 2 "Installation and Porting Instructions"
X.P
XThis section describes how to install CRISP and some issues to do with
Xporting to new environments.
X.P
XCRISP is distributed in a number of modules. These modules are
Xdesigned such that I can send out new versions of the software
Xwithout having to send out the complete sources.
X.P
XThe modules are as follows:
X.VL 20
X.LI HLP
XThis contains the help files and the macros to build the user
Xmanual (this manual).
X.LI LIB
XThis module contains various libraries which either I have built or
Xhave been collected from postings on the Usenet. The code in these
Xlibraries very rarely changes. These libraries live in a subdirectory
Xof the main source directory.
X.LI MAC
XThis module contains the CRISP macro files.
X.LI SRC
XThis module contains all the source code to build the editor.
X.LE
X.P
XIn order to build the software, you should first create yourself
Xa new directory (e.g. crisp), and copy all of the distribution files
Xinto that directory. One of these files is the \fIBourne\fR-shell script CRISP.Inst.
XThis script is responsible for unpacking the sources and compiling
Xup the sources. It will also install the binaries and macros, etc.
XSee the section on the /usr/local/crisp tree for more details on
Xthe run-time environment.
X.P
XThe software has already been tested on a number of different systems
Xand so little or no changes to the distributed sources should be necessary.
XThe systems which CRISP has been ported to are as follows:
X.AL
X.LI
XXenix 286 and Xenix 386.
X.LI
XSunOS 3.x and 4.x. 
X.LI
XUnix V.3.0/386 Microport and Interactive.
X.LI
XInteractive 386/ix V.3.2 release 2.0.1.
X.LI
XIBM AIX (dont know what version).
X.LI
XUnix V.2 - SV/AT Microport.
X.LI
XVMS
X.LE
X.P
XSince the last release, a number of changes have been made to the
Xinternal structure of the code. It is quite possible that some of these
Xtested options will no longer work. My development environment consists
Xof a Compaq 386 running 386/ix V.3.2 and a Sun-3/260 running SunOS 4.
XIf there are any problems or you are porting to a new system, then one
Xof these systems should represent a good starting point.
X.H 3 "Notes on ports to different systems"
X.P
XCRISP has been ported to a number of different systems. On some
Xsystems it works better than others, and the code has some conditional
Xcompilation features to ease the porting to different operating systems.
XSome of these features have not been tested for a long time, and I know
Xthat some idiosyncrasies have shown up in these versions, which I have
Xnot had the time to fix. This section attempts to explain some of these things.
X.H 4 "The m-machine.h and s-machine files"
X.P
XThis release of CRISP follows the GNU system of trying to parameterise 
Xportability criteria. It uses a C include file called m-machine.h and 
Xa \fIBourne\fR shell script - s-machine. The source directory comes
Xwith a number of s-* and m-* files which have been put together for systems
Xknown to work. When the installation is first performed, a link is made
Xfrom the appropriate s-* and m-* files to the s-machine and m-machine.h files.
X.P
XThis mechanism makes it less work on subsequent rebuilds of the software.
XNow the overhead of detecting which version of Unix we are running is done
Xduring the first time initialisation.
X.P
XThe m-machine.h files contain various predicate #define's which define
Xthe availability of certain features of the operating system. Each
Xm-machine.h file is commented so you should be able to take one of
Xthese files and modify it for your own system if it is not one of
Xthe ones supported.
X.P
XThe s-machine shell script is used to set up environment variables to control
Xthe make.
X.H 4 "Enumeration Types"
X.P
XThere seem to be two classes of C compilers with respect to
Xthe \f(CWenum\fR keyword - those that treat enum's as different
Xtypes to \f(CWint\fR and those that treat them the same as int's.
X.P
XIn the latest systems I have ported CRISP to, the Makefile has the
Xability to treat enum types as int. 
X.P
XIf you are porting CRISP to a version of Unix which isn't
Xone of the standard supported systems, then you may need to
Xadd \f(CW-DOPCODE=int\fR to the CFLAGS definition for that 
Xsystem if you get enum conversion errors during compilation.
X.H 4 "Problems with malloc()"
X.P
XSome systems have deranged versions of malloc(). This is especially
Xtrue of Microports SV/AT version 2.2 and below. The problem with malloc()
Xis that the process size gets larger and larger even although free() is
Xcalled. The distribution includes a replacement for the standard
Xversion of malloc() in the utils sub-directory.
X.P
XOn these systems, you can use the \f(CW-DMALLOC\fR switch to control
Xcompilation of the software. This switch causes CRISP and the macro
Xcompiler to grab a huge chunk of memory to start with and then free
Xit. This seems to have a better performance effect than to continually
Xmalloc() small pieces of memory. 
X.P
XWhen this switch is on, the macro compiler does some funny things.
XI found on my system that if you try to compile all the .m files in
Xthe macro directory in one go (cm *.m) that you could run out
Xof swap space on small 286 systems. To remedy this, I put in some
Xcode which causes the 'cm' program to re-exec itself after every 10 .m
Xfiles have been processed in an attempt to limit the size of the executable
Ximage. This doesn't seem to work properly so if you do you CRISP
Xon these systems, you may have problems at the last stage of installation
Xwhen the macro compiler falls over !.
X.P
XThe is now a \fIMakefile\fR in the macro source directory which builds
Xeach macro object file separately. This should remove the above described
Xproblem by avoiding it.
X.P
X.H 4 "VAX/VMS Installation"
X.P
XI have ported CRISP to the vax, but have not completed some of the
Xthings that need to be done to make for a clean installation. Essentially
Xthe code contains nearly all that is needed to make it run 
Xon VMS. You'll have to work out how to get the various .cmd files
Xrun. (Read the README file in the vms subdirectory).
X.P
XThings that haven't been done but need to are: allow the
Xbinary of CRISP to be run from a directory other than the installation
Xdirectory. Some of this has been done, but it may not be able
Xto find the compiled macro files.
X.P
XI believe that I never got the POSIX directory access routines to
Xwork properly, so file-name completion and expansion may
Xnot work properly.
X.P
XThere is a problem currently with having the tty files in a subdirectory
Xsince CRISP doesn't parse VMS filenames properly enough to get over the
Xfilename syntax: crisp_library:[macros][.tty]. You need to hack crisp.m
Xwhere it has the line "tty/" to make things right. I shall fix this eventually.
X.H 4 "Byte ordering Problems"
X.P
XI have made the compiled macro files machine independent - so that
Xon NFS type systems, different host machines can share the compiled
Xmacros. There is a program - word.c in the top level source directory
Xwhich has code in it for reading/writing 16-bit and 32-bit quantities.
XThe code is in there for [23]86, 680x0 and VAX bytes orderings. Other machines
Xmay require that you extend these functions to get the correct
Xbyte orderings. The byte ordering routines work for all the
Xmachines supported.
X.H 3 "Support for Keyboards and Screen Drivers"
X.P
XThis section describes some of the rationale behind the way
Xin which the keyboard and screen driving code works so that
Xpeople who wish to provide support for new devices can work out
Xhow to get them to work.
X.P
XOne of the major problems with the original BRIEF software is that it
Xassumes an IBM-PC keyboard and a standard screen driver with various
Xline-drawing characters in the screen display font.
X.P
XCRISP runs under Unix, and since Unix is multi-user and is usually
Xnetworked, cannot assume anything about the physical keyboards/screens
Xrunning the software.
XThe software has been written to be portable such that it will
Xnot only run on any Unix variant, but may also be run from terminals
Xwhich are connected to the host over a network. Thus, although CRISP
Xmay be running on a Sun, the code does not assume that you have a Sun
Xkeyboard - it could be a PC keyboard or a VT-100.
X.P
XThis presented me with a problem in how to use the standard Unix
Xlibraries for terminal support, etc. In the end I decided to use
Xtermcap for the basic functionality of a terminal but to provide
Xthe termcap routines needed to access the \fI/etc/termcap\fR database.
XI chose termcap instead of terminfo because at the time that
Xwas more widely available.
X.P
XIn any case, it is purely of academic interest that termcap is
Xused. This should not cause any prospective porters of the software
Xwith any problem because of the library routines are provided including
Xa termcap database file itself.
X.P
X\fItermcap\fR is limited in its ability to describe what a terminal can
Xdo, and so CRISP has a mechanism for describing those features which
Xa terminal supports that curses doesn't.
X.P
XThese features are part of the macro language, viz.
X(set_term_features), (set_term_keyboard) and (set_term_characters).
X(Refer to the reference section of the manual for a complete description
Xof these primitives).
X.P
XWhen CRISP starts up it looks at the TERM environment variable to
Xget the basic terminal characteristics from the termcap file.
XIf there is a BTERM environment variable it then autoloads a
Xfile called tty/$BTERM.cm. You will find a number of these
Xfiles in the macro source and object directories.
X.P
XThere are essentially two types of things you need to tell CRISP
Xin order to use it effectively:
X.AL
X.LI
XWhat the magic escape sequences are in order to perform color and
Xdraw the line-drawing characters.
X.LI
Xtell CRISP what sequence of characters each function key generates.
X.LE
X.P
XCRISP will run on mono or color screens, and the example files should
Xbe easy to copy and modify using the information in this manual.
X.P
XThe keyboard presents more of a problem. Because BRIEF is IBM-PC
Xspecific, it represents key-codes in terms of the keys available
Xon a PC keyboard. Emacs, for example, uses the notion of
Xa meta key; BRIEF uses function keys and key modifiers - SHIFT, ALT,
Xand CTRL.
X.P
XSome keyboards have very limited access to function keys, e.g. the original
XVT-100. When configuring these keyboards, you will need to change the
Xdefault layouts used by the macros, and may need to change the 
Xstartup macros to assign useful macros to the available keys on your
Xkeyboard.
X.P
XCRISP allows messages which need to refer to keys to be made keyboard
Xdependent. This is controlled via the new environment variable - BKBD.
XThis is used, for example, when labels appear at the bottom of pop-up
Xwindows. The BKBD variable is used to tell the macros which keyboard
Xyou are using.
X
SHAR_EOF
chmod 0644 help/crisp/roff/Env.mm || echo "restore of help/crisp/roff/Env.mm fails"
mkdir help help/crisp help/crisp/roff >/dev/null 2>&1
echo "x - extracting help/crisp/roff/Install.mm (Text)"
sed 's/^X//' << 'SHAR_EOF' > help/crisp/roff/Install.mm &&
X
X.H 1 "Installation and Porting Instructions"
X.P
XThis section describes how to install CRISP and some issues to do with
Xporting to new environments.
X.P
XCRISP is distributed in a number of modules. These modules are
Xdesigned such that I can send out new versions of the software
Xwithout having to send out the complete sources.
X.P
XThe modules are as follows:
X.VL 20
X.LI HLP
XThis contains the help files and the macros to build the user
Xmanual (this manual).
X.LI LIB
XThis modules contains various libraries which either I have built or
Xhave been collecting from postings on the Usenet. The code in these
Xlibraries very rarely changes. These libraries live in a subdirectory
Xof the main source directory.
X.LI MAC
XThis module contains the CRISP macro files.
X.LI SRC
XThis module contains all the source code to build the editor.
X.LE
X
SHAR_EOF
chmod 0644 help/crisp/roff/Install.mm || echo "restore of help/crisp/roff/Install.mm fails"
mkdir help help/crisp help/crisp/roff >/dev/null 2>&1
echo "x - extracting help/crisp/roff/ms.mac (Text)"
sed 's/^X//' << 'SHAR_EOF' > help/crisp/roff/ms.mac &&
X\" num Ft - type of block 1 = .AL
X\"			  2 = .BL
X\"			  3 = .VL
X\"			  4 = .DL
X\" num F0 - current item number
X.de AL
X.in +1i
X.nr Ft 1
X.nr F0 0
X..
X.de BL
X.in +1i
X.nr Ft 2
X.nr F0 0
X..
X.de VL
X.in +1i
X.nr Ft 3
X.nr F0 0
X..
X.de DL
X.in +1i
X.nr Ft 4
X.nr F0 0
X..
X.de LI
X.nr F0 +1
X.sp 1
X.br
X.if \\n(Ft==1 .ds ;0 \\&\\n(F0)  \\&
X.if \\n(Ft==2 .ds ;0 \\&*  \\&
X.if \\n(Ft==3 .ds ;0 \\&\\$1  \\&
X.if \\n(Ft==4 .ds ;0 \\&-  \\&
X.ti -\\w'\\*(;0'u
X\\*(;0\c
X..
X.de LE
X.in -1i
X..
X
SHAR_EOF
chmod 0644 help/crisp/roff/ms.mac || echo "restore of help/crisp/roff/ms.mac fails"
mkdir help help/crisp help/crisp/sections >/dev/null 2>&1
echo "x - extracting help/crisp/sections/Arith (Text)"
sed 's/^X//' << 'SHAR_EOF' > help/crisp/sections/Arith &&
X!
X!=
X%
X%=
X&
X&&
X&=
X*
X*=
X+
X++
X+=
X-
X--
X-=
X/
X/=
X<
X<=
X=
X==
X>
X>=
X^
X^=
Xabove
Xabove_eq
Xbelow
Xbelow_eq
X|
X|=
X||
X~
SHAR_EOF
chmod 0644 help/crisp/sections/Arith || echo "restore of help/crisp/sections/Arith fails"
mkdir help help/crisp help/crisp/sections >/dev/null 2>&1
echo "x - extracting help/crisp/sections/Misc (Text)"
sed 's/^X//' << 'SHAR_EOF' > help/crisp/sections/Misc &&
X_bad_key
Xbeep
Xdate
Xset_msg_level
Xtime
Xundo
Xversion
SHAR_EOF
chmod 0644 help/crisp/sections/Misc || echo "restore of help/crisp/sections/Misc fails"
mkdir help help/crisp help/crisp/sections >/dev/null 2>&1
echo "x - extracting help/crisp/sections/Debug (Text)"
sed 's/^X//' << 'SHAR_EOF' > help/crisp/sections/Debug &&
Xabort
Xdebug
Xerror
Xmessage
Xpause_on_error
Xprint
Xprintf
Xprofile
Xwatch
SHAR_EOF
chmod 0644 help/crisp/sections/Debug || echo "restore of help/crisp/sections/Debug fails"
mkdir help help/crisp help/crisp/sections >/dev/null 2>&1
echo "x - extracting help/crisp/sections/List (Text)"
sed 's/^X//' << 'SHAR_EOF' > help/crisp/sections/List &&
Xappend_list
Xcar
Xcdr
Xcommand_list
Xlength_of_list
Xlist
Xmacro_list
Xnth
Xput_nth
Xquote_list
Xsearch_list
SHAR_EOF
chmod 0644 help/crisp/sections/List || echo "restore of help/crisp/sections/List fails"
mkdir help help/crisp help/crisp/sections >/dev/null 2>&1
echo "x - extracting help/crisp/sections/Kbd (Text)"
sed 's/^X//' << 'SHAR_EOF' > help/crisp/sections/Kbd &&
Xassign_to_key
Xinq_assignment
Xinq_kbd_char
Xinq_keyboard
Xinq_local_keyboard
Xint_to_key
Xkey_to_int
Xkeyboard_flush
Xkeyboard_pop
Xkeyboard_push
Xkeyboard_typeables
Xpause
Xplayback
Xprocess
Xpush_back
Xread_char
Xremember
Xself_insert
Xundo
Xuse_local_keyboard
SHAR_EOF
chmod 0644 help/crisp/sections/Kbd || echo "restore of help/crisp/sections/Kbd fails"
mkdir help help/crisp help/crisp/sections >/dev/null 2>&1
echo "x - extracting help/crisp/sections/String (Text)"
sed 's/^X//' << 'SHAR_EOF' > help/crisp/sections/String &&
Xatoi
Xcompress
Xindex
Xlower
Xltrim
Xmacro_list
Xquote_regexp
Xread
Xrindex
Xsearch_string
Xsprintf
Xstring_count
Xstrlen
Xsubstr
Xtrim
Xupper
SHAR_EOF
chmod 0644 help/crisp/sections/String || echo "restore of help/crisp/sections/String fails"
mkdir help help/crisp help/crisp/sections >/dev/null 2>&1
echo "x - extracting help/crisp/sections/Buffer (Text)"
sed 's/^X//' << 'SHAR_EOF' > help/crisp/sections/Buffer &&
Xattach_buffer
Xcreate_buffer
Xdelete_buffer
Xdelete_char
Xdelete_line
Xdelete_to_eol
Xdistance_to_tab
Xgoto_bookmark
Xinq_buffer
Xinq_buffer_flags
Xinq_file_buffer
Xinq_line_length
Xinq_lines
Xinq_mode
Xinq_modified
Xinq_names
Xinq_position
Xinq_process_position
Xinq_system
Xinq_views
Xinsert
Xinsert_mode
Xinsert_process
Xnext_buffer
Xright
Xself_insert
Xset_buffer
Xset_buffer_flags
Xset_process_position
Xset_top_left
Xsort_buffer
Xtabs
Xup
Xwrite_buffer
SHAR_EOF
chmod 0644 help/crisp/sections/Buffer || echo "restore of help/crisp/sections/Buffer fails"
mkdir help help/crisp help/crisp/sections >/dev/null 2>&1
echo "x - extracting help/crisp/sections/Macro (Text)"
sed 's/^X//' << 'SHAR_EOF' > help/crisp/sections/Macro &&
Xautoload
Xbreak
Xcall_registered_macro
Xcontinue
Xdelete_macro
Xexecute_macro
Xexit
Xfirst_time
Xget_parm
Xif
Xinq_called
Xinq_macro
Xinq_msg_level
Xload_macro
Xmacro
Xnothing
Xput_parm
Xregister_macro
Xrestore_position
Xreturn
Xreturns
Xsave_position
Xset_calling_name
Xswitch
Xunregister_macro
Xwhile
SHAR_EOF
chmod 0644 help/crisp/sections/Macro || echo "restore of help/crisp/sections/Macro fails"
mkdir help help/crisp help/crisp/sections >/dev/null 2>&1
echo "x - extracting help/crisp/sections/Movement (Text)"
sed 's/^X//' << 'SHAR_EOF' > help/crisp/sections/Movement &&
Xbackspace
Xbeginning_of_line
Xdown
Xdrop_bookmark
Xend_of_buffer
Xend_of_line
Xend_of_window
Xgoto_line
Xgoto_old_line
Xleft
Xmove_abs
Xmove_rel
Xnext_char
Xpage_down
Xpage_up
Xprev_char
Xrestore_position
Xsave_position
Xsearch_back
Xsearch_fwd
Xset_top_left
Xswap_anchor
Xtop_of_buffer
Xtop_of_window
SHAR_EOF
chmod 0644 help/crisp/sections/Movement || echo "restore of help/crisp/sections/Movement fails"
mkdir help help/crisp help/crisp/sections >/dev/null 2>&1
echo "x - extracting help/crisp/sections/Screen (Text)"
sed 's/^X//' << 'SHAR_EOF' > help/crisp/sections/Screen &&
Xborders
Xcolor
Xdisplay_mode
Xecho_line
Xega
Xenable_display
Xget_term_characters
Xget_term_features
Xget_term_keyboard
Xinq_borders
Xinq_cmd_line
Xinq_command
Xinq_message
Xinq_screen_size
Xinq_window_color
Xinq_window_size
Xredraw
Xrefresh
Xscreen_dump
Xset_display_chars
Xset_term_characters
Xset_term_features
Xset_term_keyboard
Xuse_tab_char
Xwindow_color
SHAR_EOF
chmod 0644 help/crisp/sections/Screen || echo "restore of help/crisp/sections/Screen fails"
mkdir help help/crisp help/crisp/sections >/dev/null 2>&1
echo "x - extracting help/crisp/sections/Env (Text)"
sed 's/^X//' << 'SHAR_EOF' > help/crisp/sections/Env &&
Xcd
Xdos
Xget_term_characters
Xget_term_features
Xget_term_keyboard
Xgetpid
Xgetwd
Xinq_brief_level
Xinq_environment
Xinq_idle_default
Xinq_idle_time
Xset_backup
Xset_display_chars
Xset_term_characters
Xset_term_features
Xset_term_keyboard
Xshell
Xstrip_cr
Xuse_tab_char
SHAR_EOF
chmod 0644 help/crisp/sections/Env || echo "restore of help/crisp/sections/Env fails"
mkdir help help/crisp help/crisp/sections >/dev/null 2>&1
echo "x - extracting help/crisp/sections/Window (Text)"
sed 's/^X//' << 'SHAR_EOF' > help/crisp/sections/Window &&
Xchange_window
Xcreate_edge
Xcreate_window
Xdelete_edge
Xdelete_window
Xdistance_to_tab
Xinq_mode
Xinq_position
Xinq_views
Xinq_window
Xinq_window_color
Xinq_window_size
Xinsert
Xinsert_mode
Xinsert_process
Xmove_edge
Xright
Xself_insert
Xset_top_left
Xset_window
Xup
Xwindow_color
SHAR_EOF
chmod 0644 help/crisp/sections/Window || echo "restore of help/crisp/sections/Window fails"
mkdir help help/crisp help/crisp/sections >/dev/null 2>&1
echo "x - extracting help/crisp/sections/Proc (Text)"
sed 's/^X//' << 'SHAR_EOF' > help/crisp/sections/Proc &&
Xconnect
Xdisconnect
Xdos
Xinq_process_position
Xinsert_process
Xset_process_position
Xshell
Xsleep
Xwait
Xwait_for
SHAR_EOF
chmod 0644 help/crisp/sections/Proc || echo "restore of help/crisp/sections/Proc fails"
mkdir help help/crisp help/crisp/sections >/dev/null 2>&1
echo "x - extracting help/crisp/sections/Scrap (Text)"
sed 's/^X//' << 'SHAR_EOF' > help/crisp/sections/Scrap &&
Xcopy
Xcut
Xdelete_block
Xdrop_anchor
Xinq_mark_size
Xinq_marked
Xinq_scrap
Xmark
Xpaste
Xraise_anchor
Xset_scrap_info
Xswap_anchor
Xtransfer
Xwrite_block
SHAR_EOF
chmod 0644 help/crisp/sections/Scrap || echo "restore of help/crisp/sections/Scrap fails"
mkdir help help/crisp help/crisp/sections >/dev/null 2>&1
echo "x - extracting help/crisp/sections/Var (Text)"
sed 's/^X//' << 'SHAR_EOF' > help/crisp/sections/Var &&
Xdeclare
Xextern
Xget_parm
Xglobal
Xint
Xis_integer
Xis_list
Xis_null
Xis_string
Xlist
Xmake_local_variable
Xput_parm
Xstring
Xtypeof
SHAR_EOF
chmod 0644 help/crisp/sections/Var || echo "restore of help/crisp/sections/Var fails"
mkdir help help/crisp help/crisp/sections >/dev/null 2>&1
echo "x - extracting help/crisp/sections/File (Text)"
sed 's/^X//' << 'SHAR_EOF' > help/crisp/sections/File &&
Xdel
Xedit_file
Xexist
Xfile_pattern
Xfind_file
Xinq_file_buffer
Xoutput_file
Xread_file
Xstrip_cr
Xwrite_buffer
SHAR_EOF
chmod 0644 help/crisp/sections/File || echo "restore of help/crisp/sections/File fails"
mkdir help help/crisp help/crisp/sections >/dev/null 2>&1
echo "x - extracting help/crisp/sections/Search (Text)"
sed 's/^X//' << 'SHAR_EOF' > help/crisp/sections/Search &&
Xquote_regexp
Xre_syntax
Xsearch_back
Xsearch_case
Xsearch_fwd
Xsearch_list
Xsearch_string
Xtranslate
SHAR_EOF
chmod 0644 help/crisp/sections/Search || echo "restore of help/crisp/sections/Search fails"
rm -f s2_seq_.tmp
echo "You have unpacked the last part"
exit 0
-- 
=====================			Reuters Ltd PLC, 
Tel: +44 628 891313 x. 212		 Westthorpe House,
UUCP:     fox%marlow.uucp@idec.stc.co.uk  Little Marlow,
					   Bucks, England SL7 3RQ