Hi all,

I just wanted to point out what I think is a bug in `org-insert-heading'.
The abridged code:

#+begin_src elisp
(let ((adjust-empty-lines t))
  ;; code that does not change `adjust-empty-lines'
  (when adjust-empty-lines
    (if (or (not blank)
            (and blank (not (org-previous-line-empty-p))))
        (org-N-empty-lines-before-current (if blank 1 0)))))
#+end_src

So at the very least there's test that always returns t.

The effect of this code is that when I do "M-RET" 3 times in a blank
file, the first two stars don't get a space after them and get
highlighted differently than the third.
Calling `outline-previous-heading' from the third star moves point to
the first star and not the second, which means that they're not
recognized as proper headings.

What I think 3 "M-RET" should do is to insert a space after each star.
That way they are proper headings with empty headlines.

best regards,
Oleh

Reply via email to