Function: klabel-type:set-partial-alpha

klabel-type:set-partial-alpha is a byte-compiled function defined in klabel.el.

Signature

(klabel-type:set-partial-alpha CURRENT-CELL-LABEL LBL-SEP-LEN CURRENT-INDENT PER-LEVEL-INDENT &optional CURRENT-TREE-ONLY)

Documentation

Set the labels of current cell, its following siblings and their subtrees.

CURRENT-CELL-LABEL is the label to display for the current cell. LBL-SEP-LEN is the length of the separation between a cell's label and the start of its contents.

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/kotl/klabel.el
(defun klabel-type:set-partial-alpha (current-cell-label lbl-sep-len
                                      current-indent per-level-indent
				      &optional current-tree-only)
  "Set the labels of current cell, its following siblings and their subtrees.
CURRENT-CELL-LABEL is the label to display for the current cell.
LBL-SEP-LEN is the length of the separation between a cell's label
and the start of its contents."
  (let (label-suffix suffix-val suffix-function opoint)
    (if current-cell-label
	(setq label-suffix current-cell-label
	      suffix-function (if (kotl-label:integer-p label-suffix)
				  (progn (setq suffix-val
					       (string-to-number label-suffix))
					 'int-to-string)
				(setq suffix-val
				      (kotl-label:alpha-to-int label-suffix))
				'kotl-label:int-to-alpha)))
    (while current-cell-label
      ;; Set current cell's label.
      (klabel:set current-cell-label lbl-sep-len)
      ;; Process any subtrees of current cell.
      (if (kcell-view:child nil lbl-sep-len)
	  ;; Recurse over subtree.
	  (klabel-type:set-partial-alpha
	   (klabel:child-partial-alpha current-cell-label)
	   lbl-sep-len
	   (+ current-indent per-level-indent)
	   per-level-indent))
      ;; Process next sibling of current cell if any.
      (setq opoint (point))
      (if (and (not current-tree-only)
	       (kcell-view:next nil lbl-sep-len)
	       (< (abs (- (kcell-view:indent nil lbl-sep-len) current-indent))
		  (kview:level-indent kotl-kview)))
	  (setq suffix-val (1+ suffix-val)
		label-suffix (funcall suffix-function suffix-val)
		current-cell-label label-suffix)
	(goto-char opoint)
	(setq current-cell-label nil)))))