emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: emacs-orgmode@gnu.org
Subject: Re: refiling as child with function-filing-location
Date: Sun, 26 Oct 2014 10:38:51 -0700	[thread overview]
Message-ID: <8761f6pw7o.fsf@ericabrahamsen.net> (raw)
In-Reply-To: 87mw8oblc3.fsf@scilifelab.se

Per Unneberg <punneberg@gmail.com> writes:

> Hi,
>
> I'm writing a custom function for use with a capture template, as
> described in the section Template elements (sec 9.1.3.1) of the info
> manual. My function does what I expect in that it finds the correct
> heading (in my use case "Log") and returns point. However, if the Log
> heading has no children, the capture template is filed as a sibling, and
> not a child. I have spent some time now on this seemingly simple
> problem, but being a newbie on elisp I must admit I'm stuck.

I'm messing about with some similar template-placement routines, so I
tried your recipe below, and it worked for me... Capture by default will
create a child of the heading point is on, so I really don't see why
this wouldn't work. You've stepped through the function and confirmed
that the (goto-char (point-at-bol)) line leaves you at the "Log"
heading?

Is the tree structure folded or open at the time? You might try an
(org-reveal) after the (org-clock-goto); I'm still not really clear on
the interaction between visibility and heading insertion.

I think you're note about "if cursor is at beginning of headline, same
level used" doesn't really apply here, as the capture process does a lot
more than just pasting a subtree.

Anyway, I can't reproduce the problem -- do try messing with
visibility...

Eric

  reply	other threads:[~2014-10-26 17:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-22  7:43 refiling as child with function-filing-location Per Unneberg
2014-10-26 17:38 ` Eric Abrahamsen [this message]
2014-10-27 20:51   ` Per Unneberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8761f6pw7o.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).