Function: ewoc-filter

ewoc-filter is a byte-compiled function defined in ewoc.el.gz.

Signature

(ewoc-filter EWOC PREDICATE &rest ARGS)

Documentation

Remove all elements in EWOC for which PREDICATE returns nil.

Note that the buffer for EWOC will be the current buffer when PREDICATE is called. PREDICATE must restore the current buffer before it returns if it changes it. The PREDICATE is called with the element as its first argument. If any ARGS are given they will be passed to the PREDICATE.

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/ewoc.el.gz
(defun ewoc-filter (ewoc predicate &rest args)
  "Remove all elements in EWOC for which PREDICATE returns nil.
Note that the buffer for EWOC will be the current buffer when PREDICATE
is called.  PREDICATE must restore the current buffer before it returns
if it changes it.
The PREDICATE is called with the element as its first argument.  If any
ARGS are given they will be passed to the PREDICATE."
  (ewoc--set-buffer-bind-dll-let* ewoc
      ((node (ewoc--node-nth dll 1))
       (footer (ewoc--footer ewoc))
       (goodbye nil)
       (inhibit-read-only t))
    (while (not (eq node footer))
      (unless (apply predicate (ewoc--node-data node) args)
        (push node goodbye))
      (setq node (ewoc--node-next dll node)))
    (apply 'ewoc-delete ewoc goodbye)))