Browse Source

ox-texinfo: Move menu handling from sections to headlines

* lisp/ox-texinfo.el (org-texinfo-headline): Move menu handling from
  sections to headlines.
Nicolas Goaziou 7 years ago
parent
commit
988e8802a6
1 changed files with 6 additions and 8 deletions
  1. 6 8
      lisp/ox-texinfo.el

+ 6 - 8
lisp/ox-texinfo.el

@@ -896,7 +896,8 @@ holding contextual information."
 	 (t
 	  (concat (format "@node %s\n" (org-texinfo--get-node headline info))
 		  (format section-fmt full-text)
-		  contents)))))))
+		  contents "\n"
+		  (org-texinfo-make-menu headline info))))))))
 
 (defun org-texinfo-format-headline-default-function
   (todo _todo-type priority text tags)
@@ -1359,14 +1360,11 @@ contextual information."
 
 ;;;; Section
 
-(defun org-texinfo-section (section contents info)
+(defun org-texinfo-section (section contents _info)
   "Transcode a SECTION element from Org to Texinfo.
-CONTENTS holds the contents of the section.  INFO is a plist
-holding contextual information."
-  (let ((parent (org-export-get-parent-headline section)))
-    (when parent			;ignore very first section
-      (org-trim
-       (concat contents "\n" (org-texinfo-make-menu parent info))))))
+CONTENTS holds the contents of the section."
+  (and (org-export-get-parent-headline section) ;ignore first section
+       contents))
 
 ;;;; Special Block