[O] bug in org-icalendar--combine-files?

2014-06-07 Thread Chris Poole
Hey,

I wrote a function to export scheduled, done tasks to iCalendar[1].

All works well, but I noticed that before the function is run, my agenda
views only show upcoming scheduled tasks (I globally have agendas not show
done scheduled or deadline items).

After org-icalendar--combine-files does its stuff, and works correctly, but
my agendas suddenly have items such as "Sched.11x: DONE do something",
despite it being a DONE task that I marked as complete over a week ago.

Any idea why org-agenda-skip-scheduled-if-done is seemingly being
overridden to nil?
I have tried explicitly setting this value to true for the custom agenda
view, but it doesn't help.

Any idea what's going on here?


Cheers,
Chris

[1]:
https://github.com/chrispoole643/org-gtd/blob/443d43879d944bcec47af0ddac3d542bce6b2269/org-gtd.el#L146


Re: [O] Export to iCalendar only not DONE, scheduled tasks?

2014-06-01 Thread Chris Poole
On Wed, May 14, 2014 at 11:31 PM, Arun Persaud  wrote:
>
> had another look and org-export-filter-final-output-functions is the
> wrong function to use. ...
>

So, I ended up solving my problem, via an alternative route. The code is
here:

https://github.com/chrispoole643/org-gtd/blob/dcfe7122fa496de51a8de3a8f02184bc7aec05b9/org-gtd.el#L143

Essentially, the icalendar function that combines the agendas and exports
stuff just calls a function that happens to accept a restricted list of
items to export. So, I use this function directly, but first I look through
my agenda files and mark where the scheduled tasks are. I then pass these
as the restricted list, and all works well :)

Thanks for the help,
Chris


Re: [O] How to find the headline matching a string

2014-05-31 Thread Chris Poole
Igor Sosa Mayor:
> could you maybe send a little more of the code? I would like to
> understand how it exactly works.

Sure --- it's part of a quick setup file for the GTD methodology that I'm
writing. The specific function in question is here:

https://github.com/chrispoole643/org-gtd/blob/6b13d4fdf024923756653e75c0ba313898ff7a9d/org-gtd.el#L111

Cheers,
Chris


Re: [O] How to find the headline matching a string

2014-05-31 Thread Chris Poole
Eric Abrahamsen:
> the `org-map-entries' function can be given a scope of 'agenda

That worked perfectly, thanks. Here's what I ended up with:

(org-map-entries (lambda ()
   (when (equal title (org-get-heading t t))
 (org-entry-put (point) "TODO" "DONE")))
 tag 'agenda)


Cheers,
Chris



On Sat, May 31, 2014 at 4:27 PM, Eric Abrahamsen 
wrote:

> Chris Poole  writes:
>
> > Hi all,
> >
> > Suppose I have a string, "my first task", that I know is tagged with
> > "laptop".
> >
> > I want to search through the agenda files for a headline that matches
> > this string, to be able to mark it as DONE (in an automated fashion).
> >
> > I can't find a function to search through for the headline --- is
> > there one?
> >
> > Else, is it best to concat all the agenda files into a larger buffer,
> > then parse the buffer and iterate through the headlines with
> > org-element-map?
> >
> >
> > Cheers,
> > Chris
>
> Depending on how automated you need this to be, the `org-map-entries'
> function can be given a scope of 'agenda (see its docstring). You could
> call it with the agenda scope and a matcher for the "laptop" tag -- that
> would at least get you all the headings in all the agenda files with the
> "laptop" tag. Then the actual mapping function could call
> `org-get-heading' on each of the matching headings, and check the text.
>
> In these cases, though, I generally try to find a way to know the
> heading's ID property, and use `org-id-goto'.
>
> Hope that helps,
> Eric
>
>
>


[O] How to find the headline matching a string

2014-05-31 Thread Chris Poole
Hi all,

Suppose I have a string, "my first task", that I know is tagged with
"laptop".

I want to search through the agenda files for a headline that matches this
string, to be able to mark it as DONE (in an automated fashion).

I can't find a function to search through for the headline --- is there one?

Else, is it best to concat all the agenda files into a larger buffer, then
parse the buffer and iterate through the headlines with org-element-map?


Cheers,
Chris


[O] Filter tasks when exporting to iCalendar

2014-05-17 Thread Chris Poole
Hi,

I'm trying to filter tasks such that only tasks that aren't done, but are
scheduled or have deadlines, are exported to iCalendar.

I have this so far:


(setq org-icalendar-use-scheduled '(todo-start)
org-icalendar-use-deadline '(todo-due)
org-icalendar-include-todo t
org-icalendar-include-body nil
org-icalendar-alarm-time 15
org-icalendar-with-timestamps 'active)

(defun gtd-filter-scheduled-todo-tasks (data backend info)
  "Filter iCalendar export to include only TODO tasks that are
not done, but which are scheduled or have a deadline."
  (when (eq backend 'icalendar)
(org-element-map data 'headline
  (lambda (hl)
(when (or (not (equal 'todo (org-element-property :todo-type hl)))
  (equal "DONE" (org-element-property :todo-keyword hl))
  (not (or (org-element-property :scheduled hl)
   (org-element-property :deadline hl
  (org-export-ignore-element hl info))) info) data))

(defun gtd-export-agendas-and-calendar ()
  "Store agenda views as plain text files, and export scheduled
events to a combined iCalendar file. Filter the calendar using
`gtd-filter-scheduled-todo-tasks', only allowing tasks that
aren't DONE, but are scheduled."
  (interactive)
  (org-store-agenda-views)
  (let ((org-export-filter-parse-tree-functions
'(gtd-filter-scheduled-todo-tasks)))
(org-icalendar-combine-agenda-files)))


But it leaves an empty calendar.ics file. Anyone know where I'm going wrong?
I assume that org-export-ignore-element is updating `info' in place.

I can't work out why it's not working...


Cheers,
Chris


Re: [O] Export to iCalendar only not DONE, scheduled tasks?

2014-05-16 Thread Chris Poole
That's very helpful, thanks — I'll get experimenting.


Cheers,
Chris


Re: [O] Export to iCalendar only not DONE, scheduled tasks?

2014-05-10 Thread Chris Poole
On Mon, May 5, 2014 at 11:08 PM, Arun Persaud  wrote:

> pretty sure this can be done. I export only events to an ics file that
> have a start and an end date and are not in a certain category. For this
> I use
>

That's great, thank you. I have this, but it doesn't work:

(defun filter-scheduled-todo-tasks (content backend info)
  "Filter iCalendar export to include only TODO tasks that are
not done, but which are scheduled or have a deadline."
  (when (eq backend 'icalendar)
(if (and (org-entry-is-todo-p)
 (not (org-entry-is-done-p))
 (or (org-get-scheduled-time (point))
 (org-get-deadline-time (point
content nil)))

... called with:

(let ((org-export-filter-final-output-functions
 '(filter-scheduled-todo-tasks)))
(org-icalendar-combine-agenda-files))

I have (setq org-icalendar-include-todo t) too.

Using edebug, it seems that the `content' argument only iterates through
the top-level headings of each of my agenda files. I was assuming it'd
iterate through each subheading too --- do I need to do this manually?


Re: [O] Export to iCalendar only not DONE, scheduled tasks?

2014-05-07 Thread Chris Poole
On Tuesday, May 6, 2014, Bastien  wrote:
> (setq org-icalendar-include-todo t)

I tried that, but it has the unfortunate effect of adding all my TODO
entries into the calendar.

I want unscheduled TODO items to be in tags-todo lists only (for @contexts
in GTD parlance), and scheduled TODO items to appear in the weekly agenda
and iCalendar files. (And nothing else going to iCalendar.)

I have been able to set everything up except for the last piece in
parentheses above.

Any other thoughts?

Cheers,
Chris


[O] Export to iCalendar only not DONE, scheduled tasks?

2014-05-04 Thread Chris Poole
Hi,

I've been searching round the manual, and blogs, to find a way to do this.

I want to export all of the scheduled/deadline tasks that are not in a DONE
state to an iCalendar file.

Can this be done?


Cheers,
Chris


Re: [O] Update from exported agendas?

2014-04-27 Thread Chris Poole
The only way I can think of doing it is, for each completed task out of the
exported file, pull up the agenda view (that corresponds to that file),
find that item, and mark it as DONE.

Perhaps have this action on the opening of any file in the org-agenda-files
list.

I was just hoping it might have already been done so I don't have to start
from scratch, seems like a logical thing --- presumably people just
manually open up the agenda view for what they've just done away from the
laptop, and mark things done, again...

(Incidentally, I actually wrote this functionality years ago (and it'd also
switch the next TODO task to NEXT), in a GTD library I made for myself, but
recently decided to switch to org mode, as it has a ton of advantages to my
simple system. I'm now seeing if I can build a GTD layer on top of org
mode, to provide a kind of automatic setup for those new to org-mode, who
want to use it with the GTD methodology.)


On Sun, Apr 27, 2014 at 12:16 PM, Thorsten Jolitz  wrote:

> Chris Poole  writes:
>
> Hi,
>
> > I export my agenda custom views to plain text, so I can check things
> > off as I go (without access to Emacs).
> >
> > I use `(org-agenda-prefix-format " [ ] ")` so I can easily add an "X"
> > with my text editor on my phone.
> >
> > Is there any way to have this update the todo items that the exported
> > agenda file was created from? (Say, changing NEXT state to DONE.)
>
> I don't think this is possible. Without having looked at org-agenda.el I
> guess that the connection between agenda entries and items in .org files
> is realised with Emacs Lisp markers (enabling cmds like
> `org-agenda-show' in agenda mode). These markers are lost when you simply
> copy the agenda contents to a plain text file, so there is no connection
> anymore with the Org files.
>
> Maybe the elisp markers could be replaced by unique IDs for each entry
> or links that allow the look-up of the associated entries, and you are
> lucky and somebody aready figured out how to do this?
>
> --
> cheers,
> Thorsten
>
>
>


[O] Update from exported agendas?

2014-04-27 Thread Chris Poole
Hi,

I export my agenda custom views to plain text, so I can check things off as
I go (without access to Emacs).

I use `(org-agenda-prefix-format " [ ] ")` so I can easily add an "X" with
my text editor on my phone.

Is there any way to have this update the todo items that the exported
agenda file was created from? (Say, changing NEXT state to DONE.)


Cheers,
Chris


[Orgmode] Re: //WAITING shows //NEXT too...

2008-06-06 Thread Chris Poole

Thanks.

Yes, I have done this.

Just realised that it loads the items first in load-path, and later  
ones don't supersede. So used cons, not append, to get org mode in ~/ 
emacs to load first, before packaged one.


Newest org mode loads, and the bugs are gone.

Thanks.

On 2 Jun 2008, at 17:33, Paul R wrote:


Chris Poole <[EMAIL PROTECTED]> writes:


I've downloaded the latest version to ~/emacs/lisp/org,
to see if this may help. But can't get it to load over
the old version (which is packaged inside Emacs.app).


see variable load-path (M-x describe-variable RET load-path RET)

--
 Paul




___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: //WAITING shows //NEXT too...

2008-06-04 Thread Chris Poole

> (1) See also the variables `org-show-hierarchy-above',
> `org-show-following-heading', and `org-show-siblings' for detailed
> control on how much context is shown around each match.

Hmm, slightly strange.

I've also been editing my .emacs and ~/emacs structure, so tested out
the latest version of org-mode using a stock Emacs, without any of my
customisations.

This is why I reported that it worked above.

I've now tried it back with all my .emacs customisations, and the same
error occurs. So I'm going to investigate a little further...




___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: //WAITING shows //NEXT too...

2008-06-04 Thread Chris Poole
Jost Burkardt  web.de> writes:

> (1) See also the variables `org-show-hierarchy-above',
> `org-show-following-heading', and `org-show-siblings' for detailed
> control on how much context is shown around each match.

Thanks.

I've loaded the latest version of org-mode (was using 4.xx bundled with Emacs),
and it's working fine now, so I guess it was fixed or something.



___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: //WAITING shows //NEXT too...

2008-06-02 Thread Chris Poole
Chris Poole  chrispoole.com> writes:

Just to add, I'm using Carbon Emacs package on Mac OS X, 
with v4.67d of org-mode.

I've downloaded the latest version to ~/emacs/lisp/org, 
to see if this may help. But can't get it to load over 
the old version (which is packaged inside Emacs.app).



___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] //WAITING shows //NEXT too...

2008-06-02 Thread Chris Poole
Hi,
I'm not sure if this is a bug or just some feature I don't understand, but I
can't find mention of it elsewhere.

I'm trying to implement GTD with org-mode.

I have special TODO keywords set, NEXT WAITING DONE.

If I do C-c\ to have it ask for tags or TODO keywords (to produce lists for me),
I may enter //WAITING, to see all items I'm waiting for.

Doing so and I get, for example

* Someday/Maybe...
* Projects...
** My first project
*** WAITING some thing I want done
*** NEXT something I should do :computer:
* Reading...

Clearly, the NEXT item shouldn't be there.

This also occurs if I do a search for //NEXT items...

I get a nice list (this time not showing my WAITING items), but in places where
I have a *** NEXT item, it also shows any next *** item for that project too
(though there is no NEXT tag here).

(I apologise if these are two separate issues.)

Anyone know what's going wrong, or what I'm doing wrong?

Thanks.



___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode