From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thorsten Jolitz Subject: Re: org-export: how to copy the parsed tree? Date: Sat, 01 Mar 2014 09:45:23 +0100 Message-ID: <87r46m489o.fsf@gmail.com> References: <87wqgeemto.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58514) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WJfXG-0007vw-4D for emacs-orgmode@gnu.org; Sat, 01 Mar 2014 03:44:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WJfX8-0007bN-RE for emacs-orgmode@gnu.org; Sat, 01 Mar 2014 03:44:42 -0500 Received: from plane.gmane.org ([80.91.229.3]:33475) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WJfX8-0007b5-KM for emacs-orgmode@gnu.org; Sat, 01 Mar 2014 03:44:34 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1WJfX7-0006FR-Eb for emacs-orgmode@gnu.org; Sat, 01 Mar 2014 09:44:33 +0100 Received: from e178063227.adsl.alicedsl.de ([85.178.63.227]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 01 Mar 2014 09:44:33 +0100 Received: from tjolitz by e178063227.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 01 Mar 2014 09:44:33 +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 Vitalie Spinu writes: > Is there an easy way to copy org sub-tree in :filter-parse-tree? > > The structure of the parsed tree is somewhat complicated with recursive > references to parents in multiple places. So, copy-tree infloops. You will get a better answer most likely, but with (org-no-properties contents) you can get the original Org-syntax of a parse-tree element, e.g. applied to all sections (untested): ,---------------------------------------------------------------- | (defun org-myexp-section (section contents info) | "Transcode SECTION element into myexp syntax. | CONTENTS is its contents, as a string or nil. INFO is ignored." | (if (and contents (stringp contents) (> (length contents) 0)) | (format "%S" | (org-no-properties contents)) | "")) `---------------------------------------------------------------- -- cheers, Thorsten