Function: kview:map-branch
kview:map-branch is a byte-compiled function defined in kview.el.
Signature
(kview:map-branch FUNC KVIEW &optional FIRST-P VISIBLE-P)
Documentation
Apply FUNC to the sibling trees from point forward within KVIEW.
Return results as a list. With optional FIRST-P non-nil, begins with first sibling in current branch. With optional VISIBLE-P, considers only those sibling cells that are visible in the view.
FUNC should take one argument, the kview local variable of the current buffer or some other kview, and should operate upon the cell at point.
Cell-indent contains the indentation value of the first cell mapped when
FUNC is called so that it may test against this value. lbl-sep-len
contains the label separator length.
See also kview:map-region, kview:map-siblings and kview:map-tree.
Source Code
;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/kotl/kview.el
(defun kview:map-branch (func kview &optional first-p visible-p)
"Apply FUNC to the sibling trees from point forward within KVIEW.
Return results as a list.
With optional FIRST-P non-nil, begins with first sibling in current branch.
With optional VISIBLE-P, considers only those sibling cells that are visible
in the view.
FUNC should take one argument, the kview local variable of the current
buffer or some other kview, and should operate upon the cell at point.
`Cell-indent' contains the indentation value of the first cell mapped when
FUNC is called so that it may test against this value. `lbl-sep-len'
contains the label separator length.
See also `kview:map-region', `kview:map-siblings' and `kview:map-tree'."
(with-current-buffer (kview:buffer kview)
(save-excursion
(let ((results)
(lbl-sep-len (kview:label-separator-length kview))
cell-indent)
(when first-p
;; Move back to first predecessor at same level.
(while (kcell-view:backward t lbl-sep-len)))
(setq cell-indent (kcell-view:indent nil lbl-sep-len))
;; Terminate when no further cells or when reach a cell at an equal
;; or higher level in the kotl than the first cell that we processed.
(while (and (setq results (cons (funcall func kview) results))
(kcell-view:next visible-p lbl-sep-len)
(>= (- (kcell-view:indent nil lbl-sep-len) cell-indent)
(kview:level-indent kview))))
(nreverse results)))))