emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Adr ien <aaa.brochard@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Positive experience with org-element API
Date: Mon, 6 Apr 2020 14:11:11 -0400	[thread overview]
Message-ID: <CAFw-fiB9B3ffptCCmN8ABhLG9u9+mjo39bMePVswsP9PHM=8AA@mail.gmail.com> (raw)

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

Hi everyone,
I just wanted to share a recent positive experience I had with org-mode,
specifically with org-mode parsing in elisp.

I maintain a package that allows users to write curl request in org mode
and execute them. At first, I defined a structure for that org entry that I
was parsing via a series of regex into an alist. But as features grew and
the structure evolved, it was becoming incredibly difficult and hacky to
parse that way. Thankfully, after spending a bit of time with the
org-element API doc and getting some much needed help on the IRC channel, I
was able to replace the hacky regex with a cleaner and more robust
mechanism taking full advantage of `org-element-map`.

In case you are interested in the code, you can see a sample org entry here:
and the parsing code here:

It definitely could me optimized but I am quite happy with it already.
Thanks again to everyone for the help and the doc!
Adrien Brochard

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

                 reply	other threads:[~2020-04-06 19:45 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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:

  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='CAFw-fiB9B3ffptCCmN8ABhLG9u9+mjo39bMePVswsP9PHM=8AA@mail.gmail.com' \
    --to=aaa.brochard@gmail.com \
    --cc=emacs-orgmode@gnu.org \


* 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


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