Function: kimport:aug-post-outline
kimport:aug-post-outline is an autoloaded, interactive and
byte-compiled function defined in kimport.el.
Signature
(kimport:aug-post-outline IMPORT-FROM OUTPUT-TO &optional CHILDREN-FLAG)
Documentation
Insert Augment outline statements from IMPORT-FROM into koutline OUTPUT-TO.
Displays and leaves point in OUTPUT-TO. See documentation for kimport:initialize for valid values of IMPORT-FROM and OUTPUT-TO and for an explanation of where imported cells are placed.
If OUTPUT-TO is a new koutline, the first statement inserted will be the first cell. Otherwise, it will be the successor of the current cell.
Each statement to be imported is delimited by an Augment relative id at the end of the statement. "1" = level 1, "1a" = level 2 in outline and so on.
Key Bindings
Source Code
;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/kotl/kimport.el
;;; Augment right-side numbered files, blank line between cells
;;;
;;;###autoload
(defun kimport:aug-post-outline (import-from output-to &optional children-flag)
"Insert Augment outline statements from IMPORT-FROM into koutline OUTPUT-TO.
Displays and leaves point in OUTPUT-TO. See documentation for
`kimport:initialize' for valid values of IMPORT-FROM and OUTPUT-TO and for
an explanation of where imported cells are placed.
If OUTPUT-TO is a new koutline, the first statement inserted will be the
first cell. Otherwise, it will be the successor of the current cell.
Each statement to be imported is delimited by an Augment relative id at the
end of the statement. \"1\" = level 1, \"1a\" = level 2 in outline and so
on."
(interactive "FImport from Augment post-numbered buffer/file: \nFBuffer/file to insert cells into: \nP")
(let ((output-level 1) (klabel "1") (count 0)
max-pos-and-count initially-empty-output no-renumber orig-point total)
;; Don't change the order of import-from and output-to inits here.
(setq import-from (kimport:copy-and-set-buffer import-from)
output-to (kimport:initialize output-to t)
orig-point (point)
initially-empty-output (zerop (- (point-max) (point-min)))
no-renumber (or initially-empty-output
(not (if children-flag
(kcell-view:child-p)
(kcell-view:sibling-p)))))
(when (eq import-from output-to)
(error "(kimport:aug-post-outline): Import and output buffers may not be the same"))
(set-buffer import-from)
(outline-show-all)
(save-excursion
(goto-char (point-min))
;; Total number of Augment statements.
(setq total (count-matches " +\\([0-9][0-9a-z]*\\)\n\\(\n\\|\\'\\)"))
(unless initially-empty-output
;; Insert first cell as sibling of current cell.
(set-buffer output-to)
(cond (children-flag
;; Insert as children.
(setq klabel (klabel:child (kcell-view:label))
output-level (klabel:level klabel))
;; Move to end of this cell since cell insertion will
;; occur at point.
(goto-char (kcell-view:end)))
((string-empty-p (kcell-view:contents))
;; This is an unused cell, fill in from here.
(setq klabel (kcell-view:label)
output-level (klabel:level klabel))
(goto-char (kcell-view:start)))
(t ;; Insert as successors.
(setq klabel (klabel:increment (kcell-view:label))
output-level (klabel:level klabel))
;; Move to start of line of next tree since cell insertion
;; will occur at point.
(goto-char (kotl-mode:tree-end)))))
(setq max-pos-and-count (kimport:aug-post-statements
import-from output-to klabel
output-level 1 count total 0)
count (cdr max-pos-and-count)))
(pop-to-buffer output-to)
(kfile:narrow-to-kcells)
(unless no-renumber
(klabel-type:update-labels klabel))
(goto-char orig-point)
(unless (kotl-mode:buffer-empty-p)
(kotl-mode:to-valid-position))
(message "Imported %d of %d Augment statements." count total)))