emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Stefan Huchler <stefan.huchler@mail.de>
To: emacs-orgmode@gnu.org
Subject: Re: Multi-step ledger org-capture template
Date: Thu, 23 Aug 2018 13:37:03 +0200	[thread overview]
Message-ID: <87o9dtjov4.fsf@mail.de> (raw)
In-Reply-To: 87sh36j9vt.fsf@mail.de

Hmm I seem to be unable to access the data from the org-table.

org-element-map seems to be pretty poorly documented, I get the data but
in a strange format, (length row) returns 8 despite the table having
only 6 rows.

Also somehow I can't get to the data with cdr or nth or similar sequence
functions.

Is there some magic trick to get data (cells) from a org-table?


%(progn
   (with-current-buffer (org-capture-get :original-buffer)
     (call-interactively 'copy-region-as-kill))
   (with-temp-buffer
     "*deissenhof-import-temp*"
     (erase-buffer)
     (yank)
     (org-table-convert-region (buffer-end -1) (buffer-end 1) 2)
     (org-element-map (org-element-parse-buffer) 'table-row
       (lambda (row)
	 (print "ROW {{{{")
	 (print (length row))
	 (print "}}}} ROW"))
       nil t)
     (buffer-string)))

  reply	other threads:[~2018-08-23 11:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-21 11:45 Multi-step ledger org-capture template Stefan Huchler
2018-08-22 22:48 ` Stefan Huchler
2018-08-23 11:37   ` Stefan Huchler [this message]
2018-08-26 21:53     ` Stefan Huchler
2018-08-27  8:05       ` ST
2018-08-28  8:24         ` Neil Jerram

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=87o9dtjov4.fsf@mail.de \
    --to=stefan.huchler@mail.de \
    --cc=emacs-orgmode@gnu.org \
    /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).