summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2017-11-20 00:14:05 +0100
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2017-11-20 00:14:05 +0100
commitf482cfa7858c4fd9b6c9395eed5fface5484a12f (patch)
tree97b37d92ead5fd70d53805b7b37238f86a5a6b7b
parentb8d473a04fcf442fd4036c542521c9cb6f6bfa8d (diff)
parent82812ff086ccb54eb41cd2f1df3fedea3a709ab8 (diff)
downloadorg-mode-f482cfa7858c4fd9b6c9395eed5fface5484a12f.tar.gz
Merge branch 'maint'
-rw-r--r--doc/org.texi9
-rw-r--r--lisp/ox.el4
-rw-r--r--testing/lisp/test-ox.el18
3 files changed, 16 insertions, 15 deletions
diff --git a/doc/org.texi b/doc/org.texi
index e116a9b..babe7d6 100644
--- a/doc/org.texi
+++ b/doc/org.texi
@@ -10819,10 +10819,11 @@ Toggle inclusion of inlinetasks (@code{org-export-with-inlinetasks}).
@cindex property, UNNUMBERED
Toggle section-numbers (@code{org-export-with-section-numbers}). When set to
number @samp{n}, Org numbers only those headlines at level @samp{n} or above.
-Set @code{UNNUMBERED} property to non-@code{nil} to disable numbering of
-heading and subheadings entirely. Moreover, when the value is @samp{notoc}
-the headline, and all its children, do not appear in the table of contents
-either (@pxref{Table of contents}).
+Setting @code{UNNUMBERED} property to non-@code{nil} disables numbering of
+the heading. Since subheadings inherit from this property, it affects their
+numbering, too. Moreover, when the value is @samp{notoc}, the unnumbered
+headline does not appear in the table of contents either (@pxref{Table of
+contents}).
@item p:
@vindex org-export-with-planning
diff --git a/lisp/ox.el b/lisp/ox.el
index cc3c48b..d6add0a 100644
--- a/lisp/ox.el
+++ b/lisp/ox.el
@@ -3955,9 +3955,7 @@ INFO is a plist holding contextual information."
(defun org-export-numbered-headline-p (headline info)
"Return a non-nil value if HEADLINE element should be numbered.
INFO is a plist used as a communication channel."
- (unless (cl-some
- (lambda (head) (org-not-nil (org-element-property :UNNUMBERED head)))
- (org-element-lineage headline nil t))
+ (unless (org-not-nil (org-export-get-node-property :UNNUMBERED headline t))
(let ((sec-num (plist-get info :section-numbers))
(level (org-export-get-relative-level headline info)))
(if (wholenump sec-num) (<= level sec-num) sec-num))))
diff --git a/testing/lisp/test-ox.el b/testing/lisp/test-ox.el
index fa5ee6a..74ac2de 100644
--- a/testing/lisp/test-ox.el
+++ b/testing/lisp/test-ox.el
@@ -2474,11 +2474,11 @@ Para2"
(org-export-numbered-headline-p
(org-element-map tree 'headline #'identity info t)
info)))
- ;; UNNUMBERED ignores inheritance. Any non-nil value among
- ;; ancestors disables numbering.
+ ;; UNNUMBERED is inherited.
(should
- (org-test-with-parsed-data
- "* H
+ (equal '(unnumbered numbered unnumbered)
+ (org-test-with-parsed-data
+ "* H
:PROPERTIES:
:UNNUMBERED: t
:END:
@@ -2486,10 +2486,12 @@ Para2"
:PROPERTIES:
:UNNUMBERED: nil
:END:
-*** H3"
- (cl-every
- (lambda (h) (not (org-export-numbered-headline-p h info)))
- (org-element-map tree 'headline #'identity info)))))
+** H3"
+ (org-element-map tree 'headline
+ (lambda (h)
+ (if (org-export-numbered-headline-p h info) 'numbered
+ 'unnumbered))
+ info)))))
(ert-deftest test-org-export/number-to-roman ()
"Test `org-export-number-to-roman' specifications."