I've been struggling with the basic org-element-parse-buffer
(see here) usage. Specifically, how do I make it work? It's not interactive, so it has to be called from within an org-mode buffer, I'm guessing in a source code block. I try this solution:
#+begin_src emacs-lisp
(let ((parsetree (org-element-parse-buffer 'headline)))
(org-element-map parsetree 'headline
(lambda (hl) (org-element-property :title hl))))
#+end_src
#+RESULTS:
| JANUARY | 2018-01-23T16:54:53 | 2018-01-23T19:37:21 | 2018-01-24T02:37:07 |
and get the results in a results table format. Good. But how do I get the whole buffer as an AST (one big nested list) as advertised?
#+begin_src emacs-lisp
(org-element-parse-buffer)
#+end_src
I get org-babel-insert-result: Wrong type argument: markerp, nil
I still have hope that some year I'll be productive with Emacs/org-mode....
ESC ESC : (org-element-parse-buffer)RET
(the easiest method in this case, although adding a code block is fine as well); or typing the Lisp expression to call the function (possibly) with arguments in the*scratch*
buffer and typingC-j
after it:(<func> <arg1> ....) C-j
; or typing the same expression in anemacs-lisp-mode
buffer and then usingC-x C-e
(bound toeval-last-sexp
) to evaluate it. Neither of the last two methods can be used fororg-element-parser
because it assumes that it is operating on the ...