Function: kview:map-region
kview:map-region is a byte-compiled function defined in kview.el.
Signature
(kview:map-region FUNC KVIEW &optional VISIBLE-P START END)
Documentation
Apply FUNC to each cell in the region within KVIEW and return results as a list.
With optional VISIBLE-P, considers only those cells that are visible in the view. With optional START and END positions, uses these rather than the bounds of the active region.
FUNC should take no arguments and should operate upon the cell at point.
lbl-sep-len contains the label separator length.
See also kview:map-tree, kview:map-branch, and kview:map-siblings.
Source Code
;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/kotl/kview.el
(defun kview:map-region (func kview &optional visible-p start end)
"Apply FUNC to each cell in the region within KVIEW and return results as a list.
With optional VISIBLE-P, considers only those cells that are visible
in the view. With optional START and END positions, uses these rather
than the bounds of the active region.
FUNC should take no arguments and should operate upon the cell at point.
`lbl-sep-len' contains the label separator length.
See also `kview:map-tree', `kview:map-branch', and `kview:map-siblings'."
(with-current-buffer (kview:buffer kview)
(save-excursion
(let* ((results)
(lbl-sep-len (kview:label-separator-length kview))
(bounds-given (and (or (integerp start) (markerp start))
(or (integerp end) (markerp end))
(<= start end)))
map-end)
(and (not bounds-given)
(region-active-p)
(setq start (region-beginning)
map-end (kcell-view:end-contents (region-end))
end (progn (goto-char map-end)
(if visible-p
(kotl-mode:to-visible-position t)
map-end))
bounds-given t))
(cond (bounds-given
(goto-char start)
(if visible-p
(kotl-mode:to-visible-position)
(kotl-mode:to-valid-position))
;; Terminate when no further cells within the region.
(while (and (setq results (cons (funcall func) results))
(kcell-view:next visible-p lbl-sep-len)
(<= (point) end)))
(nreverse results))
(t (error "(kview:map-region): No region or invalid start and end positions")))))))