emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Finding old appointments
@ 2010-07-22 20:26 Tassilo Horn
  2010-07-24 21:31 ` Sébastien Vauban
  0 siblings, 1 reply; 7+ messages in thread
From: Tassilo Horn @ 2010-07-22 20:26 UTC (permalink / raw)
  To: emacs-orgmode

Hi all,

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

Bye,
Tassilo

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

* Re: Finding old appointments
  2010-07-22 20:26 Finding old appointments Tassilo Horn
@ 2010-07-24 21:31 ` Sébastien Vauban
  2010-07-25 18:13   ` Tassilo Horn
  0 siblings, 1 reply; 7+ messages in thread
From: Sébastien Vauban @ 2010-07-24 21:31 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

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-mXXj517/zsQ@public.gmane.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: Finding old appointments
  2010-07-24 21:31 ` Sébastien Vauban
@ 2010-07-25 18:13   ` Tassilo Horn
  2010-07-25 19:34     ` Matt Lundin
  0 siblings, 1 reply; 7+ messages in thread
From: Tassilo Horn @ 2010-07-25 18:13 UTC (permalink / raw)
  To: emacs-orgmode

Sébastien Vauban <wxhgmqzgwmuf@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

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

* Re: Finding old appointments
  2010-07-25 18:13   ` Tassilo Horn
@ 2010-07-25 19:34     ` Matt Lundin
  2010-07-26  7:32       ` Tassilo Horn
  0 siblings, 1 reply; 7+ messages in thread
From: Matt Lundin @ 2010-07-25 19:34 UTC (permalink / raw)
  To: Tassilo Horn; +Cc: emacs-orgmode

Tassilo Horn <tassilo@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] TIMESTAMP<"<today>"+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

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

* Re: Finding old appointments
  2010-07-25 19:34     ` Matt Lundin
@ 2010-07-26  7:32       ` Tassilo Horn
  2010-07-26  9:54         ` David Maus
  0 siblings, 1 reply; 7+ messages in thread
From: Tassilo Horn @ 2010-07-26  7:32 UTC (permalink / raw)
  To: emacs-orgmode

Matt Lundin <mdl@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] TIMESTAMP<"<today>"+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

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

* Re: Re: Finding old appointments
  2010-07-26  7:32       ` Tassilo Horn
@ 2010-07-26  9:54         ` David Maus
  2010-07-26 11:46           ` Tassilo Horn
  0 siblings, 1 reply; 7+ messages in thread
From: David Maus @ 2010-07-26  9:54 UTC (permalink / raw)
  To: Tassilo Horn; +Cc: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 2245 bytes --]

Tassilo Horn wrote:
>Matt Lundin <mdl@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] TIMESTAMP<"<today>"+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.... dmjena@jabber.org
Email..... dmaus@ictsoc.de

[-- Attachment #1.2: Type: application/pgp-signature, Size: 230 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
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

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

* Re: Finding old appointments
  2010-07-26  9:54         ` David Maus
@ 2010-07-26 11:46           ` Tassilo Horn
  0 siblings, 0 replies; 7+ messages in thread
From: Tassilo Horn @ 2010-07-26 11:46 UTC (permalink / raw)
  To: emacs-orgmode

David Maus <dmaus@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

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

end of thread, other threads:[~2010-07-26 11:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-22 20:26 Finding old appointments Tassilo Horn
2010-07-24 21:31 ` Sébastien Vauban
2010-07-25 18:13   ` Tassilo Horn
2010-07-25 19:34     ` Matt Lundin
2010-07-26  7:32       ` Tassilo Horn
2010-07-26  9:54         ` David Maus
2010-07-26 11:46           ` Tassilo Horn

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