Re: [O] [PATCH] Ensure proper nesting of captured items

2017-09-10 Thread Nicolas Goaziou
Hello,

Matt Lundin  writes:

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

Applied. Thank you.

Regards,

-- 
Nicolas Goaziou



[O] [PATCH] Ensure proper nesting of captured items

2017-09-09 Thread Matt Lundin
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 

>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