emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Oleh <ohwoeowho@gmail.com>
To: org mode <emacs-orgmode@gnu.org>
Subject: issue with `org-insert-heading'
Date: Fri, 19 Sep 2014 14:23:33 +0200	[thread overview]
Message-ID: <CAA01p3o5OnsqDq8V==YvxB_qPCHbPpAixyaEhwMSX_wrjc4F+A@mail.gmail.com> (raw)

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	other threads:[~2014-09-19 12:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-19 12:23 Oleh [this message]
2014-09-19 19:10 ` issue with `org-insert-heading' Nicolas Goaziou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAA01p3o5OnsqDq8V==YvxB_qPCHbPpAixyaEhwMSX_wrjc4F+A@mail.gmail.com' \
    --to=ohwoeowho@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).