Function: cl--map-overlays

cl--map-overlays is an autoloaded and byte-compiled function defined in cl-extra.el.gz.

Signature

(cl--map-overlays FUNC &optional BUFFER START END ARG)

Aliases

cl-map-extents (obsolete since 24.3)

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/cl-extra.el.gz
;;;###autoload
(defun cl--map-overlays (func &optional buffer start end arg)
  (or buffer (setq buffer (current-buffer)))
  (let (ovl)
    (with-current-buffer buffer
      (setq ovl (overlay-lists))
      (if start (setq start (copy-marker start)))
      (if end (setq end (copy-marker end))))
    (setq ovl (nconc (car ovl) (cdr ovl)))
    (while (and ovl
                (or (not (overlay-start (car ovl)))
                    (and end (>= (overlay-start (car ovl)) end))
                    (and start (<= (overlay-end (car ovl)) start))
                    (not (funcall func (car ovl) arg))))
      (setq ovl (cdr ovl)))
    (if start (set-marker start nil))
    (if end (set-marker end nil))))