org-capture: Inserting an entry doesn't break structure
commit0fa8bb4c513f980669d70da9819ff4bbab9a575e
authorNicolas Goaziou <mail@nicolasgoaziou.fr>
Mon, 22 Oct 2018 20:22:21 +0000 (22 22:22 +0200)
committerNicolas Goaziou <mail@nicolasgoaziou.fr>
Mon, 22 Oct 2018 20:22:21 +0000 (22 22:22 +0200)
tree5af4425ee1a61867976658bae876879380746566
parentbddd287cce4d4926ab3fec712b0f78d0feb39a0d
org-capture: Inserting an entry doesn't break structure

* lisp/org-capture.el (org-capture-place-entry): Carefully narrow
  buffer to not alter following headline.  Also include leading empty
  lines in region to remove when cancelling capture.
* testing/lisp/test-org-capture.el (test-org-caputre/entry): New test.
(test-org-capture/abort): Rename test.

Reported-by: Martin Yrjölä <martin.yrjola@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2018-10/msg00256.html>
lisp/org-capture.el
testing/lisp/test-org-capture.el