Function: kcell-view:create
kcell-view:create is a byte-compiled function defined in kview.el.
Signature
(kcell-view:create KVIEW CELL CONTENTS LEVEL IDSTAMP KLABEL &optional NO-FILL SIBLING-P)
Documentation
Insert into KVIEW at point, CELL with CONTENTS at LEVEL with IDSTAMP and KLABEL.
First level is 1. If the current view displays klabels, then KLABEL should be inserted prior to this call, with point following it.
Optional NO-FILL non-nil suppresses filling of cell's contents upon insertion or movement.
Source Code
;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/kotl/kview.el
(defun kcell-view:create (kview cell contents level idstamp klabel &optional no-fill sibling-p)
"Insert into KVIEW at point, CELL with CONTENTS at LEVEL with IDSTAMP and KLABEL.
First level is 1.
If the current view displays klabels, then KLABEL should be inserted
prior to this call, with point following it.
Optional NO-FILL non-nil suppresses filling of cell's contents upon insertion
or movement."
(unless (zerop idstamp)
(unless no-fill
(setq no-fill (kcell:get-attr cell 'no-fill)))
(let* ((label-min-width (kview:label-min-width kview))
(label-fmt (format "%%%ds" label-min-width))
(label (cond ((string-equal klabel "")
"")
((and (string-equal klabel "0")
(setq klabel (klabel:format klabel))
;; Fall through
nil))
(t (format label-fmt klabel))))
(label-separator (if (string-equal klabel "") " "
(kview:label-separator kview)))
(mult-line-indent (* (1- level) (kview:level-indent kview)))
(thru-label (+ mult-line-indent label-min-width
(length label-separator)))
(old-point (point))
(fill-prefix (make-string thru-label ?\ ))
new-point)
(when no-fill
(kcell:set-attr cell 'no-fill t))
(insert fill-prefix)
(setq contents (kview:insert-contents cell contents
(or no-fill sibling-p
(null kotl-mode:refill-flag))
fill-prefix))
;; Insert lines to separate cell from next.
(insert "\n\n")
(unless (kview:get-attr kview 'blank-lines)
;; Make blank lines invisible.
(kproperty:put (1- (point)) (min (point) (point-max))
'(invisible t)))
(kfile:narrow-to-kcells)
(setq new-point (point))
(goto-char old-point)
;; Delete leading spaces used to get fill right in first cell
;; line. Replace it with label.
(delete-char thru-label)
(insert (format (format "%%%ds" (- thru-label (length label-separator)))
label))
(setq old-point (point))
(insert label-separator)
(goto-char old-point)
;; Add cell's attributes to the text property list at point.
(kproperty:set 'idstamp idstamp)
(kproperty:set 'kcell cell)
(goto-char new-point))))