Function: semantic-cache-data-post-command-hook

semantic-cache-data-post-command-hook is a byte-compiled function defined in fw.el.gz.

Signature

(semantic-cache-data-post-command-hook)

Documentation

Flush semantic-cache-data-overlays based lifespan property.

Remove self from post-command-hook if it is empty.

Source Code

;; Defined in /usr/src/emacs/lisp/cedet/semantic/fw.el.gz
(defun semantic-cache-data-post-command-hook ()
  "Flush `semantic-cache-data-overlays' based `lifespan' property.
Remove self from `post-command-hook' if it is empty."
  (let ((newcache nil)
        (oldcache semantic-cache-data-overlays))
    (while oldcache
      (let* ((o    (car oldcache))
             (life (overlay-get o 'lifespan))
             )
        (if (or (eq life 'end-of-command)
                (and (eq life 'exit-cache-zone)
                     (not (member o (overlays-at (point))))))
            (progn
              ;;(message "Removing from cache: %s" o)
              (delete-overlay o)
              )
          (setq newcache (cons o newcache))))
      (setq oldcache (cdr oldcache)))
    (setq semantic-cache-data-overlays (nreverse newcache)))

  ;; Remove ourselves if we have removed all overlays.
  (unless semantic-cache-data-overlays
    (remove-hook 'post-command-hook
                 #'semantic-cache-data-post-command-hook)))