Function: kotl-mode:add-child

kotl-mode:add-child is an interactive and byte-compiled function defined in kotl-mode.el.

Signature

(kotl-mode:add-child &optional CELLS-TO-ADD CONTENTS PLIST NO-FILL)

Documentation

Add new cells as children of the current cell.

Return the last one added.

Optional prefix arg number of CELLS-TO-ADD defaults to 1. Add new cells with optional CONTENTS string, attributes in PLIST, a property list, and NO-FILL flag to prevent any filling of CONTENTS.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/kotl/kotl-mode.el
;;; ------------------------------------------------------------------------
;;; Structure Editing
;;; ------------------------------------------------------------------------

(defun kotl-mode:add-child (&optional cells-to-add contents plist no-fill)
  "Add new cells as children of the current cell.
Return the last one added.

Optional prefix arg number of CELLS-TO-ADD defaults to 1.  Add
new cells with optional CONTENTS string, attributes in PLIST, a
property list, and NO-FILL flag to prevent any filling of
CONTENTS."
  (interactive "*p")
  (when (null cells-to-add) (setq cells-to-add 1))
  (unless (and (natnump cells-to-add) (/= cells-to-add 0))
    (error "(kotl-mode:add-child): `cells-to-add' must be a positive integer"))
  ;; Add first cell as a child and then any more as siblings of that one
  (let ((last-added-cell (kotl-mode:add-cell '(4) contents plist no-fill)))
    (if (> (setq cells-to-add (1- cells-to-add)) 0)
	(kotl-mode:add-cell cells-to-add contents plist no-fill)
      last-added-cell)))