emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* issue with `org-insert-heading'
@ 2014-09-19 12:23 Oleh
  2014-09-19 19:10 ` Nicolas Goaziou
  0 siblings, 1 reply; 2+ messages in thread
From: Oleh @ 2014-09-19 12:23 UTC (permalink / raw)
  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

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

* Re: issue with `org-insert-heading'
  2014-09-19 12:23 issue with `org-insert-heading' Oleh
@ 2014-09-19 19:10 ` Nicolas Goaziou
  0 siblings, 0 replies; 2+ messages in thread
From: Nicolas Goaziou @ 2014-09-19 19:10 UTC (permalink / raw)
  To: Oleh; +Cc: org mode

Hello,

Oleh <ohwoeowho@gmail.com> writes:

> I just wanted to point out what I think is a bug in `org-insert-heading'.

[...]

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

This should be fixed. Thank you for reporting it.


Regards,

-- 
Nicolas Goaziou

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

end of thread, other threads:[~2014-09-19 19:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-19 12:23 issue with `org-insert-heading' Oleh
2014-09-19 19:10 ` Nicolas Goaziou

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