Function: flymake--overlays

flymake--overlays is a byte-compiled function defined in flymake.el.gz.

Signature

(flymake--overlays &key BEG END FILTER COMPARE KEY)

Documentation

Get flymake-related overlays.

If BEG is non-nil and END is nil, consider only overlays-at BEG. Otherwise consider overlays-in the region comprised by BEG and END, defaulting to the whole buffer. Remove all that do not verify FILTER, a function, and sort them by COMPARE (using KEY).

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/flymake.el.gz
(cl-defun flymake--overlays (&key beg end filter compare key)
  "Get flymake-related overlays.
If BEG is non-nil and END is nil, consider only `overlays-at'
BEG.  Otherwise consider `overlays-in' the region comprised by BEG
and END, defaulting to the whole buffer.  Remove all that do not
verify FILTER, a function, and sort them by COMPARE (using KEY)."
  (save-restriction
    (widen)
    (let ((ovs (cl-remove-if-not
                (lambda (ov)
                  (and (overlay-get ov 'flymake-diagnostic)
                       (or (not filter)
                           (funcall filter ov))))
                (if (and beg (null end))
                    (overlays-at beg t)
                  (overlays-in (or beg (point-min))
                               (or end (point-max)))))))
      (if compare
          (cl-sort ovs compare :key (or key
                                        #'identity))
        ovs))))