Function: kview:create
kview:create is a byte-compiled function defined in kview.el.
Signature
(kview:create BUFFER-NAME &optional ID-COUNTER TOP-CELL-ATTRIBUTES LABEL-TYPE LEVEL-INDENT LABEL-SEPARATOR LABEL-MIN-WIDTH BLANK-LINES LEVELS-TO-SHOW LINES-TO-SHOW)
Documentation
Return a new kview for BUFFER-NAME.
Optional ID-COUNTER is the maximum permanent id previously utilized in this outline. Optional LABEL-TYPE, LEVEL-INDENT, LABEL-SEPARATOR, LABEL-MIN-WIDTH, BLANK-LINES, LEVELS-TO-SHOW, and LINES-TO-SHOW may also be given; otherwise, default values are used.
See documentation of:
kview:default-label-type for LABEL-TYPE,
kview:default-level-indent for LEVEL-INDENT,
kview:default-label-separator for LABEL-SEPARATOR,
kview:default-label-min-width for LABEL-MIN-WIDTH,
kview:default-blank-lines for BLANK-LINES,
kview:default-levels-to-show for LEVELS-TO-SHOW,
kview:default-lines-to-show for LINES-TO-SHOW.
Source Code
;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/kotl/kview.el
(defun kview:create (buffer-name
&optional id-counter top-cell-attributes
label-type level-indent label-separator
label-min-width blank-lines levels-to-show lines-to-show)
"Return a new kview for BUFFER-NAME.
Optional ID-COUNTER is the maximum permanent id previously
utilized in this outline. Optional LABEL-TYPE, LEVEL-INDENT,
LABEL-SEPARATOR, LABEL-MIN-WIDTH, BLANK-LINES, LEVELS-TO-SHOW,
and LINES-TO-SHOW may also be given; otherwise, default values
are used.
See documentation of:
`kview:default-label-type' for LABEL-TYPE,
`kview:default-level-indent' for LEVEL-INDENT,
`kview:default-label-separator' for LABEL-SEPARATOR,
`kview:default-label-min-width' for LABEL-MIN-WIDTH,
`kview:default-blank-lines' for BLANK-LINES,
`kview:default-levels-to-show' for LEVELS-TO-SHOW,
`kview:default-lines-to-show' for LINES-TO-SHOW."
(let ((buf (get-buffer buffer-name)))
(cond ((null buf)
(error "(kview:create): No such buffer, `%s'" buffer-name))
((or (null id-counter) (= id-counter 0))
(setq id-counter 0))
((not (integerp id-counter))
(error "(kview:create): 2nd arg, `%s', must be an integer" id-counter)))
(set-buffer buf)
;; Don't recreate view if it exists.
(unless (and (boundp 'kotl-kview) (kview:is-p kotl-kview) (eq (kview:buffer kotl-kview) buf))
(make-local-variable 'kotl-kview)
;; Update cell count id-counter.
(setq top-cell-attributes (plist-put top-cell-attributes 'id-counter id-counter))
(setq kotl-kview
(list 'kview 'plist
(list 'view-buffer (current-buffer)
'top-cell
(kcell:create-top top-cell-attributes)
'label-type (or label-type kview:default-label-type)
'label-min-width (or label-min-width
kview:default-label-min-width)
'label-separator (or label-separator
kview:default-label-separator)
'label-separator-length
(length (or label-separator
kview:default-label-separator))
'level-indent (or level-indent
kview:default-level-indent)
'blank-lines
(or blank-lines kview:default-blank-lines)
'levels-to-show
(or levels-to-show kview:default-levels-to-show)
'lines-to-show
(or lines-to-show kview:default-lines-to-show))))
(kview:set-functions (or label-type kview:default-label-type)))
kotl-kview))