Function: kimport:file

kimport:file is an autoloaded, interactive and byte-compiled function defined in kimport.el.

Signature

(kimport:file IMPORT-FROM OUTPUT-TO &optional CHILDREN-FLAG)

Documentation

Import a buffer or file IMPORT-FROM into a koutline in buffer or file OUTPUT-TO.

Any suffix in IMPORT-FROM's buffer name is used to determine the type of importation. All others are imported as text, one paragraph per cell.

See the documentation for the variable, kimport:suffix-alist for information on specific importation formats.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/kotl/kimport.el
;;; ************************************************************************
;;; Public functions
;;; ************************************************************************

;;;###autoload
(defun kimport:file (import-from output-to &optional children-flag)
  "Import a buffer or file IMPORT-FROM into a koutline in buffer or file OUTPUT-TO.

Any suffix in IMPORT-FROM's buffer name is used to determine the type of
importation.  All others are imported as text, one paragraph per cell.

See the documentation for the variable, `kimport:suffix-alist' for
information on specific importation formats."
  (interactive "FImport from buffer/file: \nFInsert into koutline buffer/file: \nP")
  (let ((import-buf-name
	 (cond ((or (bufferp import-from)
		    (get-buffer import-from))
		(buffer-name (get-buffer import-from)))
	       ((get-file-buffer import-from)
		(buffer-name (get-file-buffer import-from)))
	       ((stringp import-from)
		(file-name-nondirectory import-from))
	       (t (error "(kimport:buffer): `%s' is an invalid `import-from' argument"
			 import-from))))
	(function))
    (set-buffer import-buf-name)
    (unless (setq function (cdr (assq major-mode kimport:mode-alist)))
      (let ((import-suffix (when (string-match "\\.[^.]+\\'" import-buf-name)
			     (match-string 0 import-buf-name))))
	(setq function (or (cdr (assoc import-suffix kimport:suffix-alist))
			   (cdr (assq t kimport:mode-alist))))))
    (when hkey-debug
      (message "(kimport:file): Buffer: %s; Import-Function: %s"
	       import-buf-name function))
    (funcall function import-from output-to children-flag)))