Function: kview:set-cells-status

kview:set-cells-status is a byte-compiled function defined in kview.el.

Signature

(kview:set-cells-status KVIEW START END CELL-STATUS-LIST)

Documentation

Restore each cell's status in current buffer's KVIEW between START and END.

Set each cell status from CELL-STATUS-LIST. Status is: 0 if all the lines of the cell are visible and it has no hidden branches; a positive count of the lines displayed in the cell if it has no hidden branches; otherwise, a negative count of the lines displayed, since it has hidden branches.

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/kotl/kview.el
(defun kview:set-cells-status (kview start end cell-status-list)
  "Restore each cell's status in current buffer's KVIEW between START and END.
Set each cell status from CELL-STATUS-LIST.
Status is: 0 if all the lines of the cell are visible and it has no
hidden branches; a positive count of the lines displayed in the cell
if it has no hidden branches; otherwise, a negative count of the lines
displayed, since it has hidden branches."
  (let (status)
    ;; All cells should be fully expanded when this is called but this
    ;; call collapses and hides some, so have it process only visible
    ;; cells and skip those we have hidden.
    (kview:map-region
     (lambda ()
       (setq status (car cell-status-list))
       (cond ((or (null status) (zerop status))) ;; ignore
	     ((< status 0)
	      ;; Hide the subtree of this cell and display only
	      ;; (- status) lines.
	      (kvspec:show-lines-this-cell (- status))
	      (if (save-excursion (kcell-view:parent nil kview-label-sep-len))
		  (kotl-mode:hide-subtree)
		(error "(kview:set-cells-status): Invisible cell `%s' is missing its parent cell"
		       (kcell-view:label))))
	     ;; (> status 0)
	     (t (kvspec:show-lines-this-cell status)))
       (setq cell-status-list (cdr cell-status-list)))
     kview t start end)))