From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Extract source code /with/ captions Date: Mon, 13 Jan 2014 13:01:08 -0500 Message-ID: <87d2jvn4m3.fsf@alphaville.bos.redhat.com> References: <3cbde2bd-2dba-4c2f-85b7-62fd2a9daffc@dewdrop-world.net> <87ob3fn75e.fsf@alphaville.bos.redhat.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56682) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W2lpK-0000cZ-3Z for emacs-orgmode@gnu.org; Mon, 13 Jan 2014 13:01:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W2lpC-0005AB-PR for emacs-orgmode@gnu.org; Mon, 13 Jan 2014 13:01:30 -0500 Received: from plane.gmane.org ([80.91.229.3]:38843) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W2lpC-0005A5-Iu for emacs-orgmode@gnu.org; Mon, 13 Jan 2014 13:01:22 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1W2lp8-0001gS-Ub for emacs-orgmode@gnu.org; Mon, 13 Jan 2014 19:01:18 +0100 Received: from nat-pool-bos-t.redhat.com ([66.187.233.206]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 13 Jan 2014 19:01:18 +0100 Received: from ndokos by nat-pool-bos-t.redhat.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 13 Jan 2014 19:01:18 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org [I sent a follow-up that has not shown up yet(?) but perhaps this is more useful in any case] James Harkins 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