Function: kview:insert-contents
kview:insert-contents is a byte-compiled function defined in kview.el.
Signature
(kview:insert-contents KCELL CONTENTS NO-FILL CELL-FILL-PREFIX)
Documentation
Insert KCELL's CONTENTS into view at point and fill resulting paragraphs.
Do not fill if NO-FILL is non-nil. CELL-FILL-PREFIX is the indentation string for the current cell. If CONTENTS is nil, get contents from the cell at point. Return contents inserted (this value may differ from the value passed in) due to filling.
Source Code
;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/kotl/kview.el
(defun kview:insert-contents (kcell contents no-fill cell-fill-prefix)
"Insert KCELL's CONTENTS into view at point and fill resulting paragraphs.
Do not fill if NO-FILL is non-nil.
CELL-FILL-PREFIX is the indentation string for the current cell. If
CONTENTS is nil, get contents from the cell at point. Return contents
inserted (this value may differ from the value passed in) due to
filling."
(let ((start (point))
end)
(setq contents (or contents ""))
(insert contents)
;;
;; Delete any extra newlines at end of cell contents.
(setq end (point))
(skip-chars-backward "\n\r")
(delete-region (point) end)
(setq end (point))
;;
(save-restriction
(if no-fill
;; Insert proper indent in all but the first line which has
;; already been indented.
(progn
(narrow-to-region start end)
(goto-char (point-min))
(while (re-search-forward "[\n\r]" nil t)
(insert cell-fill-prefix))
(goto-char (point-max)))
;;
;; Filling cell will insert proper indent on all lines.
(unless (equal contents "")
(goto-char start)
(beginning-of-line)
(narrow-to-region (point) end)
;; Add cell-fill-prefix to all but paragraph separator lines, so
;; filling is done properly.
(while (re-search-forward "[\n\r][^\n\r]" nil t)
(forward-char -1) (insert cell-fill-prefix))
(kview:fill-region start end kcell)
(goto-char (point-min))
;; Now add cell-fill-prefix to paragraph separator lines.
(while (re-search-forward "[\n\r][\n\r]" nil t)
(forward-char -1) (insert cell-fill-prefix))
;;
(goto-char (point-max))))))
contents)