From mboxrd@z Thu Jan 1 00:00:00 1970 From: Oleh Subject: issue with `org-insert-heading' Date: Fri, 19 Sep 2014 14:23:33 +0200 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45752) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUxE0-0004No-0z for emacs-orgmode@gnu.org; Fri, 19 Sep 2014 08:23:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XUxDx-0005gR-Nz for emacs-orgmode@gnu.org; Fri, 19 Sep 2014 08:23:43 -0400 Received: from mail-ie0-x234.google.com ([2607:f8b0:4001:c03::234]:61468) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUxDx-0005fc-Dl for emacs-orgmode@gnu.org; Fri, 19 Sep 2014 08:23:41 -0400 Received: by mail-ie0-f180.google.com with SMTP id ar1so370342iec.11 for ; Fri, 19 Sep 2014 05:23:34 -0700 (PDT) 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: org mode 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