Function: kview:map-siblings

kview:map-siblings is a byte-compiled function defined in kview.el.

Signature

(kview:map-siblings FUNC KVIEW &optional FIRST-P VISIBLE-P)

Documentation

Apply FUNC to the sibling cells 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.

The variable lbl-sep-len contains the label separator length.

See also kview:map-branch and kview:map-tree.

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/kotl/kview.el
(defun kview:map-siblings (func kview &optional first-p visible-p)
  "Apply FUNC to the sibling cells 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.

The variable `lbl-sep-len' contains the label separator length.

See also `kview:map-branch' and `kview:map-tree'."
  (with-current-buffer (kview:buffer kview)
    (save-excursion
      (let ((lbl-sep-len (kview:label-separator-length kview))
	    results)
	;; Next line ensures point is in the root of the current tree if
	;; the tree is at all hidden.
	(when visible-p
	  (kotl-mode:beginning-of-line))
	(when first-p
	  ;; Move back to first predecessor at same level.
	  (while (kcell-view:backward t lbl-sep-len)))
	;; Terminate when no further cells at same level.
	(while (progn (setq results (cons (funcall func kview) results))
		      (kcell-view:forward visible-p lbl-sep-len)))
	(nreverse results)))))