;ELC   
;;; compiled by sit@bart-savagewood.mit.edu on Mon Jun  3 14:44:00 1996
;;; from file /afs/sipb/contrib/emacs/elisp19/tempo.el
;;; emacs version 19.30.1.
;;; bytecomp version FSF 2.10
;;; optimization is on.
;;; this file uses opcodes which do not exist in Emacs 18.

(if (and (boundp 'emacs-version)
	 (or (and (boundp 'epoch::version) epoch::version)
	     (string-lessp emacs-version "19.29")))
    (error "`tempo.el' was compiled for Emacs 19.29 or later"))


#@137 *Prompt user for strings in templates.
If this variable is non-nil, `tempo-insert' prompts the
user for text to insert in the templates
(defvar tempo-interactive nil (#$ . -479))
#@328 *Automatically insert current region when there is a `r' in the template
If this variable is NIL, `r' elements will be treated just like `p'
elements, unless the template function is given a prefix (or a non-nil
argument). If this variable is non-NIL, the behaviour is reversed.

In Transient Mark mode, this option is unused.
(defvar tempo-insert-region nil (#$ . -665))
#@99 *If non-NIL, show a buffer with possible completions, when only
a partial completion can be found
(defvar tempo-show-completion-buffer t (#$ . -1043))
#@129 *If NIL, a completion buffer generated by \[tempo-complete-tag]
disappears at the next keypress; otherwise, it remains forever.
(defvar tempo-leave-completion-buffer nil (#$ . -1201))
#@102 List of functions to run when inserting a string.
Each function is called with a single arg, STRING.
(defvar tempo-insert-string-functions nil (#$ . 1392))
#@59 An association list with tags and corresponding templates
(defvar tempo-tags nil (#$ . 1554))
#@379 A list of locally installed tag completion lists.
It is a association list where the car of every element is a symbol
whose varable value is a template list. The cdr part, if non-nil, is a
function or a regexp that defines the string to match. See the
documentation for the function `tempo-complete-tag' for more info.

`tempo-tags' is always in the last position in this list.
(defvar tempo-local-tags (quote ((tempo-tags))) (#$ . 1655))
#@62 A collection of all the tags defined for the current buffer.
(defvar tempo-collection nil (#$ . 2100))
#@54 Indicates if the tag collection needs to be rebuilt.
(defvar tempo-dirty-collection t (#$ . 2209))
#@87 A list of marks to jump to with `\[tempo-forward-mark]' and `\[tempo-backward-mark]'.
(defvar tempo-marks nil (#$ . 2314))
#@860 The regexp or function used to find the string to match against tags.

If `tempo-match-finder is a string, it should contain a regular
expression with at least one \( \) pair. When searching for tags,
`tempo-complete-tag' calls `re-search-backward' with this string, and
the string between the first \( and \) is used for matching against
each string in the tag list. If one is found, the whole text between
the first \( and the point is replaced with the inserted template.

You will probably want to include \ = at the end of the regexp to
make sure that the string is matched only against text adjacent to the
point.

If `tempo-match-finder' is a symbol, it should be a function that
returns a pair of the form (STRING . POS), where STRING is the string
used for matching and POS is the buffer position after which text
should be replaced with a template.
(defvar tempo-match-finder "\\b\\([^\\b]+\\)\\=" (#$ . 2444))
#@231 Element handlers for user-defined elements.
A list of symbols which are bound to functions that take one argument.
This function should return somthing to be sent to `tempo-insert' if
it recognizes the argument, and NIL otherwise
(defvar tempo-user-elements nil (#$ . 3372))
#@40 Temporary storage for named insertions
(defvar tempo-named-insertions nil (#$ . 3653))
#@47 Region start when inserting around the region
(defvar tempo-region-start (make-marker) (#$ . 3746))
#@46 Region stop when inserting around the region
(defvar tempo-region-stop (make-marker) (#$ . 3852))
(byte-code "ÀÁ!ˆÀÂ!ˆÀÃ!ˆÀÄ!ˆÀÅ!‡" [make-variable-buffer-local tempo-marks tempo-local-tags tempo-match-finder tempo-collection tempo-dirty-collection] 2)
#@2235 Define a template.
This function creates a template variable `tempo-template-NAME' and an
interactive function `tempo-template-NAME' that inserts the template
at the point.  The created function is returned.

NAME is a string that contains the name of the template, ELEMENTS is a
list of elements in the template, TAG is the tag used for completion,
DOCUMENTATION is the documentation string for the insertion command
created, and TAGLIST (a symbol) is the tag list that TAG (if provided)
should be added to).  If TAGLIST is nil and TAG is non-nil, TAG is
added to `tempo-tags'

The elements in ELEMENTS can be of several types:

 - A string. It is sent to the hooks in `tempo-insert-string-functions',
   and the result is inserted.
 - The symbol 'p. This position is saved in `tempo-marks'.
 - The symbol 'r. If `tempo-insert' is called with ON-REGION non-nil
   the current region is placed here. Otherwise it works like 'p.
 - (p PROMPT <NAME>) If `tempo-interactive' is non-nil, the user is
   prompted in the minbuffer with PROMPT for a string to be inserted.
   If the optional parameter NAME is non-nil, the text is saved for
   later insertion with the `s' tag.
   If `tempo-interactive' is nil, it works like 'p.
 - (r PROMPT) like the previous, but if `tempo-interactive' is nil
   and `tempo-insert' is called with ON-REGION non-nil, the current
   region is placed here. This usually happens when you call the
   template function with a prefix argument.
 - (s NAME) Inserts text previously read with the (p ..) construct.
   Finds the insertion saved under NAME and inserts it. Acts like 'p
   if tempo-interactive is nil.
 - '& If there is only whitespace between the line start and point,
   nothing happens. Otherwise a newline is inserted.
 - '% If there is only whitespace between point and end-of-line
   nothing happens. Otherwise a newline is inserted.
 - 'n inserts a newline.
 - '> The line is indented using `indent-according-to-mode'. Note that
   you often should place this item after the text you want on the
   line.
 - 'n> Inserts a newline and indents line.
 - 'o Like '% but leaves the point before the newline.
 - nil. It is ignored.
 - Anything else. It is evaluated and the result is parsed again.
(defalias 'tempo-define-template #[(name elements &optional tag documentation taglist) "ÀÁ\nP!‰Lˆ\fÆÇÈD	† Ê\nËQÌÍDÎÏDÐÑÒÈDÈFE¯Mˆƒ: Ô#ˆ\f*‡" [intern "tempo-template-" name template-name command-name elements lambda &optional arg documentation "Insert a " "." interactive "*P" tempo-insert-template quote if tempo-insert-region not tag tempo-add-tag taglist] 12 (#$ . 4112)])
#@228 Insert a template.
TEMPLATE is the template to be inserted.  If ON-REGION is non-nil the
`r' elements are replaced with the current region. In Transient Mark
mode, ON-REGION is ignored and assumed true if the region is active.
(defalias 'tempo-insert-template #[(template on-region) "ÀÁ!ƒ 	ƒ \nƒ Ã\fƒ' Æ `^Ç“ƒ' Æ `]Ç“ˆ\fƒ. bˆŠÉÊ !ˆËÌJ\"ˆÉÊ !ˆ)Î ˆÏ ˆÀÁ!…Z 	…Z 	…Z ÇÐÑ!‡" [boundp transient-mark-mode mark-active t on-region tempo-region-start mark nil tempo-region-stop tempo-insert-mark point-marker mapcar #[(elt) "À	\n\"‡" [tempo-insert elt on-region] 3] template tempo-forward-mark tempo-forget-insertions run-hooks deactivate-mark-hook] 3 (#$ . 6742)])
#@225 Insert a template element.
Insert one element from a template. If ON-REGION is non-nil the `r'
elements are replaced with the current region.

See documentation for `tempo-define-template' for the kind of elements
possible.
(defalias 'tempo-insert #[(element on-region) ";ƒ	 Á!‡:ƒ @Â=ƒ ÃA!‡:ƒ3 @Ä=ƒ3 ƒ. b‡ÃA!‡:ƒN @Ç=ƒN ƒI ÉA!‡ÊË !‡:ƒ` @Ì=ƒ` ÍÎA\"‡Â=ƒk ÊË !‡Ä=ƒ~ ƒy b‡ÊË !‡Ï=ƒ˜ ƒ“ bˆÐÑ `Ò#‡ÊË !‡Ó=ƒ¡ Ô ‡Õ=ƒ» iÖU†´ Š×ØÒÙ#)?…Úc‡Û=ƒÓ l†Ì ŠÜÝÒÙ#)?…Úc‡Þ=ƒÜ Úc‡ß=ƒè ÚcˆÔ ‡à=ƒ†ý l†ý ŠÜÝÒÙ#)?…áâ!‡?†ãä!†å!\"‡" [element tempo-process-and-insert-string p tempo-insert-prompt r on-region tempo-region-stop s tempo-interactive tempo-insert-named tempo-insert-mark point-marker l mapcar #[(elt) "À	\n\"‡" [tempo-insert elt on-region] 3] r> indent-region mark nil > indent-according-to-mode & 0 re-search-backward "^\\s-*\\=" t "\n" % re-search-forward "\\=\\s-*$" n n> o open-line 1 tempo-insert tempo-is-user-element eval] 4 (#$ . 7416)])
#@397 Prompt for a text string and insert it in the current buffer.
If the variable `tempo-interactive' is non-nil the user is prompted
for a string in the minibuffer, which is then inserted in the current
buffer. If `tempo-interactive' is nil, the current point is placed on
`tempo-mark'.

PROMPT is the prompt string or a list containing the prompt string and
a name to save the inserted text under.
(defalias 'tempo-insert-prompt #[(prompt) "ƒ, 	<ƒ 	@‚ 		<… 	A@ÂÆ!‰cˆ\f…* Ç\f\"+‡ÈÉ !‡" [tempo-interactive prompt nil inserted-text save-name prompt-string read-string tempo-remember-insertion tempo-insert-mark point-marker] 4 (#$ . 8402)])
#@70 Tries all the user-defined element handlers in
`tempo-user-elements'
(defalias 'tempo-is-user-element #[(element) "ÀÁ‡" [found (byte-code "ÀÁ\n\"ˆÃÄÅ\"‡" [mapcar #[(handler) "	!‰…\f ÃÄ\n\")‡" [handler element result throw found] 4] tempo-user-elements throw found nil] 3)] 2 (#$ . 9054)])
#@71 Save the text in STRING under the name SAVE-NAME for later retrieval.
(defalias 'tempo-remember-insertion #[(save-name string) "	B\nB‰‡" [save-name string tempo-named-insertions] 2 (#$ . 9352)])
#@40 Forget all the saved named insertions.
(defalias 'tempo-forget-insertions #[nil "À‰‡" [nil tempo-named-insertions] 2 (#$ . 9555)])
#@100 Insert the previous insertion saved under a named specified in ELT.
The name is in the car of ELT.
(defalias 'tempo-insert-named #[(elt) "@‰\nžA‰ƒ c‚ ÄÅ!*‡" [elt name tempo-named-insertions insertion error "Named insertion not found"] 3 (#$ . 9694)])
#@132 Insert a string from a template.
Run a string through the preprocessors in `tempo-insert-string-functions'
and insert the results.
(defalias 'tempo-process-and-insert-string #[(string) "ƒ$ 9ƒ Á\nC\"‚$ <ƒ ÃÄ\"ˆ‚$ ÅÆ\"ˆ\nc‡" [tempo-insert-string-functions apply string mapcar #[(fn) "À	\n\"‰‡" [apply fn string] 3] error "Bogus value in tempo-insert-string-functions: %s"] 3 (#$ . 9958)])
#@53 Insert a mark `tempo-marks' while keeping it sorted
(defalias 'tempo-insert-mark #[(mark) "„	 	C‰‡	@Wƒ 	B‰‡‰Aƒ, \nA@	Xƒ, \nA‰‚ 	\n@U?…: \n	\nAB¡)‡" [tempo-marks mark lp] 4 (#$ . 10361)])
#@53 Jump to the next mark in `tempo-forward-mark-list'.
(defalias 'tempo-forward-mark #[nil "ÀÁ‰…\n \nb)‡" [found (byte-code "ÀÁ\n\"ˆÃ‡" [mapcar #[(mark) "`W…\n ÁÂ\"‡" [mark throw found] 3] tempo-marks nil] 3) next-mark] 3 (#$ . 10564) nil])
#@54 Jump to the previous mark in `tempo-back-mark-list'.
(defalias 'tempo-backward-mark #[nil "ÀÁ‰…\n \nb)‡" [found (byte-code "ÀÂÃ\f\"ˆ	)‡" [nil last mapcar #[(mark) "`Xƒ ÁÂ\"ˆ‰‡" [mark throw found last] 3] tempo-marks] 3) prev-mark] 3 (#$ . 10812) nil])
#@131 Add a template tag.
Add the TAG, that should complete to TEMPLATE to the list in TAG-LIST,
or to `tempo-tags' if TAG-LIST is nil.
(defalias 'tempo-add-tag #[(tag template &optional tag-list) "„ ÁÂJ\"„ \fBJBLˆÅ ‡" [tag-list tempo-tags assoc tag template tempo-invalidate-collection] 3 (#$ . 11079) "sTag: \nCTemplate: "])
#@490 Install TAG-LIST to be used for template completion in the current buffer.
TAG-LIST is a symbol whose variable value is a tag list created with
`tempo-add-tag'.

COMPLETION-FUNCTION is an obsolete option for specifyingis an optional
function or string that is used by `\[tempo-complete-tag]' to find a
string to match the tag against. It has the same definition as the
variable `tempo-match-finder'. In this version, supplying a
COMPLETION-FUNCTION just sets `tempo-match-finder' locally.
(defalias 'tempo-use-tag-list #[(tag-list &optional completion-function) "	ž‰ƒ \n¡ˆ‚ B	B)ƒ Å ‡" [tag-list tempo-local-tags old completion-function tempo-match-finder tempo-invalidate-collection] 3 (#$ . 11416)])
#@87 Marks the tag collection as obsolete.
Whenever it is needed again it will be rebuilt.
(defalias 'tempo-invalidate-collection #[nil "À‰‡" [t tempo-dirty-collection] 2 (#$ . 12135)])
#@117 Build a collection of all the tags and return it.
If `tempo-dirty-collection' is NIL, the old collection is reused.
(defalias 'tempo-build-collection #[nil "À\n„\n † ÄÅÆÇ\"\"‰‡" [nil tempo-dirty tempo-dirty-collection tempo-collection apply append mapcar #[(tag-list) "À	@!‡" [eval tag-list] 2] tempo-local-tags] 5 (#$ . 12324)])
#@107 Find a string to be matched against a tag list.
FINDER is a function or a string. Returns (STRING . POS).
(defalias 'tempo-find-match-string #[(finder) ";ƒ ŠÁÂÃ#ˆ)Ä”Ä•{Ä”B‡ ‡" [finder re-search-backward nil t 1] 4 (#$ . 12667)])
#@615 Look for a tag and expand it.
All the tags in the tag lists in `tempo-local-tags' (this includes
`tempo-tags') are searched for a match for the text before the point.
The way the string to match for is determined can be altered with the
variable `tempo-match-finder'

If a single match is found, the corresponding template is expanded in
place of the matching string.

If a partial completion or no match at all is found, and SILENT is
non-NIL, the function will give a signal.

If a partial completion is found and `tempo-show-completion-buffer' is
non-NIL, a buffer containing possible completions is displayed.
(defalias 'tempo-complete-tag #[(&optional silent) "À Â!‰@\fAÇ	\"‰@† É	\"‰\nƒ( `|ˆ\n„7 †r Ì ‚r \nÍ=ƒI ÎÇ	\"AÏ\"‚r Ç\n	\"‰ƒ] ÎAÏ\"‚r \ncˆ„i Ì ˆ…r Ñ	\".‡" [tempo-build-collection collection tempo-find-match-string tempo-match-finder match-info match-string match-start assoc exact try-completion compl silent ding t tempo-insert-template nil tempo-show-completion-buffer tempo-display-completions] 5 (#$ . 12907) "*"])
#@59 Show a buffer containing possible completions for STRING.
(defalias 'tempo-display-completions #[(string tag-list) "ƒ ÁÂÃ\f\"!‘‡Æ‹‡" [tempo-leave-completion-buffer "*Completions*" display-completion-list all-completions string tag-list ((byte-code "ÀÁÂ\f\"!‘ˆÅÆ!‡" ["*Completions*" display-completion-list all-completions string tag-list sit-for 32767] 5))] 5 (#$ . 13975)])
(provide (quote tempo))
