emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Get current table row data as list
@ 2022-10-05  4:17 Felix Dorner
  2022-10-05  4:43 ` Felix Dorner
  2022-10-05  5:15 ` Ihor Radchenko
  0 siblings, 2 replies; 3+ messages in thread
From: Felix Dorner @ 2022-10-05  4:17 UTC (permalink / raw)
  To: Org Mode List

[-- Attachment #1: Type: text/plain, Size: 549 bytes --]

When point is in a table, I can run (org-element-at-point) and get a
table-row:

table-row (:type standard :begin 4932 :end 5151 :contents-begin 4933
:contents-end 5150 :post-blank 0 :post-affiliated 4932 :parent (table
(:begin 4546 :end 6818 :type org :tblfm nil :contents-begin 4562
:contents-end 6816 :value nil :post-blank 2 :post-affiliated 4562 :name
secrets :parent nil))))

Is there a helper or another way so that I can get the elements of that row
as a list or do I have to extract the fields manually by walking over text?

Thanks,
Felix

[-- Attachment #2: Type: text/html, Size: 695 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Get current table row data as list
  2022-10-05  4:17 Get current table row data as list Felix Dorner
@ 2022-10-05  4:43 ` Felix Dorner
  2022-10-05  5:15 ` Ihor Radchenko
  1 sibling, 0 replies; 3+ messages in thread
From: Felix Dorner @ 2022-10-05  4:43 UTC (permalink / raw)
  To: Org Mode List

[-- Attachment #1: Type: text/plain, Size: 775 bytes --]

Okay I found org-table-get (line column), which is already very helpful.

On Wed, Oct 5, 2022 at 6:17 AM Felix Dorner <felix.dorner@gmail.com> wrote:

> When point is in a table, I can run (org-element-at-point) and get a
> table-row:
>
> table-row (:type standard :begin 4932 :end 5151 :contents-begin 4933
> :contents-end 5150 :post-blank 0 :post-affiliated 4932 :parent (table
> (:begin 4546 :end 6818 :type org :tblfm nil :contents-begin 4562
> :contents-end 6816 :value nil :post-blank 2 :post-affiliated 4562 :name
> secrets :parent nil))))
>
> Is there a helper or another way so that I can get the elements of that
> row as a list or do I have to extract the fields manually by walking over
> text?
>
> Thanks,
> Felix
>
>

-- 
Linux. The choice of a GNU generation.

[-- Attachment #2: Type: text/html, Size: 1292 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Get current table row data as list
  2022-10-05  4:17 Get current table row data as list Felix Dorner
  2022-10-05  4:43 ` Felix Dorner
@ 2022-10-05  5:15 ` Ihor Radchenko
  1 sibling, 0 replies; 3+ messages in thread
From: Ihor Radchenko @ 2022-10-05  5:15 UTC (permalink / raw)
  To: Felix Dorner; +Cc: Org Mode List

Felix Dorner <felix.dorner@gmail.com> writes:

> Is there a helper or another way so that I can get the elements of that row
> as a list or do I have to extract the fields manually by walking over text?

`org-element-context'.
See https://orgmode.org/worg/dev/org-element-api.html

-- 
Ihor Radchenko,
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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-10-05  5:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-05  4:17 Get current table row data as list Felix Dorner
2022-10-05  4:43 ` Felix Dorner
2022-10-05  5:15 ` Ihor Radchenko

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).