diff --git a/doc/org.texi b/doc/org.texi index b368c0e96..39bf88b1b 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 2e4efed04..d2fb264b1 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 d17b8bee6..822c20b67 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 2be77a87b..4d3d7afb9 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 9d5f1fedf..46ef51bab 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")