Function: kfile:read

kfile:read is a byte-compiled function defined in kfile.el.

Signature

(kfile:read BUFFER EXISTING-FILE-FLAG &optional VER-STRING)

Documentation

Create a new kotl view by reading BUFFER.

Create an empty view when EXISTING-FILE-FLAG is nil. Optional VER-STRING is the outline format version number for the BUFFER that was previously read by calling kfile:is-p.

Return the new view.

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/kotl/kfile.el
(defun kfile:read (buffer existing-file-flag &optional ver-string)
  "Create a new kotl view by reading BUFFER.
Create an empty view when EXISTING-FILE-FLAG is nil.  Optional
VER-STRING is the outline format version number for the BUFFER
that was previously read by calling `kfile:is-p'.

Return the new view."
  (cond ((not (bufferp buffer))
	 (error "(kfile:read): Argument must be a buffer, `%s'" buffer))
	((and (zerop (buffer-size)) (not existing-file-flag))
	 (kfile:create buffer))
	((progn
	   (set-buffer buffer)
	   (not (or (stringp ver-string) (setq ver-string (kfile:is-p)))))
	 (error "(kfile:read): `%s' is not a koutline file" buffer))
	((equal ver-string "Kotl-4.0")
	 (kfile:read-v4-or-v3 buffer nil))
	((equal ver-string "Kotl-3.0")
	 (kfile:read-v4-or-v3 buffer t))
	((equal ver-string "Kotl-2.0")
	 (kfile:read-v2 buffer))
	((equal ver-string "Kotl-1.0")
	 (error "(kfile:read): V1 koutlines are no longer supported"))
	(t (error "(kfile:read): `%s' has unknown kotl version, %s"
		  buffer ver-string))))