[Orgmode] Re: Finding old appointments
Matt Lundin m...@imapmail.org writes: Well, basically I'm just looking for a search facility that shows me an agenda view with all entries that contain only timestamps before today and no pending todos, so that I can use the agenda commands to act on them. Some will be deleted, others archived. Here's an example of an agenda view that would bring up all old, active timestamps marked DONE: C-c a m [RET] TIMESTAMPtoday+TODO=DONE Oh, nice. I've never use this search, but it is very useful. Simply by searching for a timestamp before today does already help me. Additionally, playing around with it helped me being even more specific. So what I want to get is an agenda with - headlines that contain only past timestamps and are closed TODOs (if they are TODOs), that is, any TODO state after the | in `org-todo-keywords' - the same applies to all children of that entry, recursively - the agenda should only list the top-most entries for which these properties hold Example: * Project X ** TODO foo SCHEDULED: 2010-06-22 Tue ** Bla bla bla *** DONE baz DEADLINE: 2010-06-01 Tue *** Meeting with Hugo 2010-06-04 Fri So in that case, the search should list only the Bla bla bla entry, because it's the top-most entry where all children are past and done. The TODO foo is not recognized, because although its timestamp is in the past, it has an open TODO state. (And because of that, the parent of both entries Project X doesn't match the search criteria.) (If I understand the question correctly...) The variable org-stuck-projects (see the docstring) can be tweaked to identify subtrees that match your criteria. Although I don't use the stuck projects functionality right now, I don't want to abuse it for something different. A custom skip function might also be useful here. (info (org) Special agenda views) Thanks, I'll read that up. Bye, Tassilo ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Re: Finding old appointments
Tassilo Horn wrote: Matt Lundin m...@imapmail.org writes: Well, basically I'm just looking for a search facility that shows me an agenda view with all entries that contain only timestamps before today and no pending todos, so that I can use the agenda commands to act on them. Some will be deleted, others archived. Here's an example of an agenda view that would bring up all old, active timestamps marked DONE: C-c a m [RET] TIMESTAMPtoday+TODO=DONE Oh, nice. I've never use this search, but it is very useful. Simply by searching for a timestamp before today does already help me. Additionally, playing around with it helped me being even more specific. So what I want to get is an agenda with - headlines that contain only past timestamps and are closed TODOs (if they are TODOs), that is, any TODO state after the | in `org-todo-keywords' - the same applies to all children of that entry, recursively This is quite simple: The function returns non-nil if an entry is active (recursion \o/): (defun dmj/org-entry-is-active-p () Return non-nil if entry is active. An entry is considered to be active if it has an active timestamp in the future or an open TODO keyword or at least one active child. (save-excursion (beginning-of-line) (let ((children (delq nil (org-map-entries 'dmj/org-entry-is-active-p (format LEVEL%d (org-outline-level)) 'tree))) (timestamp (org-entry-get nil TIMESTAMP))) (or (org-entry-is-todo-p) children (and timestamp (time-less-p (current-time) (org-time-string-to-time timestamp))) - the agenda should only list the top-most entries for which these properties hold This is the tougher part: Because the state of an entry (active/inactive) depends on its children the function that finally displays the entries must first obtain the state of the entries and their relationships and then remove all inactive entries whose (grand,grand...)parents are inactive. Sounds like you would require a a user-defined agenda function in `org-agenda-custom-commands'. HTH, -- David -- OpenPGP... 0x99ADB83B5A4478E6 Jabber dmj...@jabber.org Email. dm...@ictsoc.de pgpW4a6hV4Dtd.pgp Description: PGP signature ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] Re: Finding old appointments
David Maus dm...@ictsoc.de writes: Hi David, - headlines that contain only past timestamps and are closed TODOs (if they are TODOs), that is, any TODO state after the | in `org-todo-keywords' - the same applies to all children of that entry, recursively This is quite simple: The function returns non-nil if an entry is active (recursion \o/): (defun dmj/org-entry-is-active-p () Return non-nil if entry is active. An entry is considered to be active if it has an active timestamp in the future or an open TODO keyword or at least one active child. (save-excursion (beginning-of-line) (let ((children (delq nil (org-map-entries 'dmj/org-entry-is-active-p (format LEVEL%d (org-outline-level)) 'tree))) (timestamp (org-entry-get nil TIMESTAMP))) (or (org-entry-is-todo-p) children (and timestamp (time-less-p (current-time) (org-time-string-to-time timestamp))) Looks good. :-) - the agenda should only list the top-most entries for which these properties hold This is the tougher part: Because the state of an entry (active/inactive) depends on its children the function that finally displays the entries must first obtain the state of the entries and their relationships and then remove all inactive entries whose (grand,grand...)parents are inactive. Sounds like you would require a a user-defined agenda function in `org-agenda-custom-commands'. Yes, that's most likely. I'll dig into that further when I find some spare time. Thanks a lot for providing this starting point for me. Bye, Tassilo ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] Re: Finding old appointments
Sébastien Vauban wxhgmqzgw...@spammotel.com writes: Hi Sébastien, What's the info available about your past appointments? I'm a bit puzzled about what I have to do with old appointments. Let me explain... I have such appointments: ** Dentist 2010-07-28 Wed 10:45-11:15 ** Meeting client ABC 2010-08-19 Thu 10:00-12:00 Yes, I have many of those Meeting with John Doe appointments with no subtree, too. Additionally, there are some more complex outdated entries, that have subtrees and done todos. OK. We're on 1st of August. What do I do with the first entry (dentist)? - leave it like it is? - change the angle brackets by [] (to explictly make it inactive)? - remove it? I'd tag it with the archive tag. Is it the type of information you have about your past entries? Active or inactive timestamps? Yes, what I want to spot are enties with an active (or also inactive? not sure about this one) timestamp that is before today, and if it's a TODO, it has to be in a DONE state. The same must hold for any subtrees. Would we do the full right clocking behavior, we should have clocked in and out such entries. So, the right info would be in LOGBOOK. Do you have such info as well about your past entries? I don't use clocking, but only changes to the TODO state are recorded in LOGBOOK. What is the right behavior? Well, basically I'm just looking for a search facility that shows me an agenda view with all entries that contain only timestamps before today and no pending todos, so that I can use the agenda commands to act on them. Some will be deleted, others archived. Bye, Tassilo ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] Re: Finding old appointments
Tassilo Horn tass...@member.fsf.org writes: Additionally, there are some more complex outdated entries, that have subtrees and done todos. Yes, what I want to spot are enties with an active (or also inactive? not sure about this one) timestamp that is before today, and if it's a TODO, it has to be in a DONE state. The same must hold for any subtrees. Well, basically I'm just looking for a search facility that shows me an agenda view with all entries that contain only timestamps before today and no pending todos, so that I can use the agenda commands to act on them. Some will be deleted, others archived. Here's an example of an agenda view that would bring up all old, active timestamps marked DONE: C-c a m [RET] TIMESTAMPtoday+TODO=DONE (If I understand the question correctly...) The variable org-stuck-projects (see the docstring) can be tweaked to identify subtrees that match your criteria. A custom skip function might also be useful here. (info (org) Special agenda views) Best, Matt ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] Re: Finding old appointments
Hi Tassilo, for some projects, I have tenth of appointment entry children with a past timestamp. They sometimes annoy me cause they make spotting the actual entries harder. Is there a way to spot such outdated entries, like building an agenda view of outdated entries? To be more precise, with outdated entry I mean a headline that contains only past timestamps and has only finished todos and is not tagged with ARCHIVE (cause then I already spotted it). Maybe that's a task for a custom agenda view? I have to admit, that I didn't use those till now... Not directly answering your point, but trying to make your point more accurate... What's the info available about your past appointments? I'm a bit puzzled about what I have to do with old appointments. Let me explain... I have such appointments: --8---cut here---start-8--- ** Dentist 2010-07-28 Wed 10:45-11:15 ** Meeting client ABC 2010-08-19 Thu 10:00-12:00 --8---cut here---end---8--- OK. We're on 1st of August. What do I do with the first entry (dentist)? - leave it like it is? - change the angle brackets by [] (to explictly make it inactive)? - remove it? Is it the type of information you have about your past entries? Active or inactive timestamps? Would we do the full right clocking behavior, we should have clocked in and out such entries. So, the right info would be in LOGBOOK. Do you have such info as well about your past entries? What is the right behavior? I guess the last one... Best regards, Seb -- Sébastien Vauban ___ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode