(semantic-clear-parser-warnings)
;; Nuke all semantic overlays. This is faster than deleting based
;; on our data structure.
- (let ((l (semantic-overlay-lists)))
+ (let ((l (overlay-lists)))
(mapc 'semantic-delete-overlay-maybe (car l))
(mapc 'semantic-delete-overlay-maybe (cdr l))
)
(defun semantic-completion-inline-active-p ()
"Non-nil if inline completion is active."
(when (and semantic-complete-inline-overlay
- (not (semantic-overlay-live-p semantic-complete-inline-overlay)))
- (semantic-overlay-delete semantic-complete-inline-overlay)
+ (not (overlay-buffer semantic-complete-inline-overlay)))
+ (delete-overlay semantic-complete-inline-overlay)
(setq semantic-complete-inline-overlay nil))
semantic-complete-inline-overlay)
(defun semantic-complete-inline-text ()
"Return the text that is being completed inline.
Similar to `minibuffer-contents' when completing in the minibuffer."
- (let ((s (semantic-overlay-start semantic-complete-inline-overlay))
- (e (semantic-overlay-end semantic-complete-inline-overlay)))
+ (let ((s (overlay-start semantic-complete-inline-overlay))
+ (e (overlay-end semantic-complete-inline-overlay)))
(if (= s e)
""
(buffer-substring-no-properties s e ))))
(defun semantic-complete-inline-delete-text ()
"Delete the text currently being completed in the current buffer."
(delete-region
- (semantic-overlay-start semantic-complete-inline-overlay)
- (semantic-overlay-end semantic-complete-inline-overlay)))
+ (overlay-start semantic-complete-inline-overlay)
+ (overlay-end semantic-complete-inline-overlay)))
(defun semantic-complete-inline-done ()
"This completion thing is DONE, OR, insert a newline."
(semantic-displayor-cleanup semantic-completion-display-engine))
(when semantic-complete-inline-overlay
- (let ((wc (semantic-overlay-get semantic-complete-inline-overlay
+ (let ((wc (overlay-get semantic-complete-inline-overlay
'window-config-start))
- (buf (semantic-overlay-buffer semantic-complete-inline-overlay))
+ (buf (overlay-buffer semantic-complete-inline-overlay))
)
- (semantic-overlay-delete semantic-complete-inline-overlay)
+ (delete-overlay semantic-complete-inline-overlay)
(setq semantic-complete-inline-overlay nil)
;; DONT restore the window configuration if we just
;; switched windows!
;;(message "Inline Hook installed, but overlay deleted.")
(semantic-complete-inline-exit))
;; Exit if commands caused us to exit the area of interest
- (let ((os (semantic-overlay-get semantic-complete-inline-overlay 'semantic-original-start))
- (s (semantic-overlay-start semantic-complete-inline-overlay))
- (e (semantic-overlay-end semantic-complete-inline-overlay))
- (b (semantic-overlay-buffer semantic-complete-inline-overlay))
+ (let ((os (overlay-get semantic-complete-inline-overlay 'semantic-original-start))
+ (s (overlay-start semantic-complete-inline-overlay))
+ (e (overlay-end semantic-complete-inline-overlay))
+ (b (overlay-buffer semantic-complete-inline-overlay))
(txt nil)
)
(cond
semantic-completion-display-engine displayor)
;; Create an overlay
(setq semantic-complete-inline-overlay
- (semantic-make-overlay start end buffer nil t))
- (semantic-overlay-put semantic-complete-inline-overlay
- 'face
- 'semantic-complete-inline-face)
- (semantic-overlay-put semantic-complete-inline-overlay
- 'window-config-start
- (current-window-configuration))
+ (make-overlay start end buffer nil t))
+ (overlay-put semantic-complete-inline-overlay
+ 'face
+ 'semantic-complete-inline-face)
+ (overlay-put semantic-complete-inline-overlay
+ 'window-config-start
+ (current-window-configuration))
;; Save the original start. We need to exit completion if START
;; moves.
- (semantic-overlay-put semantic-complete-inline-overlay
- 'semantic-original-start start)
+ (overlay-put semantic-complete-inline-overlay
+ 'semantic-original-start start)
;; Install our command hooks
(add-hook 'pre-command-hook 'semantic-complete-pre-command-hook)
(add-hook 'post-command-hook 'semantic-complete-post-command-hook)
(cl-defmethod semantic-displayor-cleanup ((obj semantic-displayor-ghost))
"Clean up any mess this displayor may have."
(when (slot-boundp obj 'ghostoverlay)
- (semantic-overlay-delete (oref obj ghostoverlay)))
+ (delete-overlay (oref obj ghostoverlay)))
)
(cl-defmethod semantic-displayor-set-completions ((obj semantic-displayor-ghost)
;; Display the focus completion as ghost text after the current
;; inline text.
(when (or (not (slot-boundp obj 'ghostoverlay))
- (not (semantic-overlay-live-p (oref obj ghostoverlay))))
+ (not (overlay-buffer (oref obj ghostoverlay))))
(oset obj ghostoverlay
- (semantic-make-overlay (point) (1+ (point)) (current-buffer) t)))
+ (make-overlay (point) (1+ (point)) (current-buffer) t)))
(let* ((lp (semantic-completion-text))
(os (substring (semantic-tag-name tag) (length lp)))
(put-text-property 0 (length os) 'face 'region os)
- (semantic-overlay-put
+ (overlay-put
ol 'display (concat os (buffer-substring (point) (1+ (point)))))
)
;; Calculate text difference between contents and the focus item.
(defun semanticdb-table-oob-sanity-check (cache)
"Validate that CACHE tags do not have any overlays in them."
(while cache
- (when (semantic-overlay-p (semantic-tag-overlay cache))
+ (when (overlayp (semantic-tag-overlay cache))
(message "Tag %s has an erroneous overlay!"
(semantic-format-tag-summarize (car cache))))
(semanticdb-table-oob-sanity-check
(let ((table (cond ((null path)
semanticdb-current-table)
((bufferp path)
- (semantic-buffer-local-value 'semanticdb-current-table path))
+ (buffer-local-value 'semanticdb-current-table path))
((and (stringp path) (file-exists-p path))
(semanticdb-file-table-object path t))
((cl-typep path 'semanticdb-abstract-table)
;; I know it is the first symbol appearing in the body of this token.
(goto-char (semantic-tag-start nt))
- (setq o (semantic-make-overlay (point) (progn (forward-sexp 1) (point))))
- (semantic-overlay-put o 'face 'highlight)
+ (setq o (make-overlay (point) (progn (forward-sexp 1) (point))))
+ (overlay-put o 'face 'highlight)
(object-add-to-list iface 'overlays o)
- (semantic-debug-set-parser-location iface (semantic-overlay-start o))
+ (semantic-debug-set-parser-location iface (overlay-start o))
(when (and rule match)
(setq match (1- match)))
;; Now highlight the thingy we find there.
- (setq o (semantic-make-overlay (point) (progn (forward-sexp 1) (point))))
- (semantic-overlay-put o 'face 'highlight)
+ (setq o (make-overlay (point) (progn (forward-sexp 1) (point))))
+ (overlay-put o 'face 'highlight)
(object-add-to-list iface 'overlays o)
;; If we have a match for a sub-rule, have the parser position
;; move so we can see it in the output window for very long rules.
- (semantic-debug-set-parser-location iface (semantic-overlay-start o))
+ (semantic-debug-set-parser-location iface (overlay-start o))
))))
(cl-defmethod semantic-debug-unhighlight ((iface semantic-debug-interface))
"Remove all debugging overlays."
- (mapc 'semantic-overlay-delete (oref iface overlays))
+ (mapc #'delete-overlay (oref iface overlays))
(oset iface overlays nil))
;; Call from the parser at a breakpoint
"Specify that TAG should be highlighted.
Optional FACE specifies the face to use."
(let ((o (semantic-tag-overlay tag)))
- (semantic-overlay-put o 'old-face
- (cons (semantic-overlay-get o 'face)
- (semantic-overlay-get o 'old-face)))
- (semantic-overlay-put o 'face (or face 'semantic-tag-highlight-face))
- ))
+ (overlay-put o 'old-face
+ (cons (overlay-get o 'face)
+ (overlay-get o 'old-face)))
+ (overlay-put o 'face (or face 'semantic-tag-highlight-face))))
(defun semantic-unhighlight-tag (tag)
"Unhighlight TAG, restoring its previous face."
(let ((o (semantic-tag-overlay tag)))
- (semantic-overlay-put o 'face (car (semantic-overlay-get o 'old-face)))
- (semantic-overlay-put o 'old-face (cdr (semantic-overlay-get o 'old-face)))
+ (overlay-put o 'face (car (overlay-get o 'old-face)))
+ (overlay-put o 'old-face (cdr (overlay-get o 'old-face)))
))
;;; Momentary Highlighting - One line
Optional argument FACE is the face to use for highlighting.
If FACE is not specified, then `highlight' will be used."
(when (semantic-tag-with-position-p tag)
- (if (not (semantic-overlay-p (semantic-tag-overlay tag)))
+ (if (not (overlayp (semantic-tag-overlay tag)))
;; No overlay, but a position. Highlight the first line only.
(semantic-momentary-highlight-one-tag-line tag face)
;; The tag has an overlay, highlight the whole thing
(defun semantic-set-tag-face (tag face)
"Specify that TAG should use FACE for display."
- (semantic-overlay-put (semantic-tag-overlay tag) 'face face))
+ (overlay-put (semantic-tag-overlay tag) 'face face))
(defun semantic-set-tag-invisible (tag &optional visible)
"Enable the text in TAG to be made invisible.
If VISIBLE is non-nil, make the text visible."
- (semantic-overlay-put (semantic-tag-overlay tag) 'invisible
- (not visible)))
+ (overlay-put (semantic-tag-overlay tag) 'invisible
+ (not visible)))
(defun semantic-tag-invisible-p (tag)
"Return non-nil if TAG is invisible."
- (semantic-overlay-get (semantic-tag-overlay tag) 'invisible))
+ (overlay-get (semantic-tag-overlay tag) 'invisible))
(defun semantic-overlay-signal-read-only
(overlay after start end &optional len)
Argument OVERLAY, AFTER, START, END, and LEN are passed in by the system."
;; Stolen blithely from cpp.el in Emacs 21.1
(if (and (not after)
- (or (< (semantic-overlay-start overlay) start)
- (> (semantic-overlay-end overlay) end)))
+ (or (< (overlay-start overlay) start)
+ (> (overlay-end overlay) end)))
(error "This text is read only")))
(defun semantic-set-tag-read-only (tag &optional writable)
Optional argument WRITABLE should be non-nil to make the text writable
instead of read-only."
(let ((o (semantic-tag-overlay tag))
- (hook (if writable nil '(semantic-overlay-signal-read-only))))
- (semantic-overlay-put o 'modification-hooks hook)
- (semantic-overlay-put o 'insert-in-front-hooks hook)
- (semantic-overlay-put o 'insert-behind-hooks hook)))
+ (hook (if writable nil '(overlay-signal-read-only))))
+ (overlay-put o 'modification-hooks hook)
+ (overlay-put o 'insert-in-front-hooks hook)
+ (overlay-put o 'insert-behind-hooks hook)))
(defun semantic-tag-read-only-p (tag)
"Return non-nil if the current TAG is marked read only."
(let ((o (semantic-tag-overlay tag)))
(member 'semantic-overlay-signal-read-only
- (semantic-overlay-get o 'modification-hooks))))
+ (overlay-get o 'modification-hooks))))
;;; Secondary overlays
;;
nil
(let* ((os (semantic-tag-start tag))
(oe (semantic-tag-end tag))
- (o (semantic-make-overlay os oe (semantic-tag-buffer tag) t))
+ (o (make-overlay os oe (semantic-tag-buffer tag) t))
(attr (semantic-tag-secondary-overlays tag))
)
(semantic--tag-put-property tag 'secondary-overlays (cons o attr))
- (semantic-overlay-put o 'semantic-secondary t)
- (semantic-overlay-put o 'semantic-link-hook link-hook)
+ (overlay-put o 'semantic-secondary t)
+ (overlay-put o 'semantic-link-hook link-hook)
(semantic-tag-add-hook tag 'link-hook 'semantic--tag-link-secondary-overlays)
(semantic-tag-add-hook tag 'unlink-hook 'semantic--tag-unlink-secondary-overlays)
(semantic-tag-add-hook tag 'unlink-copy-hook 'semantic--tag-unlink-copy-secondary-overlays)
(let* ((olsearch (semantic-tag-secondary-overlays tag))
(o nil))
(while olsearch
- (when (semantic-overlay-get (car olsearch) property)
+ (when (overlay-get (car olsearch) property)
(setq o (cons (car olsearch) o)))
(setq olsearch (cdr olsearch)))
o))
If OVERLAY-OR-PROPERTY is an overlay, delete that overlay.
If OVERLAY-OR-PROPERTY is a symbol, find the overlay with that property."
(let* ((o overlay-or-property))
- (if (semantic-overlay-p o)
+ (if (overlayp o)
(setq o (list o))
(setq o (semantic-tag-get-secondary-overlay tag overlay-or-property)))
- (while (semantic-overlay-p (car o))
+ (while (overlayp (car o))
;; We don't really need to worry about the hooks.
;; They will clean themselves up eventually ??
(semantic--tag-put-property
tag 'secondary-overlays
(delete (car o) (semantic-tag-secondary-overlays tag)))
- (semantic-overlay-delete (car o))
+ (delete-overlay (car o))
(setq o (cdr o)))))
(defun semantic--tag-unlink-copy-secondary-overlays (tag)
(let ((ol (semantic-tag-secondary-overlays tag))
(nl nil))
(while ol
- (if (semantic-overlay-get (car ol) 'semantic-link-hook)
+ (if (overlay-get (car ol) 'semantic-link-hook)
;; Only put in a proxy if there is a link-hook. If there is no link-hook
;; the decorating mode must know when tags are unlinked on its own.
- (setq nl (cons (semantic-overlay-get (car ol) 'semantic-link-hook)
+ (setq nl (cons (overlay-get (car ol) 'semantic-link-hook)
nl))
;; Else, remove all traces of ourself from the tag
;; Note to self: Does this prevent multiple types of secondary
(semantic-tag-remove-hook tag 'unlink-hook 'semantic--tag-unlink-secondary-overlays)
(semantic-tag-remove-hook tag 'unlink-copy-hook 'semantic--tag-unlink-copy-secondary-overlays)
)
- (semantic-overlay-delete (car ol))
+ (delete-overlay (car ol))
(setq ol (cdr ol)))
(semantic--tag-put-property tag 'secondary-overlays (nreverse nl))
))
;; Add the foldn
(setq o (semantic-tag-create-secondary-overlay tag))
;; mark as folded
- (semantic-overlay-put o 'semantic-folded t)
+ (overlay-put o 'semantic-folded t)
;; Move to cover end of tag
(save-excursion
(goto-char (semantic-tag-start tag))
(end-of-line)
- (semantic-overlay-move o (point) (semantic-tag-end tag)))
+ (move-overlay o (point) (semantic-tag-end tag)))
;; We need to modify the invisibility spec for this to
;; work.
(if (or (eq buffer-invisibility-spec t)
(not (assoc 'semantic-fold buffer-invisibility-spec)))
(add-to-invisibility-spec '(semantic-fold . t)))
- (semantic-overlay-put o 'invisible 'semantic-fold)
+ (overlay-put o 'invisible 'semantic-fold)
(overlay-put o 'isearch-open-invisible
- 'semantic-set-tag-folded-isearch)))
- ))
+ 'semantic-set-tag-folded-isearch)))))
(declare-function semantic-current-tag "semantic/find")
(let ((ol (semantic-decorate-tag tag
(semantic-tag-start tag)
(semantic-tag-end tag)
- face))
- )
- (semantic-overlay-put ol 'mouse-face 'highlight)
- (semantic-overlay-put ol 'keymap map)
- (semantic-overlay-put ol 'help-echo
- "Header File : mouse-3 - Context menu")
- ))))
+ face)))
+ (overlay-put ol 'mouse-face 'highlight)
+ (overlay-put ol 'keymap map)
+ (overlay-put ol 'help-echo "Header File : mouse-3 - Context menu")))))
;;; Regular Include Functions
;;
;(goto-char (window-start win))
(mouse-set-point event)
(sit-for 0)
- (semantic-popup-menu semantic-decoration-on-include-menu)
+ (popup-menu semantic-decoration-on-include-menu)
)
(select-window startwin)))
;(goto-char (window-start win))
(mouse-set-point event)
(sit-for 0)
- (semantic-popup-menu semantic-decoration-on-unknown-include-menu)
+ (popup-menu semantic-decoration-on-unknown-include-menu)
)
(select-window startwin)))
;(goto-char (window-start win))
(mouse-set-point event)
(sit-for 0)
- (semantic-popup-menu semantic-decoration-on-fileless-include-menu)
+ (popup-menu semantic-decoration-on-fileless-include-menu)
)
(select-window startwin)))
;(goto-char (window-start win))
(mouse-set-point event)
(sit-for 0)
- (semantic-popup-menu semantic-decoration-on-unparsed-include-menu)
+ (popup-menu semantic-decoration-on-unparsed-include-menu)
)
(select-window startwin)))
;;
(defsubst semantic-decoration-p (object)
"Return non-nil if OBJECT is a tag decoration."
- (and (semantic-overlay-p object)
- (semantic-overlay-get object 'semantic-decoration)))
+ (and (overlayp object)
+ (overlay-get object 'semantic-decoration)))
(defsubst semantic-decoration-set-property (deco property value)
"Set the DECO decoration's PROPERTY to VALUE.
Return DECO."
(cl-assert (semantic-decoration-p deco))
- (semantic-overlay-put deco property value)
+ (overlay-put deco property value)
deco)
(defsubst semantic-decoration-get-property (deco property)
"Return the DECO decoration's PROPERTY value."
(cl-assert (semantic-decoration-p deco))
- (semantic-overlay-get deco property))
+ (overlay-get deco property))
(defsubst semantic-decoration-set-face (deco face)
"Set the face of the decoration DECO to FACE.
"Move the decoration DECO on the region between BEGIN and END.
Return DECO."
(cl-assert (semantic-decoration-p deco))
- (semantic-overlay-move deco begin end)
+ (move-overlay deco begin end)
deco)
\f
;;; Tag decoration
(let ((deco (semantic-tag-create-secondary-overlay tag)))
;; We do not use the unlink property because we do not want to
;; save the highlighting information in the DB.
- (semantic-overlay-put deco 'semantic-decoration t)
+ (overlay-put deco 'semantic-decoration t)
(semantic-decoration-move deco begin end)
(semantic-decoration-set-face deco face)
deco))
Should be used to flush decorations that might remain in BUFFER, for
example, after tags have been refreshed."
(with-current-buffer (or buffer (current-buffer))
- (dolist (o (semantic-overlays-in (point-min) (point-max)))
+ (dolist (o (overlays-in (point-min) (point-max)))
(and (semantic-decoration-p o)
- (semantic-overlay-delete o)))))
+ (delete-overlay o)))))
(defun semantic-decorate-clear-decorations (tag-list)
"Remove decorations found in tags in TAG-LIST."
Optional argument BUFFER is the buffer to search for changes in."
(save-excursion
(if buffer (set-buffer buffer))
- (let ((ol (semantic-overlays-in (max start (point-min))
- (min end (point-max))))
+ (let ((ol (overlays-in (max start (point-min))
+ (min end (point-max))))
(ret nil))
(while ol
- (when (semantic-overlay-get (car ol) 'semantic-change)
+ (when (overlay-get (car ol) 'semantic-change)
(setq ret (cons (car ol) ret)))
(setq ol (cdr ol)))
- (sort ret #'(lambda (a b) (< (semantic-overlay-start a)
- (semantic-overlay-start b)))))))
+ (sort ret #'(lambda (a b) (< (overlay-start a)
+ (overlay-start b)))))))
(defun semantic-edits-change-function-handle-changes (start end length)
"Run whenever a buffer controlled by `semantic-mode' change.
)
(semantic-parse-tree-set-needs-update)
(if (not changes-in-change)
- (let ((o (semantic-make-overlay start end)))
- (semantic-overlay-put o 'semantic-change t)
+ (let ((o (make-overlay start end)))
+ (overlay-put o 'semantic-change t)
;; Run the hooks safely. When hooks blow it, our dirty
;; function will be removed from the list of active change
;; functions.
(let ((tmp changes-in-change))
;; Find greatest bounds of all changes
(while tmp
- (when (< (semantic-overlay-start (car tmp)) start)
- (setq start (semantic-overlay-start (car tmp))))
- (when (> (semantic-overlay-end (car tmp)) end)
- (setq end (semantic-overlay-end (car tmp))))
+ (when (< (overlay-start (car tmp)) start)
+ (setq start (overlay-start (car tmp))))
+ (when (> (overlay-end (car tmp)) end)
+ (setq end (overlay-end (car tmp))))
(setq tmp (cdr tmp)))
;; Move the first found overlay, recycling that overlay.
- (semantic-overlay-move (car changes-in-change) start end)
+ (move-overlay (car changes-in-change) start end)
(condition-case nil
(run-hook-with-args 'semantic-edits-move-change-hooks
(car changes-in-change))
(run-hook-with-args 'semantic-edits-delete-change-functions
(car changes-in-change))
(error nil))
- (semantic-overlay-delete (car changes-in-change))
+ (delete-overlay (car changes-in-change))
(setq changes-in-change (cdr changes-in-change))))
)))
(run-hook-with-args 'semantic-edits-delete-change-functions
change)
(error nil))
- (semantic-overlay-delete change))
+ (delete-overlay change))
(defun semantic-edits-flush-changes ()
"Flush the changes in the current buffer."
HITS is the list of tags that CHANGE is in. It can have more than
one tag in it if the leaf tag is within a parent tag."
(and (< (semantic-tag-start (car hits))
- (semantic-overlay-start change))
+ (overlay-start change))
(> (semantic-tag-end (car hits))
- (semantic-overlay-end change))
+ (overlay-end change))
;; Recurse on the rest. If this change is inside all
;; of these tags, then they are all leaves or parents
;; of the smallest tag.
;; at point and mark (via comments I assume.)
(defsubst semantic-edits-os (change)
"For testing: Start of CHANGE, or smaller of (point) and (mark)."
- (if change (semantic-overlay-start change)
+ (if change (overlay-start change)
(if (< (point) (mark)) (point) (mark))))
(defsubst semantic-edits-oe (change)
"For testing: End of CHANGE, or larger of (point) and (mark)."
- (if change (semantic-overlay-end change)
+ (if change (overlay-end change)
(if (> (point) (mark)) (point) (mark))))
(defun semantic-edits-change-leaf-tag (change)
;; encompassed within the bounds of tags
;; modified by the previous iteration's
;; change.
- (< (semantic-overlay-start (car changes))
+ (< (overlay-start (car changes))
parse-end)))
;; REMOVE LATER
;; our change, meaning there is nothing before
;; the change.
((> (semantic-tag-start (car cache-list))
- (semantic-overlay-end (car changes)))
+ (overlay-end (car changes)))
(setq last-cond "Beginning of buffer")
(setq parse-start
;; Don't worry about parents since
)
;; A change stuck on the first surrounding tag.
((= (semantic-tag-end (car cache-list))
- (semantic-overlay-start (car changes)))
+ (overlay-start (car changes)))
(setq last-cond "Beginning of Tag")
;; Reparse that first tag.
(setq parse-start
(semantic-tag-start (car cache-list))
parse-end
- (semantic-overlay-end (car changes))
+ (overlay-end (car changes))
tags
(list (car cache-list)))
(semantic-edits-assert-valid-region)
(if end-marker
(setq parse-end
(semantic-tag-start end-marker))
- (setq parse-end (semantic-overlay-end
+ (setq parse-end (overlay-end
(car changes))))
(semantic-edits-assert-valid-region)
)
;; list of tags. Only possible if END
;; already matches the end of that tag.
(setq parse-end
- (semantic-overlay-end (car changes)))))
+ (overlay-end (car changes)))))
(semantic-edits-assert-valid-region)
))
))
;; Is this change inside the previous parse group?
;; We already checked start.
- ((< (semantic-overlay-end (car changes)) parse-end)
+ ((< (overlay-end (car changes)) parse-end)
(setq last-cond "in bounds")
nil)
;; This change extends the current parse group.
lost if not transferred into NEWTAG."
(let* ((oo (semantic-tag-overlay oldtag))
(o (semantic-tag-overlay newtag))
- (oo-props (semantic-overlay-properties oo)))
+ (oo-props (overlay-properties oo)))
(while oo-props
- (semantic-overlay-put o (car oo-props) (car (cdr oo-props)))
+ (overlay-put o (car oo-props) (car (cdr oo-props)))
(setq oo-props (cdr (cdr oo-props)))
)
;; Free the old overlay(s)
;; 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.
- (semantic-overlay-put o 'semantic oldtag)
+ (overlay-put o 'semantic oldtag)
))
(add-hook 'semantic-before-toplevel-cache-flush-hook
(set-buffer (marker-buffer positionormarker))
(if (bufferp buffer)
(set-buffer buffer))))
- (let ((ol (semantic-overlays-at (or positionormarker (point))))
+ (let ((ol (overlays-at (or positionormarker (point))))
(ret nil))
(while ol
- (let ((tmp (semantic-overlay-get (car ol) 'semantic)))
+ (let ((tmp (overlay-get (car ol) 'semantic)))
(when (and tmp
;; We don't need with-position because no tag w/out
;; a position could exist in an overlay.
Optional BUFFER argument specifies the buffer to use."
(save-excursion
(if buffer (set-buffer buffer))
- (let ((ol (semantic-overlays-in start end))
+ (let ((ol (overlays-in start end))
(ret nil))
(while ol
- (let ((tmp (semantic-overlay-get (car ol) 'semantic)))
+ (let ((tmp (overlay-get (car ol) 'semantic)))
(when (and tmp
;; See above about position
(semantic-tag-p tmp))
(if (not start) (setq start (point)))
(let ((os start) (ol nil))
(while (and os (< os (point-max)) (not ol))
- (setq os (semantic-overlay-next-change os))
+ (setq os (next-overlay-change os))
(when os
;; Get overlays at position
- (setq ol (semantic-overlays-at os))
+ (setq ol (overlays-at os))
;; find the overlay that belongs to semantic
;; and starts at the found position.
(while (and ol (listp ol))
- (if (and (semantic-overlay-get (car ol) 'semantic)
+ (if (and (overlay-get (car ol) 'semantic)
(semantic-tag-p
- (semantic-overlay-get (car ol) 'semantic))
- (= (semantic-overlay-start (car ol)) os))
+ (overlay-get (car ol) 'semantic))
+ (= (overlay-start (car ol)) os))
(setq ol (car ol)))
(when (listp ol) (setq ol (cdr ol))))))
;; convert ol to a tag
- (when (and ol (semantic-tag-p (semantic-overlay-get ol 'semantic)))
- (semantic-overlay-get ol 'semantic)))))
+ (when (and ol (semantic-tag-p (overlay-get ol 'semantic)))
+ (overlay-get ol 'semantic)))))
;;;###autoload
(defun semantic-find-tag-by-overlay-prev (&optional start buffer)
(if (not start) (setq start (point)))
(let ((os start) (ol nil))
(while (and os (> os (point-min)) (not ol))
- (setq os (semantic-overlay-previous-change os))
+ (setq os (previous-overlay-change os))
(when os
;; Get overlays at position
- (setq ol (semantic-overlays-at (1- os)))
+ (setq ol (overlays-at (1- os)))
;; find the overlay that belongs to semantic
;; and ENDS at the found position.
;;
;; Use end because we are going backward.
(while (and ol (listp ol))
- (if (and (semantic-overlay-get (car ol) 'semantic)
+ (if (and (overlay-get (car ol) 'semantic)
(semantic-tag-p
- (semantic-overlay-get (car ol) 'semantic))
- (= (semantic-overlay-end (car ol)) os))
+ (overlay-get (car ol) 'semantic))
+ (= (overlay-end (car ol)) os))
(setq ol (car ol)))
(when (listp ol) (setq ol (cdr ol))))))
;; convert ol to a tag
(when (and ol
- (semantic-tag-p (semantic-overlay-get ol 'semantic)))
- (semantic-overlay-get ol 'semantic)))))
+ (semantic-tag-p (overlay-get ol 'semantic)))
+ (overlay-get ol 'semantic)))))
;;;###autoload
(defun semantic-find-tag-parent-by-overlay (tag)
(defun semantic-delete-overlay-maybe (overlay)
"Delete OVERLAY if it is a semantic token overlay."
- (if (semantic-overlay-get overlay 'semantic)
- (semantic-overlay-delete overlay)))
+ (if (overlay-get overlay 'semantic)
+ (delete-overlay overlay)))
;;; Menu Item compatibility
;;
(or (memq lifespan '(end-of-command exit-cache-zone))
(error "semantic-cache-data-to-buffer: Unknown LIFESPAN: %s"
lifespan))
- (let ((o (semantic-make-overlay start end buffer)))
- (semantic-overlay-put o 'cache-name name)
- (semantic-overlay-put o 'cached-value value)
- (semantic-overlay-put o 'lifespan 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)
(oldcache semantic-cache-data-overlays))
(while oldcache
(let* ((o (car oldcache))
- (life (semantic-overlay-get o 'lifespan))
+ (life (overlay-get o 'lifespan))
)
(if (or (eq life 'end-of-command)
(and (eq life 'exit-cache-zone)
- (not (member o (semantic-overlays-at (point))))))
+ (not (member o (overlays-at (point))))))
(progn
;;(message "Removing from cache: %s" o)
- (semantic-overlay-delete o)
+ (delete-overlay o)
)
(setq newcache (cons o newcache))))
(setq oldcache (cdr oldcache)))
"Get cached data with NAME from optional POINT."
(save-excursion
(if point (goto-char point))
- (let ((o (semantic-overlays-at (point)))
+ (let ((o (overlays-at (point)))
(ans nil))
(while (and (not ans) o)
- (if (equal (semantic-overlay-get (car o) 'cache-name) name)
+ (if (equal (overlay-get (car o) 'cache-name) name)
(setq ans (car o))
(setq o (cdr o))))
(when ans
- (semantic-overlay-get ans 'cached-value)))))
+ (overlay-get ans 'cached-value)))))
(defun semantic-test-data-cache ()
"Test the data cache."
(semantic-edits-os overlay)
(semantic-edits-oe overlay)))))
(if (semantic-tag-of-class-p outer 'nonterminal)
- (semantic-overlay-move overlay
- (semantic-tag-start outer)
- (semantic-tag-end outer)))))
+ (move-overlay overlay
+ (semantic-tag-start outer)
+ (semantic-tag-end outer)))))
(define-derived-mode semantic-grammar-mode
fundamental-mode "Semantic Grammar Framework"
;; just the stable version.
(pulse-flag nil)
)
- (cond ((semantic-overlay-p region)
- (with-current-buffer (semantic-overlay-buffer region)
+ (cond ((overlayp region)
+ (with-current-buffer (overlay-buffer region)
(save-excursion
- (goto-char (semantic-overlay-start region))
+ (goto-char (overlay-start region))
(when (pos-visible-in-window-p
(point) (get-buffer-window (current-buffer) 'visible))
- (if (< (semantic-overlay-end region) (point-at-eol))
+ (if (< (overlay-end region) (point-at-eol))
(pulse-momentary-highlight-overlay
region semantic-idle-symbol-highlight-face)
;; Not the same
(pulse-momentary-highlight-region
- (semantic-overlay-start region)
+ (overlay-start region)
(point-at-eol)
semantic-idle-symbol-highlight-face))))
))
(let ((old-window (selected-window))
(window (semantic-event-window event)))
(select-window window t)
- (semantic-popup-menu semantic-idle-breadcrumbs-popup-menu)
+ (popup-menu semantic-idle-breadcrumbs-popup-menu)
(select-window old-window)))
(defmacro semantic-idle-breadcrumbs--tag-function (function)
If TAG doesn't have an overlay, and instead as a vector of positions,
concoct a combination of file name, and position."
(let ((o (semantic-tag-overlay tag)))
- (if (not (semantic-overlay-p o))
+ (if (not (overlayp o))
(let ((v (make-vector 3 nil)))
(aset v 0 semantic-imenu-directory-current-file)
(aset v 1 (aref o 0))
we can continue to use overlays to maintain the current position.
Optional argument REST is some extra stuff."
(require 'pulse)
- (if (semantic-overlay-p position)
- (let ((os (semantic-overlay-start position))
- (ob (semantic-overlay-buffer position)))
+ (if (overlayp position)
+ (let ((os (overlay-start position))
+ (ob (overlay-buffer position)))
(if os
(progn
(if (not (eq ob (current-buffer)))
;; the originating buffer we are parsing. We need to do this every time
;; since the state changes.
(dolist (V important-vars)
- (set V (semantic-buffer-local-value V origbuff)))
+ (set V (buffer-local-value V origbuff)))
(insert text)
(goto-char (point-min))
"Highlight the lexical TOKEN.
TOKEN is a lexical token with a START And END position.
Return the overlay."
- (let ((o (semantic-make-overlay (semantic-lex-token-start token)
- (semantic-lex-token-end token))))
- (semantic-overlay-put o 'face 'highlight)
+ (let ((o (make-overlay (semantic-lex-token-start token)
+ (semantic-lex-token-end token))))
+ (overlay-put o 'face 'highlight)
o))
;;; Lexical analyzer creation
(progn
(when token
(setq o (semantic-lex-highlight-token token)))
- (semantic-read-event
+ (read-event
(format "%S :: Depth: %d :: SPC - continue" token semantic-lex-current-depth))
)
(when o
- (semantic-overlay-delete o))))))
+ (delete-overlay o))))))
(defmacro define-lex (name doc &rest analyzers)
"Create a new lexical analyzer with NAME.
"Return the tag before POS or one of its parent where to step."
(let (ol tag)
(while (and pos (> pos (point-min)) (not tag))
- (setq pos (semantic-overlay-previous-change pos))
+ (setq pos (previous-overlay-change pos))
(when pos
;; Get overlays at position
- (setq ol (semantic-overlays-at pos))
+ (setq ol (overlays-at pos))
;; find the overlay that belongs to semantic
;; and STARTS or ENDS at the found position.
(while (and ol (not tag))
- (setq tag (semantic-overlay-get (car ol) 'semantic))
+ (setq tag (overlay-get (car ol) 'semantic))
(unless (and tag (semantic-tag-p tag)
(or (= (semantic-tag-start tag) pos)
(= (semantic-tag-end tag) pos)))
Hits are the line of code from the buffer, not the tag summar or file lines."
(save-excursion
(end-of-line)
- (let* ((ol (car (semantic-overlays-at (1- (point)))))) ;; trust this for now
- (when ol (semantic-overlay-get ol 'line)))))
+ (let* ((ol (car (overlays-at (1- (point)))))) ;; trust this for now
+ (when ol (overlay-get ol 'line)))))
;;; Keyboard Macros on a Hit
searchfor))
(ol (save-excursion
(end-of-line)
- (car (semantic-overlays-at (1- (point))))))
- (tag (when ol (semantic-overlay-get ol 'tag)))
- (line (when ol (semantic-overlay-get ol 'line))))
+ (car (overlays-at (1- (point))))))
+ (tag (when ol (overlay-get ol 'tag)))
+ (line (when ol (overlay-get ol 'line))))
(when (not line)
(error "Cannot create macro on a non-hit line"))
;; Go there, and do something useful.
(goto-char (point-min))
(while (not (eobp))
;; Is this line a "hit" line?
- (let* ((ol (car (semantic-overlays-at (1- (point))))) ;; trust this for now
- (tag (when ol (semantic-overlay-get ol 'tag)))
- (line (when ol (semantic-overlay-get ol 'line))))
+ (let* ((ol (car (overlays-at (1- (point))))) ;; trust this for now
+ (tag (when ol (overlay-get ol 'tag)))
+ (line (when ol (overlay-get ol 'line))))
(when line
;; The "line" means we have an open hit.
(with-current-buffer (semantic-tag-buffer tag)
(goto-char (point-min))
(while (re-search-forward "\\[-\\]" nil t)
(end-of-line)
- (let* ((ol (car (semantic-overlays-at (1- (point))))) ;; trust this for now
- (tag (when ol (semantic-overlay-get ol 'tag))))
+ (let* ((ol (car (overlays-at (1- (point))))) ;; trust this for now
+ (tag (when ol (overlay-get ol 'tag))))
;; If there is a tag, then close/open it.
(when tag
(semantic-symref-list-toggle-showing)
(defsubst semantic-tag-start (tag)
"Return the start location of TAG."
(let ((o (semantic-tag-overlay tag)))
- (if (semantic-overlay-p o)
- (semantic-overlay-start o)
+ (if (overlayp o)
+ (overlay-start o)
(aref o 0))))
(defsubst semantic-tag-end (tag)
"Return the end location of TAG."
(let ((o (semantic-tag-overlay tag)))
- (if (semantic-overlay-p o)
- (semantic-overlay-end o)
+ (if (overlayp o)
+ (overlay-end o)
(aref o 1))))
(defsubst semantic-tag-bounds (tag)
(defun semantic-tag-set-bounds (tag start end)
"In TAG, set the START and END location of data it describes."
(let ((o (semantic-tag-overlay tag)))
- (if (semantic-overlay-p o)
- (semantic-overlay-move o start end)
+ (if (overlayp o)
+ (move-overlay o start end)
(semantic--tag-set-overlay tag (vector start end)))))
(defun semantic-tag-in-buffer-p (tag)
If a tag is not in a buffer, return nil."
(let ((o (semantic-tag-overlay tag)))
;; TAG is currently linked to a buffer, return it.
- (when (and (semantic-overlay-p o)
- (semantic-overlay-live-p o))
- (semantic-overlay-buffer o))))
+ (when (and (overlayp o)
+ (overlay-buffer o))
+ (overlay-buffer o))))
(defsubst semantic--tag-get-property (tag property)
"From TAG, extract the value of PROPERTY.
"Return non-nil if TAG has positional information."
(and (semantic-tag-p tag)
(let ((o (semantic-tag-overlay tag)))
- (or (and (semantic-overlay-p o)
- (semantic-overlay-live-p o))
+ (or (and (overlayp o)
+ (overlay-buffer o))
(arrayp o)))))
(defun semantic-equivalent-tag-p (tag1 tag2)
;; Call the unlink-copy hook. This should tell tools that
;; this tag is not part of any buffer.
- (when (semantic-overlay-p (semantic-tag-overlay tag))
+ (when (overlayp (semantic-tag-overlay tag))
(semantic--tag-run-hooks copy 'unlink-copy-hook))
)
copy))
This function is for internal use only."
(when (semantic-tag-p tag)
(let ((o (semantic-tag-overlay tag)))
- (when (semantic-overlay-p o)
+ (when (overlayp o)
(semantic--tag-set-overlay
- tag (vector (semantic-overlay-start o)
- (semantic-overlay-end o)))
- (semantic-overlay-delete o))
+ tag (vector (overlay-start o)
+ (overlay-end o)))
+ (delete-overlay o))
;; Look for a link hook on TAG.
(semantic--tag-run-hooks tag 'unlink-hook)
;; Fix the sub-tags which contain overlays.
(when (semantic-tag-p tag)
(let ((o (semantic-tag-overlay tag)))
(when (and (vectorp o) (= (length o) 2))
- (setq o (semantic-make-overlay (aref o 0) (aref o 1)
- (current-buffer)))
+ (setq o (make-overlay (aref o 0) (aref o 1) (current-buffer)))
(semantic--tag-set-overlay tag o)
- (semantic-overlay-put o 'semantic tag)
+ (overlay-put o 'semantic tag)
;; Clear the :filename property
(semantic--tag-put-property tag :filename nil))
;; Look for a link hook on TAG.
"Function set into `semantic-edits-new-change-hook'.
Argument OVERLAY is the overlay created to mark the change.
This function will set the face property on this overlay."
- (semantic-overlay-put overlay 'face 'semantic-highlight-edits-face))
+ (overlay-put overlay 'face 'semantic-highlight-edits-face))
(defvar semantic-highlight-edits-mode-map
(let ((km (make-sparse-keymap)))
(defsubst semantic-unmatched-syntax-overlay-p (overlay)
"Return non-nil if OVERLAY is an unmatched syntax one."
- (eq (semantic-overlay-get overlay 'semantic) 'unmatched))
+ (eq (overlay-get overlay 'semantic) 'unmatched))
(defun semantic-showing-unmatched-syntax-p ()
"Return non-nil if an unmatched syntax overlay was found in buffer."
- (let ((ol (semantic-overlays-in (point-min) (point-max)))
+ (let ((ol (overlays-in (point-min) (point-max)))
found)
(while (and ol (not found))
(setq found (semantic-unmatched-syntax-overlay-p (car ol))
"Fetch a list of unmatched lexical tokens from the current buffer.
Uses the overlays which have accurate bounds, and rebuilds what was
originally passed in."
- (let ((ol (semantic-overlays-in (point-min) (point-max)))
+ (let ((ol (overlays-in (point-min) (point-max)))
(ustc nil))
(while ol
(if (semantic-unmatched-syntax-overlay-p (car ol))
(setq ustc (cons (cons 'thing
- (cons (semantic-overlay-start (car ol))
- (semantic-overlay-end (car ol))))
+ (cons (overlay-start (car ol))
+ (overlay-end (car ol))))
ustc)))
(setq ol (cdr ol)))
(nreverse ustc))
(defun semantic-clean-unmatched-syntax-in-region (beg end)
"Remove all unmatched syntax overlays between BEG and END."
- (let ((ol (semantic-overlays-in beg end)))
+ (let ((ol (overlays-in beg end)))
(while ol
(if (semantic-unmatched-syntax-overlay-p (car ol))
- (semantic-overlay-delete (car ol)))
+ (delete-overlay (car ol)))
(setq ol (cdr ol)))))
(defsubst semantic-clean-unmatched-syntax-in-buffer ()
(if syntax
(let (o)
(while syntax
- (setq o (semantic-make-overlay (semantic-lex-token-start (car syntax))
- (semantic-lex-token-end (car syntax))))
- (semantic-overlay-put o 'semantic 'unmatched)
- (semantic-overlay-put o 'face 'semantic-unmatched-syntax-face)
+ (setq o (make-overlay (semantic-lex-token-start (car syntax))
+ (semantic-lex-token-end (car syntax))))
+ (overlay-put o 'semantic 'unmatched)
+ (overlay-put o 'face 'semantic-unmatched-syntax-face)
(setq syntax (cdr syntax))))
))
(goto-char point)
(let ((os point) (ol nil))
(while (and os (< os (or bound (point-max))) (not ol))
- (setq os (semantic-overlay-next-change os))
+ (setq os (next-overlay-change os))
(when os
;; Get overlays at position
- (setq ol (semantic-overlays-at os))
+ (setq ol (overlays-at os))
;; find the overlay that belongs to semantic
;; and starts at the found position.
(while (and ol (listp ol))
(interactive)
(let ((o (semantic-next-unmatched-syntax (point))))
(if o
- (goto-char (semantic-overlay-start o)))))
+ (goto-char (overlay-start o)))))
\f
;;;;
;(goto-char (window-start win))
(mouse-set-point event)
(sit-for 0)
- (semantic-popup-menu semantic-highlight-func-popup-menu)
+ (popup-menu semantic-highlight-func-popup-menu)
)
(select-window startwin)))
function was called, move the overlay."
(when (and (not (minibufferp))
(or (not semantic-highlight-func-ct-overlay)
- (eq (semantic-overlay-buffer
+ (eq (overlay-buffer
semantic-highlight-func-ct-overlay)
(current-buffer))))
(let* ((tag (semantic-stickyfunc-tag-to-stick))
(ol semantic-highlight-func-ct-overlay))
(when (not ol)
;; No overlay in this buffer. Make one.
- (setq ol (semantic-make-overlay (point-min) (point-min)
- (current-buffer) t nil))
- (semantic-overlay-put ol 'highlight-func t)
- (semantic-overlay-put ol 'face 'semantic-highlight-func-current-tag-face)
- (semantic-overlay-put ol 'keymap semantic-highlight-func-mode-map)
- (semantic-overlay-put ol 'help-echo
+ (setq ol (make-overlay (point-min) (point-min)
+ (current-buffer) t nil))
+ (overlay-put ol 'highlight-func t)
+ (overlay-put ol 'face 'semantic-highlight-func-current-tag-face)
+ (overlay-put ol 'keymap semantic-highlight-func-mode-map)
+ (overlay-put ol 'help-echo
"Current Function : mouse-3 - Context menu")
(setq semantic-highlight-func-ct-overlay ol)
)
(if (or (not tag) disable)
;; No tag, make the overlay go away.
(progn
- (semantic-overlay-put ol 'tag nil)
- (semantic-overlay-move ol (point-min) (point-min) (current-buffer))
- )
+ (overlay-put ol 'tag nil)
+ (move-overlay ol (point-min) (point-min) (current-buffer)))
;; We have a tag, if it is the same, do nothing.
- (unless (eq (semantic-overlay-get ol 'tag) tag)
+ (unless (eq (overlay-get ol 'tag) tag)
(save-excursion
(goto-char (semantic-tag-start tag))
(search-forward (semantic-tag-name tag) nil t)
- (semantic-overlay-put ol 'tag tag)
- (semantic-overlay-move ol (point-at-bol) (point-at-eol))
- )
- )
- )))
+ (overlay-put ol 'tag tag)
+ (move-overlay ol (point-at-bol) (point-at-eol)))))))
nil)
(semantic-add-minor-mode 'semantic-highlight-func-mode
(if (semantic-tag-p tok)
(if (semantic-tag-with-position-p tok)
(let ((o (semantic-tag-overlay tok)))
- (if (and (semantic-overlay-p o)
- (not (semantic-overlay-live-p o)))
+ (if (and (overlayp o)
+ (not (overlay-buffer o)))
(let ((debug-on-error t))
(error "Tag %s is invalid!" (semantic-tag-name tok)))
;; else, tag is OK.
(interactive)
(if (and (not cache) (not over) (not notfirst))
(setq cache semantic--buffer-cache
- over (semantic-overlays-in (point-min) (point-max))))
+ over (overlays-in (point-min) (point-max))))
(while cache
(let ((chil (semantic-tag-components-with-overlays (car cache))))
(if (not (memq (semantic-tag-overlay (car cache)) over))
;; Strip out all overlays which aren't semantic overlays
(let ((o nil))
(while over
- (when (and (semantic-overlay-get (car over) 'semantic)
- (not (eq (semantic-overlay-get (car over) 'semantic)
+ (when (and (overlay-get (car over) 'semantic)
+ (not (eq (overlay-get (car over) 'semantic)
'unmatched)))
(setq o (cons (car over) o)))
(setq over (cdr over)))
(when (or (not (slot-boundp f 'overlay)) (not (oref f overlay)))
(error "Field test: Overlay info not created for field"))
- (when (and (overlay-p (oref f overlay))
+ (when (and (overlayp (oref f overlay))
(not (overlay-get (oref f overlay) 'srecode-init-only)))
(error "Field creation overlay is not tagged w/ init flag"))
(srecode-overlaid-activate f)
- (when (or (not (overlay-p (oref f overlay)))
+ (when (or (not (overlayp (oref f overlay)))
(overlay-get (oref f overlay) 'srecode-init-only))
(error "New field overlay not created during activation"))