Function: kotl-mode:add-prior-cell

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

Signature

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

Documentation

Add prior sibling cells to the current cell.

Optional prefix arg number of CELLS-TO-ADD defaults to 1. Given a single universal arg, \C-u, for CELLS-TO-ADD, add a single cell as the first child of the current cell's parent. Always return the last cell added.

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
(defun kotl-mode:add-prior-cell (&optional cells-to-add contents plist no-fill)
  "Add prior sibling cells to the current cell.
Optional prefix arg number of CELLS-TO-ADD defaults to 1.  Given
a single universal arg, \\`C-u', for CELLS-TO-ADD, add a single cell
as the first child of the current cell's parent.  Always return the
last cell added.

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))
  (if (equal cells-to-add '(4))
      (kotl-mode:add-below-parent)
    (setq cells-to-add (prefix-numeric-value cells-to-add))
    (unless (and (natnump cells-to-add) (/= cells-to-add 0))
      (error "(kotl-mode:add-prior-cell): `cells-to-add' must be a positive integer"))
    (cond ((zerop (kotl-mode:backward-cell 1))
	   ;; Add preceding sibling if not on first cell at current level
	   (kotl-mode:add-cell cells-to-add contents plist no-fill))
	  ((kotl-mode:up-level 1)
	   ;; Add preceding sibling cell when on first cell at
	   ;; current level other than level 1
	   (kotl-mode:add-child cells-to-add contents plist no-fill))
	  (t
	   ;; Add preceding sibling when on level 1 first cell
	   (kotl-mode:add-below-parent cells-to-add
				       contents plist no-fill)))))