[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Inserting tables programatically in elisp
From: |
Ihor Radchenko |
Subject: |
Re: Inserting tables programatically in elisp |
Date: |
Sat, 05 Nov 2022 08:49:43 +0000 |
Heime <heimeborgia@protonmail.com> writes:
> Have constructed this function, but the difficulty centers around
> the challenge of inserting text in specific tests.
>
> (defun make-table ()
> (interactive)
> (table-insert 4 5)
> (table-forward-cell)
> (table-insert-sequence "icomplt-horz" 1 1 1 'center)
> (table-forward-cell 4)
> (table-insert-sequence "icomplt-vert" 1 1 1 'center)
> (table-release))
>
> It might be that "table.el" was designed under the assumption that the table
> would
> be edited interactively rather than from ELisp. The lack of info may just
> reflect
> that nobody has thought about it making tables programatically that also goes
> beyond
> its utilisation in "org-mode".
You can call functions interactively from lisp, if needed.
> I understand that "Org" cooperates with its author Takaaki Ota, perhaps
> things could
> be extended in a way that makes inserting tables programatically much easier
> to work
> with.
Do you refer to things on table.el side? Then, you may have more luck
asking on emacs-devel list.
As for programmatically inserting native Org tables, you can always
construct table AST via org-element-create API and then insert it via
org-element-interpret-data.
--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>