emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: official orgmode parser


From: tomas
Subject: Re: official orgmode parser
Date: Wed, 16 Sep 2020 14:20:30 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

On Wed, Sep 16, 2020 at 02:09:42PM +0200, Przemysław Kamiński wrote:

[...]

> So I looked at (pp (org-element-parse-buffer)) however it does print
> out recursive stuff which other schemes have trouble parsing.
> 
> My code looks more or less like this:
> 
> (defun org-parse (f)
>   (with-temp-buffer
>     (find-file f)
>     (let* ((parsed (org-element-parse-buffer))
>            (all (append org-element-all-elements org-element-all-objects))
>            (mapped (org-element-map parsed all
>                      (lambda (item)
>                        (strip-parent item)))))
>       (pp mapped))))

Actually I'd tend to not modify the result, but to walk
it.

See `pcase' for a powerful pattern matcher which might
help you there.

Cheers
 - t

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]