From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Fuchs Subject: org-capture: file to top level with prepend Date: Sun, 3 Oct 2010 06:01:38 +0200 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=001636e903100c65c40491ae7cd5 Return-path: Received: from [140.186.70.92] (port=54727 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P2Fld-0000Nh-Uu for emacs-orgmode@gnu.org; Sun, 03 Oct 2010 00:01:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P2Flc-0004Di-Kp for emacs-orgmode@gnu.org; Sun, 03 Oct 2010 00:01:41 -0400 Received: from mail-iw0-f169.google.com ([209.85.214.169]:44554) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P2Flc-0004Da-H3 for emacs-orgmode@gnu.org; Sun, 03 Oct 2010 00:01:40 -0400 Received: by iwn33 with SMTP id 33so8466474iwn.0 for ; Sat, 02 Oct 2010 21:01:39 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --001636e903100c65c40491ae7cd5 Content-Type: multipart/alternative; boundary=001636e903100c65bd0491ae7cd3 --001636e903100c65bd0491ae7cd3 Content-Type: text/plain; charset=ISO-8859-1 Hi! I'm trying to capture and file an entry as an top-level entry as first entry in an org file without config at the beginning (no "#+"). This leads to filing the entry as _second_ headline in the org file. The template is: ("z" "test" entry (file "~/Data/z.org") "* %^{Note} %t :NOTE:\n %?" :prepend t) I think this is due to jumping over lines starting with "#+" at the beginning of the org file (line 715 in org-capture.el (org-capture-place-entry)). My file has no config header and starts with the first headline. Calling outline-next-heading in this situation leads to jumping to the second headline in the file. The appended patch fixes this problem by checking if we are on a headline and then skips jumping to next headline. Regards Thomas --001636e903100c65bd0491ae7cd3 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi!

I'm trying to capture and file an entry as an top-level entr= y as first entry
in an org file without config at the beginning (no &qu= ot;#+").
This leads to filing the entry as _second_ headline in the= org file.

The template is:
("z" "test" entry (file "~= /Data/z.org") "* %^{Note} %t=A0 :NOT= E:\n %?" :prepend t)

I think this is due to jumping over lines= starting with "#+" at the beginning of the org file
(line 715 in org-capture.el (org-capture-place-entry)).
My file has no c= onfig header and starts with the first headline. Calling outline-next-headi= ng
in this situation leads to jumping to the second headline in the file= .

The appended patch fixes this problem by checking if we are on a headli= ne
and then skips jumping to next headline.

Regards
Thomas
=


--001636e903100c65bd0491ae7cd3-- --001636e903100c65c40491ae7cd5 Content-Type: application/octet-stream; name=patch Content-Disposition: attachment; filename=patch Content-Transfer-Encoding: base64 X-Attachment-Id: f_gete27b20 ZGlmZiAtLWdpdCBhL2xpc3Avb3JnLWNhcHR1cmUuZWwgYi9saXNwL29yZy1jYXB0dXJlLmVsCmlu ZGV4IDZjZTljZGQuLjQxNDNmN2IgMTAwNjQ0Ci0tLSBhL2xpc3Avb3JnLWNhcHR1cmUuZWwKKysr IGIvbGlzcC9vcmctY2FwdHVyZS5lbApAQCAtNzEyLDcgKzcxMiw4IEBAIGFscmVhZHkgZ29uZS4i CiAgICAgICAoc2V0cSBsZXZlbCAxKQogICAgICAgKGlmIHJldmVyc2VkCiAJICAocHJvZ24gKGdv dG8tY2hhciAocG9pbnQtbWluKSkKLQkJIChvdXRsaW5lLW5leHQtaGVhZGluZykpCisJCSAoaWYg KG5vdCAob3JnLWF0LWhlYWRpbmctcCkpCisJCSAgICAgKG91dGxpbmUtbmV4dC1oZWFkaW5nKSkp CiAJKGdvdG8tY2hhciAocG9pbnQtbWF4KSkKIAkob3IgKGJvbHApIChpbnNlcnQgIlxuIikpKSkK ICAgICAgKHQK --001636e903100c65c40491ae7cd5 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --001636e903100c65c40491ae7cd5--