emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Positive experience with org-element API
@ 2020-04-06 18:11 Adr ien
  0 siblings, 0 replies; only message in thread
From: Adr ien @ 2020-04-06 18:11 UTC (permalink / raw)
  To: emacs-orgmode

[-- 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:
https://github.com/abrochard/walkman/blob/master/sample.org
and the parsing code here:
https://github.com/abrochard/walkman/blob/master/walkman.el#L148

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

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-04-06 19:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-06 18:11 Positive experience with org-element API Adr ien

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