[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Inserting tables programatically in elisp
From: |
Heime |
Subject: |
Re: Inserting tables programatically in elisp |
Date: |
Sat, 05 Nov 2022 09:20:40 +0000 |
------- Original Message -------
On Saturday, November 5th, 2022 at 8:49 AM, Ihor Radchenko
<yantar92@posteo.net> wrote:
> 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.
One could work as you say, but only if the calls do not rely on finding table
regions
and so on.
> > 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.
Correct. Thanks.
> 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.
I am discussing the use of tables beyond "org".