From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jonas Bernoulli Subject: Re: ox-texinfo: empty line before "* Menu:" is missing Date: Wed, 06 Apr 2016 20:57:43 +0200 Message-ID: <87vb3uh8ew.fsf@bernoul.li> References: <87wpoahbh4.fsf@bernoul.li> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42235) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1anseF-0008Hj-BJ for emacs-orgmode@gnu.org; Wed, 06 Apr 2016 14:57:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1anseB-0005Fh-9i for emacs-orgmode@gnu.org; Wed, 06 Apr 2016 14:57:51 -0400 Received: from mail.hostpark.net ([212.243.197.30]:59924) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1anseB-0005DV-1f for emacs-orgmode@gnu.org; Wed, 06 Apr 2016 14:57:47 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.hostpark.net (Postfix) with ESMTP id BE94516B42 for ; Wed, 6 Apr 2016 20:57:43 +0200 (CEST) Received: from mail.hostpark.net ([127.0.0.1]) by localhost (mail1.hostpark.net [127.0.0.1]) (amavisd-new, port 10124) with ESMTP id HECXNFYXMRHk for ; Wed, 6 Apr 2016 20:57:43 +0200 (CEST) Received: from hal (80-218-86-217.dclient.hispeed.ch [80.218.86.217]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.hostpark.net (Postfix) with ESMTPSA id 9241D16B41 for ; Wed, 6 Apr 2016 20:57:43 +0200 (CEST) In-reply-to: <87wpoahbh4.fsf@bernoul.li> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org The related `org-texinfo--build-menu' has a similar issue. Unlike `org-texinfo-make-menu' which may end up not inserting a newline when it should, it may end up removing a newline when it should not. Given this Org file: #+TITLE: Demo2 Manual #+TEXINFO_DIR_CATEGORY: Emacs #+TEXINFO_DIR_TITLE: Demo2: (demo2). #+TEXINFO_DIR_DESC: Demo2. =20 * chapter ends with subsection =20 ** section =20 *** subsection =20 * chapter ends with section =20 ** just a section =20 * another chapter we end up with an info file containing * subsection:: chapter ends with section but there should be an empty line between these two lines. This only happens if the preceeding chapter ends with a subsection. If that ends with section then everything is good. There might be other instances where `org-texinfo--build-menu' removes to much whitespace. My suggestion is to remove `org-element-normalize-string' from `org-texinfo--build-menu'. Again this change might result in some insignificant whitespace not being removed and again that is better than removing significant whitespace. Without doing this the detailed note listing would look like this: =E2=80=94 The Detailed Node Listing =E2=80=94 =20 chapter ends with subsection # bold =20 * section:: # empty line follows =20 section # bold =20 * subsection:: # no empty line follows chapter ends with section # not bold =20 * just a section: Ps: In both cases you might find better solutions which not only never omit necessary whitespace but also never keep/add unnecessary whitespace. But for me just not removing/not adding necessary whitespace would be good enough and I believe that the changes I have suggested accomplish that.