From 9c6811b9d42199fd37f77b74a3a4b2bf17a820be Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Wed, 6 Apr 2016 22:26:08 +0200 Subject: [PATCH] ox-texinfo: Fix erroneous count of blank lines in menu * lisp/ox-texinfo.el (org-texinfo-section): (org-texinfo--build-menu): Normalize empty lines in generated menu. Reported-by: Jonas Bernoulli --- lisp/ox-texinfo.el | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lisp/ox-texinfo.el b/lisp/ox-texinfo.el index 610874b66..cd3e7ae1c 100644 --- a/lisp/ox-texinfo.el +++ b/lisp/ox-texinfo.el @@ -1113,7 +1113,7 @@ is an integer, build the menu recursively, down to this depth." (org-export-data (org-export-get-alt-title h info) info) (org-texinfo--format-entries entries info)) (org-texinfo--build-menu h info (1- level)))))) - (org-texinfo--menu-entries scope info) ""))))) + (org-texinfo--menu-entries scope info) "\n"))))) (defun org-texinfo--format-entries (entries info) "Format all direct menu entries in SCOPE, as a string. @@ -1295,9 +1295,11 @@ contextual information." "Transcode a SECTION element from Org to Texinfo. CONTENTS holds the contents of the section. INFO is a plist holding contextual information." - (concat contents - (let ((parent (org-export-get-parent-headline section))) - (and parent (org-texinfo-make-menu parent info))))) + (org-trim + (concat contents + "\n" + (let ((parent (org-export-get-parent-headline section))) + (and parent (org-texinfo-make-menu parent info)))))) ;;;; Special Block