Function: kcell-view:parent

kcell-view:parent is a byte-compiled function defined in kview.el.

Signature

(kcell-view:parent &optional VISIBLE-P LBL-SEP-LEN)

Documentation

Move to start of current cell's parent within current view.

If parent is top cell, move to first cell within view and return 0. Otherwise, return t unless optional VISIBLE-P is non-nil and the parent cell is not part of the current view, else nil.

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/kotl/kview.el
(defun kcell-view:parent (&optional visible-p lbl-sep-len)
  "Move to start of current cell's parent within current view.
If parent is top cell, move to first cell within view and return 0.
Otherwise, return t unless optional VISIBLE-P is non-nil and the parent cell
is not part of the current view, else nil."
  (unless lbl-sep-len
    (setq lbl-sep-len (kview:label-separator-length kotl-kview)))
  (let ((opoint (point))
	(parent-level (1- (kcell-view:level nil lbl-sep-len))))
    (if (= parent-level 0) ;; top cell
	(progn (goto-char (point-min))
	       (goto-char (kcell-view:start nil lbl-sep-len))
	       0)
      ;; Skip from point back past any siblings
      (while (kcell-view:backward visible-p lbl-sep-len))
      ;; Move back to parent.
      (if (kcell-view:previous visible-p lbl-sep-len)
	  t
	;; Move back to previous point and return nil.
	(goto-char opoint)
	nil))))