Function: kcell-view:backward

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

Signature

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

Documentation

Move to start of the prior 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
;;; ************************************************************************
;;; Public functions
;;; ************************************************************************

;;;
;;; kcell-view - Kcell view-specific functions
;;;

(defun kcell-view:backward (&optional visible-p lbl-sep-len)
  "Move to start of the prior cell at the same level as the current cell.
With optional VISIBLE-P, consider only visible cells.
Return t unless no such cell."
  (or 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:previous visible-p lbl-sep-len))
      (if (bobp)
	  (progn (setq done t)
		 (goto-char opoint))
	(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 start of this tree without a match.
	       (setq done t)
	       (goto-char opoint))
	      ;; else go to prior node
	      )))
    found))