From mboxrd@z Thu Jan 1 00:00:00 1970 From: Xavier Martinez-Hidalgo Subject: [PATCH] org-capture: cannot abort cleanly after inserting at end of buffer Date: Thu, 2 Nov 2017 14:23:03 +0100 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="001a113c25001b99b6055cffe58e" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53361) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eAFT9-0003Fv-RW for emacs-orgmode@gnu.org; Thu, 02 Nov 2017 09:23:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eAFT5-0007ew-AB for emacs-orgmode@gnu.org; Thu, 02 Nov 2017 09:23:39 -0400 Received: from mail-oi0-x22a.google.com ([2607:f8b0:4003:c06::22a]:43106) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eAFT5-0007d7-3h for emacs-orgmode@gnu.org; Thu, 02 Nov 2017 09:23:35 -0400 Received: by mail-oi0-x22a.google.com with SMTP id c77so8774166oig.0 for ; Thu, 02 Nov 2017 06: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" To: emacs-orgmode@gnu.org --001a113c25001b99b6055cffe58e Content-Type: text/plain; charset="UTF-8" Hi, After the following steps: - Start a capture. - Move to end of capture buffer (M->). - Type some text. - Abort capture (C-c C-k). the capture is aborted but its contents are not removed from the target buffer and the following message is shown: "Capture process aborted, but target buffer could not be cleaned up correctly" I am a attaching a patch that adds a test case showing up the problem and includes a proposed fix (setting the capture kill end marker insertion type). I am not sure whether the fix might affect something else. Does the fix makes sense? --001a113c25001b99b6055cffe58e Content-Type: text/x-patch; charset="US-ASCII"; name="0001-org-capture-Fix-aborting-after-inserting-text-at-end.patch" Content-Disposition: attachment; filename="0001-org-capture-Fix-aborting-after-inserting-text-at-end.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_j9ii38t30 RnJvbSAyNDEzMGQzNzY1MmFjZGE2ZTM1NTRkODNiMTUwNmU5M2VmYzQyYTE0IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBYYXZpZXIgTWFydGluZXotSGlkYWxnbyA8eGF2aWVyQG1hcnRp bmV6aGlkYWxnby5vcmc+CkRhdGU6IFRodSwgMiBOb3YgMjAxNyAxMTo0NzoxOSArMDEwMApTdWJq ZWN0OiBbUEFUQ0hdIG9yZy1jYXB0dXJlOiBGaXggYWJvcnRpbmcgYWZ0ZXIgaW5zZXJ0aW5nIHRl eHQgYXQgZW5kIG9mCiBidWZmZXIKCiogbGlzcC9vcmctY2FwdHVyZS5lbCAob3JnLWNhcHR1cmUt bWFyay1raWxsLXJlZ2lvbik6IFNldCBlbmQgbWFya2VyCiAgaW5zZXJ0aW9uIHR5cGUgc28gdGhh dCBpdCBhZHZhbmNlcyB3aGVuIGluc2VydGluZyB0ZXh0IGF0IHRoZSBlbmQgb2YKICB0aGUgY2Fw dHVyZSBidWZmZXIuCgoqIHRlc3RpbmcvbGlzcC90ZXN0LW9yZy1jYXB0dXJlLmVsICh0ZXN0LW9y Zy1jYXB0dXJlL2luc2VydC1hdC1lbmQtYWJvcnQpOgogIEFkZCB0ZXN0IGNhc2UuCgpJbnNlcnRp bmcgdGV4dCBhdCB0aGUgZW5kIG9mIHRoZSBjYXB0dXJlIGJ1ZmZlciBkb2VzIG5vdCBhZHZhbmNl IHRoZQplbmQga2lsbCBtYXJrZXIuICBUaGlzIGNhdXNlcyB0aGUgbmFycm93aW5nIHJlZ2lvbiBh bmQgdGhlIGtpbGwKbWFya2VycyB0byBnZXQgb3V0IG9mIHN5bmMsIHdoaWNoIHByZXZlbnRzICdv cmctY2FwdHVyZS1maW5hbGl6ZScgZnJvbQpjb3JyZWN0bHkgY2xlYW5p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