From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rick Frankel Subject: [BUG] Inserting new heading Date: Wed, 15 Mar 2017 10:24:33 -0400 Message-ID: <20170315142432.3md5z6yhdymbryck@eyeBook> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36924) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1co9rP-0007jW-Vl for emacs-orgmode@gnu.org; Wed, 15 Mar 2017 10:25:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1co9rM-0001BG-R4 for emacs-orgmode@gnu.org; Wed, 15 Mar 2017 10:25:07 -0400 Received: from mail.cybercode.nyc ([45.55.183.129]:60497) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1co9rM-0001At-LC for emacs-orgmode@gnu.org; Wed, 15 Mar 2017 10:25:04 -0400 Received: from authenticated-user (mail.cybercode.nyc [45.55.183.129]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.cybercode.nyc (Postfix) with ESMTPSA id 811B21400E2 for ; Wed, 15 Mar 2017 10:24:33 -0400 (EDT) Content-Disposition: inline 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" To: emacs-orgmode@gnu.org There is a bug w/ inserting new headings after a collapsed heading (w/ C-return, org-insert-heading-respect-content) if the last content under the heading (or a subhead) is a RESULTS: block. This occurs w/ the value of org-blank-before-new-entry as either '(heading . auto) or '(heading . nil). This started a few months ago, but I just figured out what actually causes the behavior. Given the following org file: -------------------------- * C-return tests ** Results w/ ending blank line removed #+BEGIN_SRC sh echo 'foo' #+END_SRC #+RESULTS: : foo ** Results w/ ending blank line #+BEGIN_SRC sh echo 'foo' #+END_SRC #+RESULTS: : foo ** A heading ------------------------------ Steps to reproduce: For "Correct" (expected) results: 1. Collapse all the headings. 2. Place the cursor On the line "Results w/ ending blank line removed". 3. Hit (org-insert-heading-respect-content) A new heading is inserted just before the following heading. For "Incorrect" results: 1. Collapse all the headings. 2. Place the cursor On the line "Results w/ ending blank line". 3. Hit (org-insert-heading-respect-content) The new heading characters ('**') are appended to the end of the result block (the end of the heading line after the '...') BTW, if the heading containing the source block is expanded it works correctly. rick