Function: srecode--insert-into-buffer
srecode--insert-into-buffer is a byte-compiled function defined in
insert.el.gz.
Signature
(srecode--insert-into-buffer TEMPLATE DICTIONARY)
Documentation
Insert a TEMPLATE with DICTIONARY into a buffer.
Do not call this function yourself. Instead use:
srecode-insert - Inserts by name.
srecode-insert-fcn - Insert with objects.
This function handles the case from one of the above functions when
the template is inserted into a buffer. It looks
at srecode-insert-ask-variable-method to decide if unbound dictionary
entries ask questions or insert editable fields.
Buffer based features related to change hooks is handled one level up.
Source Code
;; Defined in /usr/src/emacs/lisp/cedet/srecode/insert.el.gz
(defun srecode--insert-into-buffer (template dictionary)
"Insert a TEMPLATE with DICTIONARY into a buffer.
Do not call this function yourself. Instead use:
`srecode-insert' - Inserts by name.
`srecode-insert-fcn' - Insert with objects.
This function handles the case from one of the above functions when
the template is inserted into a buffer. It looks
at `srecode-insert-ask-variable-method' to decide if unbound dictionary
entries ask questions or insert editable fields.
Buffer based features related to change hooks is handled one level up."
;; This line prevents the field archive from being let bound
;; while the field insert tool is loaded via autoloads during
;; the insert.
(when (eq srecode-insert-ask-variable-method 'field)
(require 'srecode/fields))
(let ((srecode-field-archive nil) ; Prevent field leaks during insert
(start (point)) ; Beginning of the region.
)
;; This sub-let scopes the 'in-progress' piece so we know
;; when to setup the end-template.
(let ((srecode-insert-with-fields-in-progress
(if (eq srecode-insert-ask-variable-method 'field) t nil))
)
(srecode-insert-method template dictionary)
)
;; If we are not in-progress, and we insert fields, then
;; create the end-template with fields editable area.
(when (and (not srecode-insert-with-fields-in-progress)
(eq srecode-insert-ask-variable-method 'field) ; Only if user asked
srecode-field-archive ; Only if there were fields created
)
(let ((reg
;; Create the field-driven editable area.
(srecode-template-inserted-region :start start :end (point))))
(srecode-overlaid-activate reg))
)
;; We return with 'point being the end of the template insertion
;; area. Return value is not important.
))