[gnu.emacs.sources] GNU Emacs forms-mode version 1.2.2, part 2 of 3

jv@mh.nl (Johan Vromans) (05/20/91)

Submitted-by: jv@mh.nl
Archive-name: forms/part02

---- Cut Here and feed the following to sh ----
#!/bin/sh
# this is forms.shr.02 (part 2 of forms)
# do not concatenate these parts, unpack them in order with /bin/sh
# file forms.ti continued
#
if test ! -r _shar_seq_.tmp; then
	echo 'Please unpack part 1 first!'
	exit 1
fi
(read Scheck
 if test "$Scheck" != 2; then
	echo Please unpack part "$Scheck" next!
	exit 1
 else
	exit 0
 fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
	echo 'x - still skipping forms.ti'
else
echo 'x - continuing file forms.ti'
sed 's/^X//' << 'SHAR_EOF' >> 'forms.ti' &&
X
@end table
X
@node Miscellaneous, Error Messages, Key Bindings, Top
@section Miscellaneous
X
@vindex forms-version
A global variable ``forms-version'' holds the version information of
the current implementation of forms mode.
X
Care has been taken to localize the current information of the forms
mode, so it is possible to visit multiple files in forms mode
simultaneously, even if they have different properties.
X
If a control file is visited using the standard @code{find-file}
commands, forms mode can be enabled with the command @code{M-x forms-mode}.@*
Forms mode will be automatically enabled if the file contains
the string @code{"-*- forms -*-"} somewhere in the first line. However,
this makes it hard to edit the control file itself so you'd better think
twice before using this.
X
The default format for the data file, using @key{TAB} to separate fields
and @code{C-k} to separate multi-line fields, matches the file format of
some popular Macintosh database programs, e.g. FileMaker. So
@code{forms-mode} could decrease the need to use Apple computers.
X
@node Error Messages, Credits, Miscellaneous, Top
@section Error Messages
X
This section describes all error messages which can be generated by
forms mode.
X
@table @code
@item 'forms-file' has not been set
The variable @code{forms-file} was not set by the control file.
X
@item 'forms-number-of-fields' has not been set
The variable @code{forms-number-of-fields} was not set by the control
file.
X
@item 'forms-number-of-fields' must be > 0
The variable @code{forms-number-of-fields} did not contain a positive
number. 
X
@item 'forms-field-sep' is not a string
@itemx 'forms-multi-line' must be nil or a one-character string
The variable @code{forms-multe-line} was set to something other than
@code{nil or} a single-character string.
X
@item 'forms-multi-line' is equal to 'forms-field-sep'
The variable @code{forms-multi-line} may not be equal to
@code{forms-field-sep} for this would make it impossible to distinguish
fields and the lines in the fields.
X
@item 'forms-format-list' has not been set
@itemx 'forms-format-list' is not a list
The variable @code{forms-format-list} was not set to a lisp @code{list}
by the control file.
X
@item forms error: field number @var{XX} out of range 1..@var{NN}
A field number was supplied with a value of @var{XX}, which was not
greater that zero and smaller than or equal to the number of fields in the
forms, @var{NN}.
X
@item invalid element in 'forms-format-list': @var{XX}
A list element was supplied in @code{forms-format-list} which was not a
@code{string} nor a @code{number}.
X
@item parse error: not looking at "@var{TEXT}"
When re-parsing the contents of a forms, the text @var{TEXT}, which
starts the forms, could not be found.
X
@item parse error: cannot find "@var{TEXT}"
When re-parsing the contents of a forms, the text @var{TEXT}, which
separates two fields, could not be found.
X
@item parse error: cannot parse adjacent fields @var{XX} and @var{YY}
Fields @var{XX} and @var{YY} were not separated by text, so could not be
parsed again.
X
@item Record has @var{XX} fields instead of @var{YY}
The number of fields in this record in the data file did not match
@code{forms-number-of-fields}. Missing fields will be set to empty.
X
@item Multi-line fields in this record - update refused!
The current record contains newline characters, hance can not be written
back to the data file, for it would corrupt it.@*
probably a field was set to a multi-line value, while the setting of
@code{forms-multi-line} prohibited this.
X
@item Record number @var{XX} out of range 1..@var{YY}
A jump was made to non-existing record @var{XX}. @var{YY} denotes the
number of records in the file.
X
@item Stuck at record @var{XX}
An internal error prevented a specific record from being retrieved.
X
@end table
X
@node Credits, Concept Index, Error Messages, Top
@section Credits
X
Forms mode is developed by Johan Vromans @code{<jv@@mh.nl>} at Multihouse
Reseach in the Netherlands. 
X
Harald Hanche-Olsen @code{<hanche@@imf.unit.no>} supplied the idea for
the new record filter, and provided better replacements for some
internal functions. 
X
Bugfixes and other useful suggestions were supplied by
cwitty@@portia.stanford.edu, Jonathan I. Kamens, Ignatios Souvatzis and
Harald Hanche-Olsen.
X
This documentation was slightly inspired by the documentation of ``rolo
mode'' by Paul Davis at Schlumberger Cambridge Research
@code{<davis%scrsu1%sdr.slb.com@@relay.cs.net>}.
X
None of this would have been possible without GNU Emacs of the Free
Software Foundation. Thanks, Richard!
X
@node Concept Index, Variable Index, Credits, Top
@unnumbered Concept Index
@printindex cp
X
@node Variable Index, Function Index, Concept Index, Top
@unnumbered Variable Index
@printindex vr
X
@node Function Index, , Variable Index, Top
@unnumbered Function Index
@printindex fn
X
@contents
@bye
SHAR_EOF
echo 'File forms.ti is complete' &&
chmod 0444 forms.ti ||
echo 'restore of forms.ti failed'
Wc_c="`wc -c < 'forms.ti'`"
test 21930 -eq "$Wc_c" ||
	echo 'forms.ti: original size 21930, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= forms.el ==============
if test -f 'forms.el' -a X"$1" != X"-c"; then
	echo 'x - skipping forms.el (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting forms.el (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'forms.el' &&
;;; Forms Mode - A GNU Emacs Major Mode		; @(#)@ forms	1.2.2
;;; Created 1989 - Johan Vromans <jv@mh.nl>
;;; See the docs for a list of other contributors.
;;;
;;; This file is part of GNU Emacs.
X
;;; GNU Emacs is distributed in the hope that it will be useful,
;;; but WITHOUT ANY WARRANTY.  No author or distributor
;;; accepts responsibility to anyone for the consequences of using it
;;; or for whether it serves any particular purpose or works at all,
;;; unless he says so in writing.  Refer to the GNU Emacs General Public
;;; License for full details.
X
;;; Everyone is granted permission to copy, modify and redistribute
;;; GNU Emacs, but only under the conditions described in the
;;; GNU Emacs General Public License.   A copy of this license is
;;; supposed to have been given to you along with GNU Emacs so you
;;; can know your rights and responsibilities. 
;;; If you don't have this copy, write to the Free Software
;;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
;;;
X
(provide 'forms-mode)
X
;;; Visit a file using a form.
;;;
;;; === Naming conventions
;;;
;;; The names of all variables and functions start with 'form-'.
;;; Names which start with 'form--' are intended for internal use, and
;;; should *NOT* be used from the outside.
;;;
;;; All variables are buffer-local, to enable multiple forms visits 
;;; simultaneously.
;;; Variable 'forms--mode-setup' is local to *ALL* buffers, for it 
;;; controls if forms-mode has been enabled in a buffer.
;;;
;;; === How it works ===
;;;
;;; Forms mode means visiting a data file which is supposed to consist
;;; of records each containing a number of fields. The records are
;;; separated by a newline, the fields are separated by a user-defined
;;; field separater (default: TAB).
;;; When shown, a record is transferred to an emacs buffer and
;;; presented using a user-defined form. One record is shown at a
;;; time.
;;;
;;; Forms mode is a composite mode. It involves two files, and two
;;; buffers.
;;; The first file, called the control file, defines the name of the
;;; data file and the forms format. This file buffer will be used to
;;; present the forms.
;;; The second file holds the actual data. The buffer of this file
;;; will be buried, for it is never accessed directly.
;;;
;;; Forms mode is invoked using "forms-find-file control-file".
;;; Alternativily forms-find-file-other-window can be used.
;;;
;;; You may also visit the control file, and switch to forms mode by hand
;;; with M-x forms-mode .
;;;
;;; Automatic mode switching is supported, so you may use "find-file"
;;; if you specify "-*- forms -*-" in the first line of the control file.
;;; 
;;; The control file is visited, evaluated using
;;; eval-current-buffer, and should set at least the following
;;; variables:
;;;
;;;	forms-file		    [string] the name of the data file.
;;;
;;;	forms-number-of-fields	    [integer]
;;;			The number of fields in each record.
;;;
;;;	forms-format-list           [list]   formatting instructions.
;;;
;;; The forms-format-list should be a list, each element containing
;;;
;;;  - either a string, e.g. "hello" (which is inserted \"as is\"),
;;;
;;;  - an integer, denoting a field number. The contents of the field
;;;    are inserted at this point.
;;;    The first field has number one.
;;;
;;; Optional variables which may be set in the control file:
;;;
;;;	forms-field-sep				[string, default TAB]
;;;			The field separator used to separate the
;;;			fields in the data file. It may be a string.
;;;
;;;	forms-read-only				[bool, default nil]
;;;			't' means that the data file is visited read-only.
;;;			If no write access to the data file is
;;;			possible, read-only mode is enforced. 
;;;
;;;	forms-multi-line			[string, default "^K"]
;;;			If non-null the records of the data file may
;;;			contain fields which span multiple lines in
;;;			the form.
;;;			This variable denoted the separator character
;;;			to be used for this purpose. Upon display, all
;;;			occurrencies of this character are translated
;;;			to newlines. Upon storage they are translated
;;;			back to the separator.
;;;
;;;	forms-forms-scroll			[bool, default t]
;;;			If non-nil: redefine scroll-up/down to perform
;;;			forms-next/prev-field if in forms mode.
;;;
;;;	forms-forms-jump			[bool, default t]
;;;			If non-nil: redefine beginning/end-of-buffer
;;;			to performs forms-first/last-field if in
;;;			forms mode.
;;;
;;;	forms-new-record-filter			[function, no default]
;;;			If defined: this function is called when a new
;;;			record is created. It can be used to fill in
;;;			the new record with default fields, for example.
;;;
;;; After evaluating the control file, its buffer is cleared and used
;;; for further processing.
;;; The data file (as designated by "forms-file") is visited in a buffer
;;; (forms--file-buffer) which will not normally be shown.
;;; Great malfunctioning may be expected if this file/buffer is modified
;;; outside of this package while it's being visited!
;;;
;;; A record from the data file is transferred from the data file,
;;; split into fields (into forms--the-record-list), and displayed using
;;; the specs in forms-format-list.
;;; A format routine 'forms--format' is build upon startup to format 
;;; the records.
;;;
;;; When a form is changed the record is updated as soon as this form
;;; is left. The contents of the form are parsed using forms-format-list,
;;; and the fields which are deduced from the form are modified. So,
;;; fields not shown on the forms retain their origional values.
;;; The newly formed record and replaces the contents of the
;;; old record in forms--file-buffer.
;;; A parse routine 'forms--parser' is build upon startup to parse
;;; the records.
;;;
;;; Two exit functions exist: forms-exit (which saves) and forms-exit-no-save
;;; (which doesn't). However, if forms-exit-no-save is executed and the file
;;; buffer has been modified, emacs will ask questions.
;;;
;;; Other functions are:
;;;
;;;	paging (forward, backward) by record
;;;	jumping (first, last, random number)
;;;	searching
;;;	creating and deleting records
;;;	reverting the form (NOT the file buffer)
;;;	switching edit <-> view mode v.v.
;;;	jumping from field to field
;;;
;;; As an documented side-effect: jumping to the last record in the
;;; file (using forms-last-record) will adjust forms--total-records if
;;; needed.
;;;
;;; Commands and keymaps:
;;;
;;; A local keymap 'forms-mode-map' is used in the forms buffer.
;;; As conventional, this map can be accessed with C-c prefix.
;;; In read-only mode, the C-c prefix must be omitted.
;;;
;;; Default bindings:
;;;
;;;	\C-c	forms-mode-map
;;;	TAB	forms-next-field
;;;	SPC 	forms-next-record
;;;	<	forms-first-record
;;;	>	forms-last-record
;;;	?	describe-mode
;;;	d	forms-delete-record
;;;	e	forms-edit-mode
;;;	i	forms-insert-record
;;;	j	forms-jump-record
;;;	n	forms-next-record
;;;	p	forms-prev-record
;;;	q	forms-exit
;;;	s	forms-search
;;;	v	forms-view-mode
;;;	x	forms-exit-no-save
;;;	DEL	forms-prev-record
;;;
;;; Standard functions scroll-up, scroll-down, beginning-of-buffer and
;;; end-of-buffer are wrapped with re-definitions, which map them to
;;; next/prev record and first/last record.
;;; Buffer-local variables forms-forms-scroll and forms-forms-jump
;;; may be used to control these redefinitions.
;;;
;;; Function save-buffer is also wrapped to perform a sensible action.
;;; A revert-file-hook is defined to revert a forms to original.
;;;
;;; For convenience, TAB is always bound to forms-next-field, so you
;;; don't need the C-c prefix for this command.
;;;
;;; Global variables and constants
X
(defconst forms-version "1.2.2"
X  "Version of forms-mode implementation")
X
(defvar forms-forms-scrolls t
X  "If non-null: redefine scroll-up/down to be used with forms-mode.")
X
(defvar forms-forms-jumps t
X  "If non-null: redefine beginning/end-of-buffer to be used with forms-mode.")
X
(defvar forms-mode-hooks nil
X  "Hook functions to be run upon entering forms mode.")
;;;
;;; Mandatory variables - must be set by evaluating the control file
X
(defvar forms-file nil
X   "Name of the file holding the data.")
X
(defvar forms-format-list nil
X  "Formatting specifications:
X
It should be a list, each element containing 
X
X - either a string, e.g. "hello" (which is inserted \"as is\"),
X
X - an integer, denoting the number of a field which contents are
X   inserted at this point.
X   The first field has number one.
")
X
(defvar forms-number-of-fields nil
X  "Number of fields per record.")
X
;;;
;;; Optional variables with default values
X
(defvar forms-field-sep "\t"
X  "Field separator character (default TAB)")
X
(defvar forms-read-only nil
X  "Read-only mode (defaults to the write access on the data file).")
X
(defvar forms-multi-line "\C-k"
X  "Character to separate multi-line fields (default ^K)")
X
(defvar forms-forms-scroll t
X  "Redefine scroll-up/down to perform forms-next/prev-record when in
X forms mode.")
X
(defvar forms-forms-jump t
X  "Redefine beginning/end-of-buffer to perform forms-first/last-record
X when in forms mode.")
X
;;;
;;; Internal variables.
X
(defvar forms--file-buffer nil
X  "Buffer which holds the file data")
X
(defvar forms--total-records 0
X  "Total number of records in the data file.")
X
(defvar forms--current-record 0
X  "Number of the record currently on the screen.")
X
(defvar forms-mode-map nil		; yes - this one is global
X   "Keymap for form buffer.")
X
(defvar forms--markers nil
X  "Field markers in the screen.")
X
(defvar forms--number-of-markers 0
X  "Number of fields on screen.")
X
(defvar forms--the-record-list nil 
X   "List of strings of the current record, as parsed from the file.")
X
(defvar forms--search-regexp nil
X  "Last regexp used by forms-search.")
X
(defvar forms--format nil
X  "Formatting routine.")
X
(defvar forms--parser nil
X  "Forms parser routine.")
X
(defvar forms--mode-setup nil
X  "Internal - keeps track of forms-mode being set-up.")
(make-variable-buffer-local 'forms--mode-setup)
X
(defvar forms--new-record-filter nil
X  "Internal - set if a new record filter has been defined.")
X
;;;
;;; forms-mode
;;;
;;; This is not a simple major mode, as usual. Therefore, forms-mode
;;; takes an optional argument 'primary' which is used for the initial
;;; set-up. Normal use would leave 'primary' to nil.
;;;
;;; A global buffer-local variable 'forms--mode-setup' has the same effect
;;; but makes it possible to auto-invoke forms-mode using find-file.
;;;
;;; Note: although it seems logical to have (make-local-variable) executed
;;; where the variable is first needed, I deliberately placed all calls
;;; in the forms-mode function.
X 
(defun forms-mode (&optional primary)
X  "Major mode to visit files in a field-structured manner using a form.
X
X Commands (prefix with C-c if not in read-only mode):
X \\{forms-mode-map}"
X
X  (interactive)				; no - 'primary' is not prefix arg
X
X  ;; Primary set-up: evaluate buffer and check if the mandatory
X  ;; variables have been set.
X  (if (or primary (not forms--mode-setup))
X      (progn
X	(kill-all-local-variables)
X
X	;; make mandatory variables
X	(make-local-variable 'forms-file)
X	(make-local-variable 'forms-number-of-fields)
X	(make-local-variable 'forms-format-list)
X
X	;; make optional variables
X	(make-local-variable 'forms-field-sep)
X        (make-local-variable 'forms-read-only)
X        (make-local-variable 'forms-multi-line)
X	(make-local-variable 'forms-forms-scroll)
X	(make-local-variable 'forms-forms-jump)
X	(fmakunbound 'forms-new-record-filter)
X
X	;; eval the buffer, should set variables
X	(eval-current-buffer)
X
X	;; check if the mandatory variables make sense.
X	(or forms-file
X	    (error "'forms-file' has not been set"))
X	(or forms-number-of-fields
X	    (error "'forms-number-of-fields' has not been set"))
X	(or (> forms-number-of-fields 0)
X	    (error "'forms-number-of-fields' must be > 0")
X	(or (stringp forms-field-sep))
X	    (error "'forms-field-sep' is not a string"))
X	(if forms-multi-line
X	    (if (and (stringp forms-multi-line)
X		     (eq (length forms-multi-line) 1))
X		(if (string= forms-multi-line forms-field-sep)
X		    (error "'forms-multi-line' is equal to 'forms-field-sep'"))
X	      (error "'forms-multi-line' must be nil or a one-character string")))
X	    
X	;; validate and process forms-format-list
X	(make-local-variable 'forms--number-of-markers)
X	(make-local-variable 'forms--markers)
X	(forms--process-format-list)
X
X	;; build the formatter and parser
X	(make-local-variable 'forms--format)
X	(forms--make-format)
X	(make-local-variable 'forms--parser)
X	(forms--make-parser)
X
X	;; check if a new record filter was defined
X	(make-local-variable 'forms--new-record-filter)
X	(setq forms--new-record-filter 
X	      (and (fboundp 'forms-new-record-filter)
X		   (symbol-function 'forms-new-record-filter)))
X	(fmakunbound 'forms-new-record-filter)
X
X
X	;; prepare this buffer for further processing
X	(setq buffer-read-only nil)
X
X	;; prevent accidental overwrite of the control file and autosave
X	(setq buffer-file-name nil)
X	(auto-save-mode nil)
X
X	;; and clean it
X	(erase-buffer)))
X
X  ;; make local variables
X  (make-local-variable 'forms--file-buffer)
X  (make-local-variable 'forms--total-records)
X  (make-local-variable 'forms--current-record)
X  (make-local-variable 'forms--the-record-list)
X  (make-local-variable 'forms--search-rexexp)
X
X  ;; A bug in the current Emacs release prevents a keymap
X  ;; which is buffer-local from being used by 'describe-mode'.
X  ;; Hence we'll leave it global.
X  ;;(make-local-variable 'forms-mode-map)
X  (if forms-mode-map			; already defined
X      nil
X    (setq forms-mode-map (make-keymap))
X    (forms--mode-commands forms-mode-map)
X    (forms--change-commands))
X
X  ;; find the data file
X  (setq forms--file-buffer (find-file-noselect forms-file))
X
X  ;; count the number of records, and set see if it may be modified
X  (let (ro)
X    (setq forms--total-records
X	  (save-excursion
X	    (set-buffer forms--file-buffer)
X	    (bury-buffer (current-buffer))
X	    (setq ro buffer-read-only)
X	    (count-lines (point-min) (point-max))))
X    (if ro
X	(setq forms-read-only t)))
X
X  ;; set the major mode indicator
X  (setq major-mode 'forms-mode)
X  (setq mode-name "Forms")
X  (make-local-variable 'minor-mode-alist) ; needed?
X  (forms--set-minor-mode)
X  (forms--set-keymaps)
X
X  (set-buffer-modified-p nil)
X
X  ;; We have our own revert function - use it
X  (make-local-variable 'revert-buffer-function)
X  (setq revert-buffer-function 'forms-revert-buffer)
X
X  ;; setup the first (or current) record to show
X  (if (< forms--current-record 1)
X      (setq forms--current-record 1))
X  (forms-jump-record forms--current-record)
X
X  ;; user customising
X  (run-hooks 'forms-mode-hooks)
X
X  ;; be helpful
X  (forms--help)
X
X  ;; initialization done
X  (setq forms--mode-setup t))
X
;;;
;;; forms-process-format-list
;;;
;;; Validates forms-format-list.
;;;
;;; Sets forms--number-of-markers and forms--markers.
X
(defun forms--process-format-list ()
X  "Validate forms-format-list and set some global variables."
X
X  ;; it must be non-nil
X  (or forms-format-list
X      (error "'forms-format-list' has not been set"))
X  ;; it must be a list ...
X  (or (listp forms-format-list)
X      (error "'forms-format-list' is not a list"))
X
X  (setq forms--number-of-markers 0)
X
X  (let ((the-list forms-format-list)	; the list of format elements
X	(field-num 0))			; highest field number 
X
X    (while the-list
X
X      (let ((el (car-safe the-list))
X	    (rem (cdr-safe the-list)))
X
X	(cond
X
X	 ;; try string ...
X	 ((stringp el))			; string is OK
X	  
X	 ;; try int ...
X	 ((numberp el)			; check it
X
X	  (if (or (<= el 0)
X		  (> el forms-number-of-fields))
X	      (error
X	       "forms error: field number %d out of range 1..%d"
X	       el forms-number-of-fields))
X
X	  (setq forms--number-of-markers (1+ forms--number-of-markers))
X	  (if (> el field-num)
X	      (setq field-num el)))
X
X	 ;; else
X	 (t
X	  (error "invalid element in 'forms-format-list': %s"
X		 (prin1-to-string el)))
X
X	 ;; dead code - we'll need it in the future
X	 ((consp el)			; check it
X
X	  (let ((str (car-safe el))
X		(idx (cdr-safe el)))
X
X	    (cond
X
X	     ;; car must be string
X	     ((not (stringp str))
X	      (error "forms error: car of cons %s must be string"
X		     (prin1-to-string el)))
X
X	     ;; cdr must be number, > zero
X	     ((or (not (numberp idx))
X		  (<= idx 0)
X		  (> idx forms-number-of-fields))
X	      (error
X	       "forms error: cdr of cons %s must be a number between 1 and %d"
X	       (prin1-to-string el)
X	       forms-number-of-fields)))
X
X	    ;; passed the test - handle it
X	    (setq forms--number-of-markers (1+ forms--number-of-markers))
X	    (if (> idx field-num)
X		(setq field-num idx)))))
X
X	;; advance to next element of the list
X	(setq the-list rem))))
X
X  (setq forms--markers (make-vector forms--number-of-markers nil)))
X
X
;;;
;;; Build the format routine from forms-format-list.
;;;
;;; The format routine (forms--format) will look like
;;; 
;;; (lambda (arg)
;;;
;;;   ;;  "text: "
;;;   (insert "text: ")
;;;   ;;  6
;;;   (aset forms--markers 0 (point-marker))
;;;   (insert (elt arg 5))
;;;   ;;  "\nmore text: "
;;;   (insert "\nmore text: ")
;;;   ;;  9
;;;   (aset forms--markers 1 (point-marker))
;;;   (insert (elt arg 8))
;;;
;;;   ... )
;;; 
X
(defun forms--make-format ()
X  "Generate parser function for forms"
X  (setq forms--format (forms--format-maker forms-format-list)))
X
(defun forms--format-maker (the-format-list)
X  "Returns the parser function for forms"
X  (let ((the-marker 0))
X    (` (lambda (arg)
X	 (,@ (apply 'append
X		    (mapcar 'forms--make-format-elt 
X			    (forms--concat-adjacent the-format-list))))))))
X
(defun forms--make-format-elt (el)
X  (cond ((stringp el)
X	 (` ((insert (, el)))))
X	((numberp el)
X	 (prog1
X	     (` ((aset forms--markers (, the-marker) (point-marker))
X		 (insert (elt arg (, (1- el))))))
X	   (setq the-marker (1+ the-marker))))))
X
X
(defun forms--concat-adjacent (the-list)
X  "Concatenate adjacent strings in the-list and return the resulting list"
X  (if (consp the-list)
X      (let ((the-rest (forms--concat-adjacent (cdr the-list))))
X	(if (and (stringp (car the-list)) (stringp (car the-rest)))
X	    (cons (concat (car the-list) (car the-rest))
X		  (cdr the-rest))
X	    (cons (car the-list) the-rest)))
X      the-list))
;;;
;;; forms--make-parser.
;;;
;;; Generate parse routine from forms-format-list.
;;;
;;; The parse routine (forms--parser) will look like (give or take
;;; a few " " .
;;; 
;;; (lambda nil
;;;   (let (here)
;;;     (goto-char (point-min))
;;; 
;;;	;;  "text: "
;;;     (if (not (looking-at "text: "))
;;; 	    (error "parse error: cannot find \"text: \""))
SHAR_EOF
true || echo 'restore of forms.el failed'
fi
echo 'End of forms part 2'
echo 'File forms.el is continued in part 3'
echo 3 > _shar_seq_.tmp
exit 0
-- 
Johan Vromans				       jv@mh.nl via internet backbones
Multihouse Automatisering bv		       uucp: ..!{uunet,hp4nl}!mh.nl!jv
Doesburgweg 7, 2803 PL Gouda, The Netherlands  phone/fax: +31 1820 62911/62500
------------------------ "Arms are made for hugging" -------------------------