Function: kcell-view:previous-kcell

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

Signature

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

Documentation

Move to point holding the kcell property within previous cell of current kview.

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

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/kotl/kview.el
(defun kcell-view:previous-kcell (&optional visible-p lbl-sep-len)
  "Move to point holding the kcell property within previous cell of current kview.
With optional VISIBLE-P, consider only visible cells.  Return t
unless no previous cell."
  (when (not (kview:valid-position-p))
    (kotl-mode:to-valid-position t))
  (let* ((opoint (point))
	 (pos opoint))
    (when (kview:valid-position-p)
      ;; First skip past the 2 changes for the current kcell property.
      (setq pos (kproperty:previous-single-change pos 'kcell)
	    pos (kproperty:previous-single-change pos 'kcell)))
    (while (and pos (setq pos (kproperty:previous-single-change pos 'kcell))
		(or (not (kproperty:get pos 'kcell))
		    (and visible-p (kcell-view:invisible-p pos lbl-sep-len)))))
    (if (and pos (/= pos opoint) (kproperty:get pos 'kcell)
	     (if visible-p (not (kcell-view:invisible-p pos lbl-sep-len)) t))
	(progn (goto-char pos) t))))