From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Lundin Subject: [PATCH] Ensure proper nesting of captured items Date: Sat, 09 Sep 2017 11:18:32 -0500 Message-ID: <87d16z7smf.fsf@fastmail.fm> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42162) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dqiSr-0003wB-Eb for emacs-orgmode@gnu.org; Sat, 09 Sep 2017 12:18:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dqiSo-0007NO-6D for emacs-orgmode@gnu.org; Sat, 09 Sep 2017 12:18:37 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:34575) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dqiSn-0007MU-Re for emacs-orgmode@gnu.org; Sat, 09 Sep 2017 12:18:34 -0400 Received: from archbook (c-24-14-63-242.hsd1.il.comcast.net [24.14.63.242]) by mail.messagingengine.com (Postfix) with ESMTPA id 1F671246D5 for ; Sat, 9 Sep 2017 12:18:33 -0400 (EDT) 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: Org Mode --=-=-= Content-Type: text/plain I configure my org-capture templates set to insert items at the end of a capture file: i.e., with a simple file target - (file "~/org/inbox.org") - and no target headline. In the past, org capture would always insert these as top level headings, regardless of existing headings in the target file. Recently, org-capture has begun to nest these entries according to context. This is undesirable, as it has caused many important capture items to be buried under unrelated headings. I did a git bisect and found the problematic commit from June 2, 2017: 57d0a7453d0386f3f1425fc5319b2f42fca16e42 As far as I can tell, that commit took out the line in org-capture-place-entry that sets level to 1 when there is no target entry. The attached patch makes a minor change to fix the issue. Best, Matt --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Ensure-that-top-level-capture-targets-are-pasted-at-.patch >From 20ead737aebc9c46aa291b5a70248c57f3fd64a1 Mon Sep 17 00:00:00 2001 From: Matt Lundin Date: Sat, 9 Sep 2017 11:08:06 -0500 Subject: [PATCH] Ensure that top-level capture targets are pasted at level 1 * lisp/org-capture.el: (org-capture-place-entry) Ensure that level is set to 1 (i.e., the top level) if there is no headline target defined. Otherwise, captured items are improperly nested by context. --- lisp/org-capture.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/org-capture.el b/lisp/org-capture.el index cd1944d96..2ddb9c505 100644 --- a/lisp/org-capture.el +++ b/lisp/org-capture.el @@ -1097,7 +1097,7 @@ may have been stored before." (defun org-capture-place-entry () "Place the template as a new Org entry." (let ((reversed? (org-capture-get :prepend)) - level) + (level 1)) (when (org-capture-get :exact-position) (goto-char (org-capture-get :exact-position))) (cond -- 2.14.1 --=-=-=--