org-capture: Fix aborting after inserting text at end of buffer
commitf38a7d433b857e7d86f808cd8ed29d63ac841a99
authorXavier Martinez-Hidalgo <xavier@martinezhidalgo.org>
Thu, 2 Nov 2017 10:47:19 +0000 (2 11:47 +0100)
committerNicolas Goaziou <mail@nicolasgoaziou.fr>
Fri, 3 Nov 2017 21:20:11 +0000 (3 22:20 +0100)
tree8f51f7ad5ad96d977e5c6eff984450c2165b6346
parentb5f075aa05244b7b05c207d0c7c01b442876cd88
org-capture: Fix aborting after inserting text at end of buffer

* lisp/org-capture.el (org-capture-mark-kill-region): Set end marker
  insertion type so that it advances when inserting text at the end of
  the capture buffer.

* testing/lisp/test-org-capture.el (test-org-capture/insert-at-end-abort):
  Add test case.

Inserting text at the end of the capture buffer does not advance the
end kill marker.  This causes the narrowing region and the kill
markers to get out of sync, which prevents 'org-capture-finalize' from
correctly cleaning the target buffer when aborting the capture.

Setting the kill end marker insertion type fixes this.

TINYCHANGE
lisp/org-capture.el
testing/lisp/test-org-capture.el