emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Advice on writing a refile to heading function?
@ 2013-03-29 12:51 Martin Owen
  2013-03-29 14:45 ` John Hendy
  0 siblings, 1 reply; 3+ messages in thread
From: Martin Owen @ 2013-03-29 12:51 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 966 bytes --]

Hi,

I am writing a Pomodoro minor mode on top of org-mode. I'm planning to
maintain
an Activity Inventory with estimates against each item and move items into a
Todo Today heading each day as I progress through them. The approach is
based on
the Pomodoro approach suggested in this book:
http://pragprog.com/book/snfocus/pomodoro-technique-illustrated.

My problem is, as I plan to do a lot of refiling, I wanted to write a
function
that will take a heading regular expression and refile the subtree at point
underneath
it. I am finding this to be difficult, and am wondering if anybody can
offer me
any advice? Is it even possible to refile a subtree to a point using Emacs
Lisp?

I've posted my code here: https://gist.github.com/mowen/5225169 My approach
uses the org-cut-subtree and org-paste-subtree functions, but it doesn't
work in all situations. You can see this from the org-pomodoro-refile-up
test which is currently failing.

Thanks in advance,

Martin

[-- Attachment #2: Type: text/html, Size: 1398 bytes --]

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

* Re: Advice on writing a refile to heading function?
  2013-03-29 12:51 Advice on writing a refile to heading function? Martin Owen
@ 2013-03-29 14:45 ` John Hendy
  2013-03-29 23:01   ` Martin Owen
  0 siblings, 1 reply; 3+ messages in thread
From: John Hendy @ 2013-03-29 14:45 UTC (permalink / raw)
  To: Martin Owen; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1394 bytes --]

On Fri, Mar 29, 2013 at 7:51 AM, Martin Owen <martinowenuk@gmail.com> wrote:

> Hi,
>
> I am writing a Pomodoro minor mode on top of org-mode. I'm planning to
> maintain
> an Activity Inventory with estimates against each item and move items into
> a
> Todo Today heading each day as I progress through them. The approach is
> based on
> the Pomodoro approach suggested in this book:
> http://pragprog.com/book/snfocus/pomodoro-technique-illustrated.
>
> My problem is, as I plan to do a lot of refiling, I wanted to write a
> function
> that will take a heading regular expression and refile the subtree at
> point underneath
> it. I am finding this to be difficult, and am wondering if anybody can
> offer me
> any advice? Is it even possible to refile a subtree to a point using Emacs
> Lisp?
>
>
Based on your example file, you're trying to refile "Todo Today" items into
a date tree of sorts below for progress tracking? Is that the gist? Just
want to make sure I (and the list) understand what you're trying to move
and to where (i.e. elaborate on "point underneath it").


Thanks!
John


> I've posted my code here: https://gist.github.com/mowen/5225169 My
> approach uses the org-cut-subtree and org-paste-subtree functions, but it
> doesn't work in all situations. You can see this from the
> org-pomodoro-refile-up test which is currently failing.
>
> Thanks in advance,
>
> Martin
>

[-- Attachment #2: Type: text/html, Size: 2364 bytes --]

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

* Re: Advice on writing a refile to heading function?
  2013-03-29 14:45 ` John Hendy
@ 2013-03-29 23:01   ` Martin Owen
  0 siblings, 0 replies; 3+ messages in thread
From: Martin Owen @ 2013-03-29 23:01 UTC (permalink / raw)
  To: John Hendy; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 2079 bytes --]

On 29 March 2013 14:45, John Hendy <jw.hendy@gmail.com> wrote:

> On Fri, Mar 29, 2013 at 7:51 AM, Martin Owen <martinowenuk@gmail.com>wrote:
>
>> Hi,
>>
>> I am writing a Pomodoro minor mode on top of org-mode. I'm planning to
>> maintain
>> an Activity Inventory with estimates against each item and move items
>> into a
>> Todo Today heading each day as I progress through them. The approach is
>> based on
>> the Pomodoro approach suggested in this book:
>> http://pragprog.com/book/snfocus/pomodoro-technique-illustrated.
>>
>> My problem is, as I plan to do a lot of refiling, I wanted to write a
>> function
>> that will take a heading regular expression and refile the subtree at
>> point underneath
>> it. I am finding this to be difficult, and am wondering if anybody can
>> offer me
>> any advice? Is it even possible to refile a subtree to a point using
>> Emacs Lisp?
>>
>>
> Based on your example file, you're trying to refile "Todo Today" items
> into a date tree of sorts below for progress tracking? Is that the gist?
> Just want to make sure I (and the list) understand what you're trying to
> move and to where (i.e. elaborate on "point underneath it").
>
>
> Thanks!
> John
>
>
>> I've posted my code here: https://gist.github.com/mowen/5225169 My
>> approach uses the org-cut-subtree and org-paste-subtree functions, but it
>> doesn't work in all situations. You can see this from the
>> org-pomodoro-refile-up test which is currently failing.
>>
>> Thanks in advance,
>>
>> Martin
>>
>
>
Hi John,

I'd like a function that takes an arbitrary regexp that matches a heading
in the current org-mode buffer, and the subtree at point will then be moved
to the level underneath that heading. So I'll have a number of headings
"Current Task", "Todo Today", "Activity Inventory", and various date
headings. I'd like to be able to move subtrees between those headings with
Emacs Lisp code.

I'm wondering if someone has suggestions on how to do this, or if it is
even possible? I've tried a few things but can't seem to get it to work
consistently.

Thanks,

Martin

[-- Attachment #2: Type: text/html, Size: 3793 bytes --]

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

end of thread, other threads:[~2013-03-29 23:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-29 12:51 Advice on writing a refile to heading function? Martin Owen
2013-03-29 14:45 ` John Hendy
2013-03-29 23:01   ` Martin Owen

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