Function: semantic-tag-deep-copy-one-tag

semantic-tag-deep-copy-one-tag is a byte-compiled function defined in tag.el.gz.

Signature

(semantic-tag-deep-copy-one-tag TAG &optional FILTER)

Documentation

Make a deep copy of TAG, applying FILTER to each child-tag.

No properties are copied except for :filename. Overlay will be a vector. FILTER takes TAG as an argument, and should return a semantic-tag. It is safe for FILTER to modify the input tag and return it.

Source Code

;; Defined in /usr/src/emacs/lisp/cedet/semantic/tag.el.gz
;;; DEEP COPIES
;;
(defun semantic-tag-deep-copy-one-tag (tag &optional filter)
  "Make a deep copy of TAG, applying FILTER to each child-tag.
No properties are copied except for :filename.
Overlay will be a vector.
FILTER takes TAG as an argument, and should return a `semantic-tag'.
It is safe for FILTER to modify the input tag and return it."
  (when (not filter) (setq filter 'identity))
  (when (not (semantic-tag-p tag))
    (signal 'wrong-type-argument (list tag #'semantic-tag-p)))
  (let ((ol (semantic-tag-overlay tag))
	(fn (semantic-tag-file-name tag)))
    (funcall filter (list (semantic-tag-name tag)
			  (semantic-tag-class tag)
			  (semantic--tag-deep-copy-attributes
			   (semantic-tag-attributes tag) filter)
			  ;; Only copy the filename property
			  (when fn (list :filename fn))
			  ;; Only setup a vector if we had an overlay.
			  (when ol (vector (semantic-tag-start tag)
					   (semantic-tag-end tag)))))))