Function: kcell-view:forward

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

Signature

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

Documentation

Move to start of the following cell at the same level as the current cell.

With optional VISIBLE-P, consider only visible cells. Return t unless no such cell.

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/kotl/kview.el
(defun kcell-view:forward (&optional visible-p lbl-sep-len)
  "Move to start of the following cell at the same level as the current cell.
With optional VISIBLE-P, consider only visible cells.
Return t unless no such cell."
  (unless lbl-sep-len
    (setq lbl-sep-len (kview:label-separator-length kotl-kview)))
  (let ((opoint (point))
	(found) (done)
	(curr-indent 0)
	(start-indent (kcell-view:indent nil lbl-sep-len)))
    (while (and (not (or found done))
		(kcell-view:next visible-p lbl-sep-len))
      (setq curr-indent (kcell-view:indent nil lbl-sep-len))
      (cond ((< (abs (- curr-indent start-indent))
		(kview:level-indent kotl-kview))
	     (goto-char (kcell-view:start nil lbl-sep-len))
	     (setq found t))
	    ((< curr-indent start-indent)
	     ;; Went past end of this tree without a match.
	     (setq done t)
	     (goto-char opoint))
	    ;; else go to following node
	    ))
    ;; If didn't find a match, return to original point.
    (unless found
      (goto-char opoint))
    found))