Function: ewoc-map

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

Signature

(ewoc-map MAP-FUNCTION EWOC &rest ARGS)

Documentation

Apply MAP-FUNCTION to all elements in EWOC.

MAP-FUNCTION is applied to the first element first. If MAP-FUNCTION returns non-nil the element will be refreshed (its pretty-printer will be called once again).

Note that the buffer for EWOC will be the current buffer when MAP-FUNCTION is called. MAP-FUNCTION must restore the current buffer before it returns, if it changes it.

If more than two arguments are given, the remaining arguments will be passed to MAP-FUNCTION.

View in manual

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/ewoc.el.gz
(defun ewoc-map (map-function ewoc &rest args)
  "Apply MAP-FUNCTION to all elements in EWOC.
MAP-FUNCTION is applied to the first element first.
If MAP-FUNCTION returns non-nil the element will be refreshed (its
pretty-printer will be called once again).

Note that the buffer for EWOC will be the current buffer when
MAP-FUNCTION is called.  MAP-FUNCTION must restore the current
buffer before it returns, if it changes it.

If more than two arguments are given, the remaining
arguments will be passed to MAP-FUNCTION."
  (ewoc--set-buffer-bind-dll-let* ewoc
      ((footer (ewoc--footer ewoc))
       (pp (ewoc--pretty-printer ewoc))
       (node (ewoc--node-nth dll 1)))
    (while (not (eq node footer))
      (if (apply map-function (ewoc--node-data node) args)
          (ewoc--refresh-node pp node dll))
      (setq node (ewoc--node-next dll node)))))