emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Joost Kremers <joostkremers@fastmail.fm>
To: Thorsten Jolitz <tjolitz@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Programmatically handling org files
Date: Mon, 12 Sep 2016 23:22:49 +0200	[thread overview]
Message-ID: <87sht4dd92.fsf@fastmail.fm> (raw)
In-Reply-To: <87fup5f07e.fsf@gmail.com>


On Mon, Sep 12 2016, Thorsten Jolitz wrote:
> by "non-org Emacs packages" you mean Emacs packages written in Elisp,
> but not part of Org-mode? 

Yes, exactly. My wording wasn't entirely clear, I admit.

> The org-mode parser converts an Org document into a nested list and
> provides many convenience functions to work on this parse tree. So
> org-element.el (and maybe ox.el too) is the core library for converting
> an Org text document into an Elisp data structure and working with that,

So IIUC org-element.el is mainly for getting the contents of an org
buffer in such a way that a program can work with it, but not really for
modifying the contents of the buffer itself in such a way that it's
still a valid org document, right?

> If you feel you don't need the whole parse tree, but rather want to act
> locally on the Org element at point,

Yes. :-)

> you might want to look at 
> org-dp.el

Cool, I will do that!

> with just two core functions (create and rewire an Org
> element) and a mapping functions (plus quite a few utilities in
> org-dp.el and org-dp-lib.el):

[snip example]

> Using this system, creating or rewiring an Org Element from Elisp
> requires only to define the values of the interpreted parameters, all
> the low level stuff (actually creating and inserting the new/modified
> element in text form) is left to the interpreters (from org-element.el).
>
> You just declare what you want and don't worry anymore how it is done
> (=> dp stands for declarative programming, in this context at least ;-)

That sounds pretty cool, thanks!

-- 
Joost Kremers
Life has its moments

  parent reply	other threads:[~2016-09-12 21:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-12 11:44 Programmatically handling org files Joost Kremers
2016-09-12 13:47 ` John Kitchin
2016-09-12 21:59   ` Joost Kremers
2016-09-12 18:21 ` Thorsten Jolitz
2016-09-12 18:30   ` John Kitchin
2016-09-12 21:37     ` Joost Kremers
2016-09-12 21:22   ` Joost Kremers [this message]
2016-09-12 22:10   ` Nick Dokos

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=87sht4dd92.fsf@fastmail.fm \
    --to=joostkremers@fastmail.fm \
    --cc=emacs-orgmode@gnu.org \
    --cc=tjolitz@gmail.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).