From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Christopher J. White" Subject: Problems with org-capture and file+function Date: Sun, 22 Jul 2012 14:00:42 -0400 Message-ID: <500C3FCA.1070304@grierwhite.com> Reply-To: orgmode@grierwhite.com Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([208.118.235.92]:58103) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1St0SZ-0006Qe-It for emacs-orgmode@gnu.org; Sun, 22 Jul 2012 14:00:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1St0SX-0006pX-Vd for emacs-orgmode@gnu.org; Sun, 22 Jul 2012 14:00:51 -0400 Received: from mail26c25.carrierzone.com ([64.29.147.36]:52392) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1St0SX-0006os-LU for emacs-orgmode@gnu.org; Sun, 22 Jul 2012 14:00:49 -0400 Received: from [11.1.1.76] (pool-108-7-146-96.bstnma.east.verizon.net [108.7.146.96]) (authenticated bits=0) by mail26c25.carrierzone.com (8.13.6/8.13.1) with ESMTP id q6MI0hht027342 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sun, 22 Jul 2012 18:00:45 GMT 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Hi folks, I'm trying to figure out the proper use of the 'file+function' target. The documentation indicates the entry will be a child of the target entry, but I'm not finding that to be the case for all cases. As far as I can tell, the function is expected to put the point where the entry should go and return t. Here's my org-capture templates: (setq org-capture-templates ("x" "Test") ("x1" "Test function" entry (file+function "~/test.org" (lambda () (goto-char (org-find-olp (list "Top" "A" "A1") t)) t)) "* Test A1" ) ("x2" "Test function" entry (file+function "~/test.org" (lambda () (goto-char (org-find-olp (list "Top" "A" "A1" "A1x") t)) t)) "* Test A1x") ("x3" "Test function" entry (file+function "~/test.org" (lambda () (goto-char (org-find-olp (list "Top" "A" "A1" "A1x" "A1xx") t)) t)) "* Test A1xx"))) Start with this as a test.org: * Top ** A *** A1 **** A1x ***** A1xx **** A1y ** B *** B1 **** B1x Then call org-capture for x1, then x2, then x3, and you get: * Top ** A *** Test A1 *** A1 **** Test A1x **** A1x ***** Test A1xx ***** A1xx **** A1y ** B *** B1 **** B1x I expected instead for the new entries to appear as subheadings of the target, something like: * Top ** A *** A1 **** A1x ***** A1xx ****** Test A1xx ***** Test A1x **** A1y *** Test A1 ** B *** B1 **** B1x I've tried various things in the lambda() function: 1. (org-end-of-subtree) This just creates the entry at the end of the subtree, but as a child of the last entry. 2. end-of-line Fails if there is any body below the heading in question. Is this a bug or am I doing something wrong? Using: Emacs 23.4.1 on Mac Org-mode 7.8.03 Thanks ...cj