From f051d663ab45b8bc26a98768d9287b74827e240f Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Thu, 10 Sep 2015 09:32:58 +0200 Subject: [PATCH] ox: Ignore statistics cookies with stat:nil * lisp/ox.el (org-export--prune-tree): Fix bug preventing pruning within secondary strings. * testing/lisp/test-ox.el (test-org-export/handle-options): Update test. Reported-by: Thomas S. Dye --- lisp/ox.el | 11 +++++------ testing/lisp/test-ox.el | 4 ++-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/lisp/ox.el b/lisp/ox.el index 4d288d22e..bfdfebab0 100644 --- a/lisp/ox.el +++ b/lisp/ox.el @@ -2631,13 +2631,12 @@ from tree." ;; If headline is archived but tree below has to ;; be skipped, remove contents. (org-element-set-contents data) - ;; Move into secondary string, if any. - (let ((sec-prop - (cdr (assq type org-element-secondary-value-alist)))) - (when sec-prop - (mapc walk-data (org-element-property sec-prop data)))) ;; Move into recursive objects/elements. - (mapc walk-data (org-element-contents data))))))))) + (mapc walk-data (org-element-contents data))) + ;; Move into secondary string, if any. + (dolist (p (cdr (assq type + org-element-secondary-value-alist))) + (mapc walk-data (org-element-property p data))))))))) ;; If a select tag is active, also ignore the section before the ;; first headline, if any. (when selected diff --git a/testing/lisp/test-ox.el b/testing/lisp/test-ox.el index a8b120d23..ccffa8942 100644 --- a/testing/lisp/test-ox.el +++ b/testing/lisp/test-ox.el @@ -595,11 +595,11 @@ Paragraph" nil nil nil '(:with-properties ("B")))))) ;; Statistics cookies. (should - (equal "" + (equal "* Stats" (let (org-export-filter-body-functions org-export-filter-final-output-functions) (org-trim - (org-test-with-temp-text "[0/0]" + (org-test-with-temp-text "* Stats [0/0]" (org-export-as (org-test-default-backend) nil nil nil '(:with-statistics-cookies nil))))))) ;; Tables.