summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2017-09-21 21:08:36 +0200
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2017-09-21 21:14:41 +0200
commitad0662bbe7cff0e9270bd58067a87fb1d4b1c1d8 (patch)
tree196b0915b91c05eff50e85e5db023016e8510226
parent2faebbd2f038bdd98040037f7f4ac9d5e9f1c22b (diff)
downloadorg-mode-ad0662bbe7cff0e9270bd58067a87fb1d4b1c1d8.tar.gz
Revert "Table of contents ignore unnumbered headlines"
This reverts commit bd2378161e76932103c9ef1f8343ffcc0d275007.
-rw-r--r--doc/org.texi7
-rw-r--r--etc/ORG-NEWS6
-rw-r--r--lisp/ox-texinfo.el10
-rw-r--r--lisp/ox.el5
-rw-r--r--testing/lisp/test-ox.el10
5 files changed, 11 insertions, 27 deletions
diff --git a/doc/org.texi b/doc/org.texi
index b368c0e..39bf88b 100644
--- a/doc/org.texi
+++ b/doc/org.texi
@@ -10899,10 +10899,11 @@ settings that cannot be changed using keywords.
@cindex list of tables
@cindex list of listings
+@cindex: @samp{toc} in OPTIONS keyword
@vindex org-export-with-toc
-The table of contents includes all @emph{numbered} headlines in the document.
-Its depth is therefore the same as the headline levels in the file. If you
-need to use a different depth, or turn it off entirely, set the
+The table of contents includes all headlines in the document. Its depth is
+therefore the same as the headline levels in the file. If you need to use
+a different depth, or turn it off entirely, set the
@code{org-export-with-toc} variable accordingly. You can achieve the same on
a per file basis, using the following @samp{toc} item in @samp{#+OPTIONS}
keyword:
diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 2e4efed..d2fb264 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -12,12 +12,6 @@ Please send Org bug reports to mailto:emacs-orgmode@gnu.org.
* Version 9.2
** Incompatible changes
-*** Table of contents ignore unnumbered headlines
-
-This allows finer control over the table of contents itself, using,
-e.g., =UNNUMBERED= property. It is also more consistent with LaTeX
-export.
-
*** =align= STARTUP value no longer narrow table columns
Columns narrowing (or shrinking) is now dynamic. See [[*Dynamically
diff --git a/lisp/ox-texinfo.el b/lisp/ox-texinfo.el
index d17b8be..822c20b 100644
--- a/lisp/ox-texinfo.el
+++ b/lisp/ox-texinfo.el
@@ -146,10 +146,10 @@ If nil it will default to `buffer-file-coding-system'."
(defcustom org-texinfo-classes
'(("info"
"@documentencoding AUTO\n@documentlanguage AUTO"
- ("@chapter %s" "@chapheading %s" "@appendix %s")
- ("@section %s" "@heading %s" "@appendixsec %s")
- ("@subsection %s" "@subheading %s" "@appendixsubsec %s")
- ("@subsubsection %s" "@subsubheading %s" "@appendixsubsubsec %s")))
+ ("@chapter %s" "@unnumbered %s" "@appendix %s")
+ ("@section %s" "@unnumberedsec %s" "@appendixsec %s")
+ ("@subsection %s" "@unnumberedsubsec %s" "@appendixsubsec %s")
+ ("@subsubsection %s" "@unnumberedsubsubsec %s" "@appendixsubsubsec %s")))
"Alist of Texinfo classes and associated header and structure.
If #+TEXINFO_CLASS is set in the buffer, use its value and the
associated information. Here is the structure of a class
@@ -193,7 +193,7 @@ of strings is specified. A %s formatter is mandatory in each
section string and will be replaced by the title of the section."
:group 'org-export-texinfo
:version "26.1"
- :package-version '(Org . "9.2")
+ :package-version '(Org . "9.1")
:type '(repeat
(list (string :tag "Texinfo class")
(string :tag "Texinfo header")
diff --git a/lisp/ox.el b/lisp/ox.el
index 2be77a8..4d3d7af 100644
--- a/lisp/ox.el
+++ b/lisp/ox.el
@@ -5214,7 +5214,7 @@ there is no such headline, collect all headlines. In any case,
argument N becomes relative to the level of that headline.
Return a list of all exportable headlines as parsed elements.
-Footnote sections and unnumbered headlines are ignored."
+Footnote sections are ignored."
(let* ((scope (cond ((not scope) (plist-get info :parse-tree))
((eq (org-element-type scope) 'headline) scope)
((org-export-get-parent-headline scope))
@@ -5226,8 +5226,7 @@ Footnote sections and unnumbered headlines are ignored."
limit))))
(org-element-map (org-element-contents scope) 'headline
(lambda (headline)
- (unless (or (org-element-property :footnote-section-p headline)
- (not (org-export-numbered-headline-p headline info)))
+ (unless (org-element-property :footnote-section-p headline)
(let ((level (org-export-get-relative-level headline info)))
(and (<= level n) headline))))
info)))
diff --git a/testing/lisp/test-ox.el b/testing/lisp/test-ox.el
index 9d5f1fe..46ef51b 100644
--- a/testing/lisp/test-ox.el
+++ b/testing/lisp/test-ox.el
@@ -4314,16 +4314,6 @@ Another text. (ref:text)
(org-test-with-parsed-data "* H1\n** Footnotes"
(mapcar (lambda (h) (org-element-property :raw-value h))
(org-export-collect-headlines info))))))
- ;; Do not collect unnumbered headlines.
- (should-not
- (org-test-with-parsed-data "#+options: num:nil\n* H1\n** H2"
- (org-export-collect-headlines info)))
- (should
- (equal '("H1")
- (org-test-with-parsed-data
- "* H1\n** H2\n:PROPERTIES:\n:UNNUMBERED: t\n:END:"
- (mapcar (lambda (h) (org-element-property :raw-value h))
- (org-export-collect-headlines info)))))
;; Collect headlines locally.
(should
(equal '("H2" "H3")