emacs-orgmode
[Top][All Lists]
Advanced

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

[O] how to print org-element of type paragraph as a string?


From: Myles English
Subject: [O] how to print org-element of type paragraph as a string?
Date: Tue, 10 Dec 2013 00:23:55 +0000

Hello,

This should be an easy question for someone.  Given the org file
content below, how would you get the result or the source block to be
"here are the contents"?

Thanks,
Myles

* heading
here are the contents

#+begin_src elisp :results output
(dolist
      (job (org-element-map (org-element-parse-buffer) 'paragraph 'identity))
(print (car (org-element-contents job))))
#+end_src

#+RESULTS:
:
: #("here are the contents
: " 0 22 (:parent (paragraph (:begin 11 :end 34 :contents-begin 11
:contents-end 33 :post-blank 1 :post-affiliated 11 :parent (section
(:begin 11 :end 225 :contents-begin 11 :contents-end 224 :post-blank 1
:parent (headline (:raw-value "heading" :begin 1 :end 225 :pre-blank 0
:contents-begin 11 :contents-end 224 :level 1 :priority nil :tags nil
:todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil
:archivedp nil :commentedp nil :quotedp nil :CATEGORY nil :title
(#("heading" 0 7 (:parent #6))) :parent (org-data nil #6)) #4)) #2
(src-block (:language "elisp" :switches nil :parameters ":results
output" :begin 34 :end 207 :number-lines nil :preserve-indent nil
:retain-labels t :use-labels t :label-fmt nil :value "(dolist
:       (job (org-element-map (org-element-parse-buffer) 'paragraph 'identity))
: (print (car (org-element-contents job))))
: " :post-blank 1 :post-affiliated 34 :parent #4)) (fixed-width
(:begin 207 :end 224 :value "nil
: " :post-blank 0 :post-affiliated 218 :results ("") :parent #4)))) #0)))



reply via email to

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