From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex =?utf-8?Q?Benn=C3=A9e?= Subject: Advice for debugging org-export Date: Mon, 14 May 2018 16:09:48 +0100 Message-ID: <871seegtoj.fsf@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60929) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fIF6q-00042E-FQ for emacs-orgmode@gnu.org; Mon, 14 May 2018 11:09:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fIF6m-0001NG-5a for emacs-orgmode@gnu.org; Mon, 14 May 2018 11:09:56 -0400 Received: from mail-wr0-x231.google.com ([2a00:1450:400c:c0c::231]:47047) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fIF6l-0001Mn-UJ for emacs-orgmode@gnu.org; Mon, 14 May 2018 11:09:52 -0400 Received: by mail-wr0-x231.google.com with SMTP id a12-v6so12718943wrn.13 for ; Mon, 14 May 2018 08:09:51 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id a139-v6sm8752947wma.43.2018.05.14.08.09.49 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 14 May 2018 08:09:49 -0700 (PDT) Received: from zen (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTPS id F2DAE3E0335 for ; Mon, 14 May 2018 16:09:48 +0100 (BST) 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" To: emacs-orgmode@gnu.org Hi, I find debugging my exporters for org-mode a real pain. Consider the following: #+name: get-task-list-as-exported-text #+begin_src emacs-lisp :exports code (defun my-filter-out-done-lines (s backend info) "Filter out lines ending in :done" (apply 'concat (--remove (s-matches? (rx ":done" (zero-or-more blank) eol) it) (s-slice-at (rx bol "-") s)))) (defun my-filter-out-old-completed-todos (s backend info) "Filter out DONE items if they where completed over a week ago." (setq my-debug-items (add-to-list 'my-debug-items (list s backend info))) s) (org-export-define-derived-backend 'my-status-report 'ascii :options-alist '((:with-todo-keywords nil) (:num nil)) :filters-alist '((:filter-plain-list . my-filter-out-done-lines) (:filter-headline . my-filter-out-old-completed-todos))) ;; Snarf the weeks activities (save-excursion (goto-char (point-min)) (when (re-search-forward "* Tasks") (goto-char (match-beginning 0)) (org-export-as 'my-status-report t nil t ))) #+end_src When I poke around in my-debug-items to work out the correct furtling I need to do I inevitably lock up Emacs as the pretty printer struggles to dump the entire org AST in :parent. Is there anyway of suppressing the :parent and associated data so I can just concentrate on the data for the actual node I have? -- Alex Benn=C3=A9e