[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Extract source code /with/ captions
From: |
Nick Dokos |
Subject: |
Re: [O] Extract source code /with/ captions |
Date: |
Mon, 13 Jan 2014 13:01:08 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
[I sent a follow-up that has not shown up yet(?) but
perhaps this is more useful in any case]
James Harkins <address@hidden> writes:
> ELEMENT:
> (((#("25% coin toss in SuperCollider" 0 30 (:parent #2)))))
>
> This is correct, and I also see that I can use (plist-get ... :value)
> to get the code string.
>
> Here, I'm hung up on some (large?) gaps in my elisp knowledge. I have
> no idea what #(...) signifies, or what functions I can use to get the
> string out of it. "#" Is not an especially useful search term in
> google, bing etc...
>
> Can anyone help with my next step?
>
Try:
--8<---------------cut here---------------start------------->8---
(defun hjh-print-src-blocks ()
"Iterate src blocks from org-element and print them to *Messages*."
(interactive)
(let ((tree (org-element-parse-buffer)))
(org-element-map tree 'src-block
(lambda (element)
(message "\n\n\nELEMENT:")
(print (substring-no-properties (plist-get (car (cdr element))
:caption)))))))
--8<---------------cut here---------------end--------------->8---
Nick
Re: [O] Extract source code /with/ captions, Charles Berry, 2014/01/12