Browse Source

Revert "Table of contents ignore unnumbered headlines"

This reverts commit bd2378161e76932103c9ef1f8343ffcc0d275007.
Nicolas Goaziou 10 months ago
parent
commit
ad0662bbe7
5 changed files with 11 additions and 27 deletions
  1. 4 3
      doc/org.texi
  2. 0 6
      etc/ORG-NEWS
  3. 5 5
      lisp/ox-texinfo.el
  4. 2 3
      lisp/ox.el
  5. 0 10
      testing/lisp/test-ox.el

+ 4 - 3
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:

+ 0 - 6
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

+ 5 - 5
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")

+ 2 - 3
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)))

+ 0 - 10
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")