From: Aankhen <aankhen@gmail.com>
To: Org-mode ml <emacs-orgmode@gnu.org>
Subject: Re: Automatically clocking into parent items
Date: Mon, 14 Mar 2011 16:30:39 +0530 [thread overview]
Message-ID: <AANLkTi=2nknRrMhD3AZThHjm51U83akjUHe-Yi+2xcsA@mail.gmail.com> (raw)
In-Reply-To: <AANLkTi=HS-hcPtE5U1s+BWXAEv1P1+77=V0ZsFMR1rcY@mail.gmail.com>
On Sun, Mar 13, 2011 at 01:30, Aankhen <aankhen@gmail.com> wrote:
> I’ve been working on getting org-mode to automatically clock into an
> item’s ancestor when clocking out of that item. The way I have it set
> up now, it walks up the tree looking for an item that has a particular
> property set. If that property is non-nil, it clocks in; if it’s nil,
> it doesn’t. Either way, it stops looking at that point. Here’s what
> I have so far:
>
> [snip]
>
> So given this structure:
>
> [snip]
>
> When I clock out of ‘Frob’, I’m automatically clocked into ‘Quux’, and
> when I clock out of ‘Quux’, I’m automatically clocked into ‘Bar’.
> This works pretty well, except for one problem: it happens *every
> time* I clock out, meaning that if I’m clocked into ‘Quux’ and I then
> hit C-c C-x C-i on ‘Frob’, I end up being clocked into both ‘Bar’ and
> ‘Frob’, because I’m automatically clocked out of ‘Quux’; my code is
> run, clocking me into ‘Bar’; and then the normal clocking mechanism
> clocks me into ‘Frob’ (at least, I *think* the hook runs first).
>
> I guess what I’m wondering is, what’s a good way to avoid this
> double-clocking? And while I’m asking for help, can anyone think of
> some less obnoxious names for the functions, variables and property?
> :-)
I think I managed to answer the first question myself. As
‘org-clock-in’ sets ‘org-clock-clocking-in’ before calling
‘org-clock-out’, checking the value of that variable before clocking
into the parent item seems to have done the trick.
Aankhen
prev parent reply other threads:[~2011-03-14 11:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-12 20:00 Automatically clocking into parent items Aankhen
2011-03-14 11:00 ` Aankhen [this message]
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='AANLkTi=2nknRrMhD3AZThHjm51U83akjUHe-Yi+2xcsA@mail.gmail.com' \
--to=aankhen@gmail.com \
--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).