emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@posteo.net>
To: Heime <heimeborgia@protonmail.com>
Cc: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: Inserting tables programatically in elisp
Date: Sat, 05 Nov 2022 08:49:43 +0000	[thread overview]
Message-ID: <87y1spkcpk.fsf@localhost> (raw)
In-Reply-To: <ormzZI3RH_irS2cEIvdZQZFQsbW5xbRn6lqmjs4_oz7mtmwKFDyJi7-1Q4RWsH7gWn48qS89AVwJU6vWep1bBQO1bcXOdCCfRBJuMMF66UA=@protonmail.com>

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>


  reply	other threads:[~2022-11-05  8:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-05  7:41 Inserting tables programatically in elisp Heime
2022-11-05  8:49 ` Ihor Radchenko [this message]
2022-11-05  9:20   ` Heime
2022-11-05  9:02 ` Jean Louis
2022-11-05  9:26   ` Heime
2022-11-05 10:05     ` Jean Louis
2022-11-05 10:23     ` Jean Louis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y1spkcpk.fsf@localhost \
    --to=yantar92@posteo.net \
    --cc=emacs-orgmode@gnu.org \
    --cc=heimeborgia@protonmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).