emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* function to change TODO status and refile to a predetermined location
@ 2010-06-20 13:01 Matt Price
  2010-06-20 16:03 ` Bernt Hansen
  0 siblings, 1 reply; 3+ messages in thread
From: Matt Price @ 2010-06-20 13:01 UTC (permalink / raw)
  To: emacs-orgmode

hi,

i have a file "Collect.org" in which i collect items that need
processing.  Every morning I go through the file, decide what needs to
be done with each item, and refile it.  The outcomes are pretty
stereotyped, so for instance, if it's a project idea, I tag it with
:project:, give it the status TODO, and refile it in Projets.org; if
it's a simple task, I also give it the status TODO, but refile it in
gtd.org; and if it's a reminder about something I'm waiting on from
someone else, I give it the status WAITING, and also refile it in
gtd.org.

I'd like to write a function that automates these tasks for me.  The
idea is to have a keybinding (though my key map seems really full!)
that works a little bit like the rmemember template keybinding -- one
function, but with options that infoke slightly different outcomes.
so, say,
C-c f p = refile as a project
C-c f a = refile as an action
C-c f w = refile as 'waiting'

My elisp is *terrible* though and I was hoping for some help.  I can
see that for each option I want to perform:


(org-todo "STATE")
and then something like
(org-refile)
-- except that I want to pre-specify a refiling location.  Is this
something I can do? I figure it must be possible since org-remember
does it, but my quick reading of that code didn't help me much.

also, it seems to me I need something like an array, in which the
final character in the keybinding determines values for the TODO
state, the refiling location, and in some cases a tag (i'm not sure
what function to call to add a tag to a heading -- it looks like
org-set-tags doesn't take any arguments, so I guess that won't
work...).  Can someone give me some pasic advice on building a
function like that?

I appreciate all the help!  Thanks so much,

Matt

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: function to change TODO status and refile to a predetermined location
  2010-06-20 13:01 function to change TODO status and refile to a predetermined location Matt Price
@ 2010-06-20 16:03 ` Bernt Hansen
       [not found]   ` <AANLkTil0pvLAHdrLpltdWlMm2JGnSme3_Jr_Lsmtq-hB@mail.gmail.com>
  0 siblings, 1 reply; 3+ messages in thread
From: Bernt Hansen @ 2010-06-20 16:03 UTC (permalink / raw)
  To: Matt Price; +Cc: emacs-orgmode

Matt Price <moptop99@gmail.com> writes:

> i have a file "Collect.org" in which i collect items that need
> processing.  Every morning I go through the file, decide what needs to
> be done with each item, and refile it.  The outcomes are pretty
> stereotyped, so for instance, if it's a project idea, I tag it with
> :project:, give it the status TODO, and refile it in Projets.org; if
> it's a simple task, I also give it the status TODO, but refile it in
> gtd.org; and if it's a reminder about something I'm waiting on from
> someone else, I give it the status WAITING, and also refile it in
> gtd.org.
>
> I'd like to write a function that automates these tasks for me.  The
> idea is to have a keybinding (though my key map seems really full!)
> that works a little bit like the rmemember template keybinding -- one
> function, but with options that infoke slightly different outcomes.
> so, say,
> C-c f p = refile as a project
> C-c f a = refile as an action
> C-c f w = refile as 'waiting'
>
> My elisp is *terrible* though and I was hoping for some help.  I can
> see that for each option I want to perform:
>
>
> (org-todo "STATE")
> and then something like
> (org-refile)
> -- except that I want to pre-specify a refiling location.  Is this
> something I can do? I figure it must be possible since org-remember
> does it, but my quick reading of that code didn't help me much.
>
> also, it seems to me I need something like an array, in which the
> final character in the keybinding determines values for the TODO
> state, the refiling location, and in some cases a tag (i'm not sure
> what function to call to add a tag to a heading -- it looks like
> org-set-tags doesn't take any arguments, so I guess that won't
> work...).  Can someone give me some pasic advice on building a
> function like that?

My refile.org is your Collect.org.  I tend to collect things in here up
to a week and then refile things away to appropriate locations.  Bulk
refiling is really useful here - from the agenda mark the tasks you want
to refile together and move them all to a single target.

I've never needed a refiling function as you describe to keep up with my
refile tasks.  I tend to clock everything I work on and at the end of
the day if there is clocked time on a refile task I refile it
immediately to its target location.  The remaining refile tasks can
remain in the collection bin until my weekly review.

I find during refiling I can just up-arrow to select previous refile
targets and this is really convenient.

HTH,
Bernt

^ permalink raw reply	[flat|nested] 3+ messages in thread

* function to change TODO status and refile to a predetermined location
       [not found]   ` <AANLkTil0pvLAHdrLpltdWlMm2JGnSme3_Jr_Lsmtq-hB@mail.gmail.com>
@ 2010-06-21  1:36     ` Matt Price
  0 siblings, 0 replies; 3+ messages in thread
From: Matt Price @ 2010-06-21  1:36 UTC (permalink / raw)
  To: emacs-orgmode

On Sun, Jun 20, 2010 at 12:03 PM, Bernt Hansen <bernt@norang.ca> wrote:
> Matt Price <moptop99@gmail.com> writes:
>
>> i have a file "Collect.org" in which i collect items that need
>> processing.  Every morning I go through the file, decide what needs to
>> be done with each item, and refile it.  The outcomes are pretty
>> stereotyped, so for instance, if it's a project idea, I tag it with
>> :project:, give it the status TODO, and refile it in Projets.org; if
>> it's a simple task, I also give it the status TODO, but refile it in
>> gtd.org; and if it's a reminder about something I'm waiting on from
>> someone else, I give it the status WAITING, and also refile it in
>> gtd.org.
>>
>> I'd like to write a function that automates these tasks for me.  The
>> idea is to have a keybinding (though my key map seems really full!)
>> that works a little bit like the rmemember template keybinding -- one
>> function, but with options that infoke slightly different outcomes.
>> so, say,
>> C-c f p = refile as a project
>> C-c f a = refile as an action
>> C-c f w = refile as 'waiting'
>>
>> My elisp is *terrible* though and I was hoping for some help.  I can
>> see that for each option I want to perform:
>>
>>
>> (org-todo "STATE")
>> and then something like
>> (org-refile)
>> -- except that I want to pre-specify a refiling location.  Is this
>> something I can do? I figure it must be possible since org-remember
>> does it, but my quick reading of that code didn't help me much.
>>
>> also, it seems to me I need something like an array, in which the
>> final character in the keybinding determines values for the TODO
>> state, the refiling location, and in some cases a tag (i'm not sure
>> what function to call to add a tag to a heading -- it looks like
>> org-set-tags doesn't take any arguments, so I guess that won't
>> work...).  Can someone give me some pasic advice on building a
>> function like that?
>
> My refile.org is your Collect.org.  I tend to collect things in here up
> to a week and then refile things away to appropriate locations.  Bulk
> refiling is really useful here - from the agenda mark the tasks you want
> to refile together and move them all to a single target.
>
> I've never needed a refiling function as you describe to keep up with my
> refile tasks.  I tend to clock everything I work on and at the end of
> the day if there is clocked time on a refile task I refile it
> immediately to its target location.  The remaining refile tasks can
> remain in the collection bin until my weekly review.
>
> I find during refiling I can just up-arrow to select previous refile
> targets and this is really convenient.
>
> HTH,
> Bernt
>

hmm.  i don't use clocking.  bulk refiling will really help but it'd
be quicker to have direct keybindings.  i'll keep thinking about it.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-06-21  1:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-20 13:01 function to change TODO status and refile to a predetermined location Matt Price
2010-06-20 16:03 ` Bernt Hansen
     [not found]   ` <AANLkTil0pvLAHdrLpltdWlMm2JGnSme3_Jr_Lsmtq-hB@mail.gmail.com>
2010-06-21  1:36     ` Matt Price

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