Function: semantic-edits-splice-replace
semantic-edits-splice-replace is a byte-compiled function defined in
edit.el.gz.
Signature
(semantic-edits-splice-replace OLDTAG NEWTAG)
Documentation
Replace OLDTAG with NEWTAG in the current cache.
Do this by recycling OLDTAG's first CONS cell. This effectively causes the new tag to completely replace the old one. Make sure that all information in the overlay is transferred. It is presumed that OLDTAG and NEWTAG are both cooked. When this routine returns, OLDTAG is raw, and the data will be lost if not transferred into NEWTAG.
Source Code
;; Defined in /usr/src/emacs/lisp/cedet/semantic/edit.el.gz
(defun semantic-edits-splice-replace (oldtag newtag)
"Replace OLDTAG with NEWTAG in the current cache.
Do this by recycling OLDTAG's first CONS cell. This effectively
causes the new tag to completely replace the old one.
Make sure that all information in the overlay is transferred.
It is presumed that OLDTAG and NEWTAG are both cooked.
When this routine returns, OLDTAG is raw, and the data will be
lost if not transferred into NEWTAG."
(let* ((oo (semantic-tag-overlay oldtag))
(o (semantic-tag-overlay newtag))
(oo-props (overlay-properties oo)))
(while oo-props
(overlay-put o (car oo-props) (car (cdr oo-props)))
(setq oo-props (cdr (cdr oo-props)))
)
;; Free the old overlay(s)
(semantic--tag-unlink-from-buffer oldtag)
;; Recover properties
(semantic--tag-copy-properties oldtag newtag)
;; Splice into the main list.
(setcdr oldtag (cdr newtag))
(setcar oldtag (car newtag))
;; This important bit is because the CONS cell representing
;; OLDTAG is now pointing to NEWTAG, but the NEWTAG
;; cell is about to be abandoned. Here we update our overlay
;; to point at the updated state of the world.
(overlay-put o 'semantic oldtag)
))