Function: semantic-cache-data-to-buffer
semantic-cache-data-to-buffer is a byte-compiled function defined in
fw.el.gz.
Signature
(semantic-cache-data-to-buffer BUFFER START END VALUE NAME &optional LIFESPAN)
Documentation
In BUFFER over the region START END, remember VALUE.
NAME specifies a special name that can be searched for later to
recover the cached data with semantic-get-cache-data.
LIFESPAN indicates how long the data cache will be remembered.
The default LIFESPAN is end-of-command.
Possible Lifespans are:
end-of-command - Remove the cache at the end of the currently
executing command.
exit-cache-zone - Remove when point leaves the overlay at the
end of the currently executing command.
Source Code
;; Defined in /usr/src/emacs/lisp/cedet/semantic/fw.el.gz
(defun semantic-cache-data-to-buffer (buffer start end value name &optional lifespan)
"In BUFFER over the region START END, remember VALUE.
NAME specifies a special name that can be searched for later to
recover the cached data with `semantic-get-cache-data'.
LIFESPAN indicates how long the data cache will be remembered.
The default LIFESPAN is `end-of-command'.
Possible Lifespans are:
`end-of-command' - Remove the cache at the end of the currently
executing command.
`exit-cache-zone' - Remove when point leaves the overlay at the
end of the currently executing command."
;; Check if LIFESPAN is valid before to create any overlay
(or lifespan (setq lifespan 'end-of-command))
(or (memq lifespan '(end-of-command exit-cache-zone))
(error "semantic-cache-data-to-buffer: Unknown LIFESPAN: %s"
lifespan))
(let ((o (make-overlay start end buffer)))
(overlay-put o 'cache-name name)
(overlay-put o 'cached-value value)
(overlay-put o 'lifespan lifespan)
(setq semantic-cache-data-overlays
(cons o semantic-cache-data-overlays))
;;(message "Adding to cache: %s" o)
(add-hook 'post-command-hook #'semantic-cache-data-post-command-hook)
))