emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] [BUG] Inserting new heading


From: Rick Frankel
Subject: [O] [BUG] Inserting new heading
Date: Wed, 15 Mar 2017 10:24:33 -0400

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 <C-return> (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 <C-return> (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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]