emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [BUG] Inserting new heading
@ 2017-03-15 14:24 Rick Frankel
  2017-03-16 12:03 ` Nicolas Goaziou
  0 siblings, 1 reply; 3+ messages in thread
From: Rick Frankel @ 2017-03-15 14:24 UTC (permalink / raw)
  To: emacs-orgmode

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [BUG] Inserting new heading
  2017-03-15 14:24 [BUG] Inserting new heading Rick Frankel
@ 2017-03-16 12:03 ` Nicolas Goaziou
  2017-03-16 19:38   ` Rick Frankel
  0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Goaziou @ 2017-03-16 12:03 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

Rick Frankel <rick@rickster.com> writes:

> 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.

Fixed. I couldn't reproduce it on maint tho, so the commit landed on
master branch.

Thank you.

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [BUG] Inserting new heading
  2017-03-16 12:03 ` Nicolas Goaziou
@ 2017-03-16 19:38   ` Rick Frankel
  0 siblings, 0 replies; 3+ messages in thread
From: Rick Frankel @ 2017-03-16 19:38 UTC (permalink / raw)
  To: emacs-orgmode

On Thu, Mar 16, 2017 at 01:03:18PM +0100, Nicolas Goaziou wrote:
> Hello,
> 
> Rick Frankel <rick@rickster.com> writes:
> 
> > 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.

> Fixed. I couldn't reproduce it on maint tho, so the commit landed on
> master branch.

Confirmed in master. Not suprised it wasn't in maint, it's a fairly recent bug.

thanx,
rick

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-03-16 19:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-15 14:24 [BUG] Inserting new heading Rick Frankel
2017-03-16 12:03 ` Nicolas Goaziou
2017-03-16 19:38   ` Rick Frankel

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).