emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Is it possible to show an agenda item only if it's due?
@ 2009-09-22 15:30 PT
  2009-09-22 15:43 ` Matt Lundin
  0 siblings, 1 reply; 6+ messages in thread
From: PT @ 2009-09-22 15:30 UTC (permalink / raw)
  To: emacs-orgmode

I have several items on my agenda which have a time
specification (e.g. 4pm), but it only means I should work on it
sometime after 4pm. It can even be 8pm when I actually deal with
the item.

So there is no need for me to see the item constantly on the
daily agenda, I'd like this item to appear only if I display the
agenda after 4pm. I don't want to see it before the given time,
because I can't work on it then, so it only clutters the view.

Is it possible to do this with org?

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

* Re: Is it possible to show an agenda item only if it's due?
  2009-09-22 15:30 Is it possible to show an agenda item only if it's due? PT
@ 2009-09-22 15:43 ` Matt Lundin
  2009-09-22 15:50   ` PT
  0 siblings, 1 reply; 6+ messages in thread
From: Matt Lundin @ 2009-09-22 15:43 UTC (permalink / raw)
  To: PT; +Cc: emacs-orgmode

PT <spamfilteraccount@gmail.com> writes:

> I have several items on my agenda which have a time
> specification (e.g. 4pm), but it only means I should work on it
> sometime after 4pm. It can even be 8pm when I actually deal with
> the item.
>
> So there is no need for me to see the item constantly on the
> daily agenda, I'd like this item to appear only if I display the
> agenda after 4pm. I don't want to see it before the given time,
> because I can't work on it then, so it only clutters the view.
>
> Is it possible to do this with org?

One recommendation:

Create an ":EVENING:" tag and filter it out in the agenda. Or,
optionally, create custom agenda commands for day and evening agendas
that pull up different results based on tags.

- Matt

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

* Re: Is it possible to show an agenda item only if it's due?
  2009-09-22 15:43 ` Matt Lundin
@ 2009-09-22 15:50   ` PT
  2009-09-22 16:42     ` Matt Lundin
  0 siblings, 1 reply; 6+ messages in thread
From: PT @ 2009-09-22 15:50 UTC (permalink / raw)
  To: emacs-orgmode

Matt Lundin <mdl <at> imapmail.org> writes:

> One recommendation:
> 
> Create an ":EVENING:" tag and filter it out in the agenda. Or,
> optionally, create custom agenda commands for day and evening agendas
> that pull up different results based on tags.
> 

This wouldn't work, because I have lots of different such times during the day
which cannot be grouped into 2-3 main categories.

4pm was only an example. It can be any other time during the day and I only
want those items to appear when their time is due.

It would be nice if org handled a category or something which I could add
to the task and it would affect its display on the agenda.

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

* Re: Is it possible to show an agenda item only if it's due?
  2009-09-22 15:50   ` PT
@ 2009-09-22 16:42     ` Matt Lundin
  2009-09-22 17:12       ` PT
  0 siblings, 1 reply; 6+ messages in thread
From: Matt Lundin @ 2009-09-22 16:42 UTC (permalink / raw)
  To: PT; +Cc: emacs-orgmode

PT <spamfilteraccount@gmail.com> writes:

> Matt Lundin <mdl <at> imapmail.org> writes:
>
>> One recommendation:
>> 
>> Create an ":EVENING:" tag and filter it out in the agenda. Or,
>> optionally, create custom agenda commands for day and evening agendas
>> that pull up different results based on tags.
>> 
>
> This wouldn't work, because I have lots of different such times during
> the day which cannot be grouped into 2-3 main categories.
>
> 4pm was only an example. It can be any other time during the day and I only
> want those items to appear when their time is due.

Ah I see. Another idea: write an agenda skip function that converts the
timestamp to universal time and ignores the entry if it is greater than
(current-time). Such as,

--8<---------------cut here---------------start------------->8---
(defun my-skip-if-later ()
  "Skip entries that are later than the current time."
  (let ((time (or (org-entry-get nil "TIMESTAMP")
		  (org-entry-get nil "SCHEDULED"))))
    (when time
      (if (time-less-p (org-time-string-to-time time) (current-time))
	  nil          ;; less than current time --> include it
	(outline-next-heading))))) ;; otherwise move on

(setq org-agenda-custom-commands
      '(("A" "Without later items" agenda "" 
	 ((org-agenda-ndays 1)
         (org-agenda-skip-function '(my-skip-if-later))))))
--8<---------------cut here---------------end--------------->8---

Note: this is just a quick example. I haven't tested it and am not sure
whether it breaks something. Also, it would become considerably more
complex if you also wanted to consider time-of-day information in the
heading.

- Matt

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

* Re: Is it possible to show an agenda item only if it's due?
  2009-09-22 16:42     ` Matt Lundin
@ 2009-09-22 17:12       ` PT
  2009-09-23 12:18         ` J. David Boyd
  0 siblings, 1 reply; 6+ messages in thread
From: PT @ 2009-09-22 17:12 UTC (permalink / raw)
  To: emacs-orgmode

Matt Lundin <mdl <at> imapmail.org> writes:
> 
> Ah I see. Another idea: write an agenda skip function that converts the
> timestamp to universal time and ignores the entry if it is greater than
> (current-time). Such as,
> 

Wow, I didn't you can write your own agenda skip function. The depths of 
Org are infinite. :)

Thanks. I'll try your solution.

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

* Re: Is it possible to show an agenda item only if it's due?
  2009-09-22 17:12       ` PT
@ 2009-09-23 12:18         ` J. David Boyd
  0 siblings, 0 replies; 6+ messages in thread
From: J. David Boyd @ 2009-09-23 12:18 UTC (permalink / raw)
  To: emacs-orgmode

PT <spamfilteraccount@gmail.com> writes:

> Matt Lundin <mdl <at> imapmail.org> writes:
>> 
>> Ah I see. Another idea: write an agenda skip function that converts the
>> timestamp to universal time and ignores the entry if it is greater than
>> (current-time). Such as,
>> 
>
> Wow, I didn't you can write your own agenda skip function. The depths of 
> Org are infinite. :)
>
> Thanks. I'll try your solution.
>

Once you get it working, please share!

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

end of thread, other threads:[~2009-09-23 12:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-22 15:30 Is it possible to show an agenda item only if it's due? PT
2009-09-22 15:43 ` Matt Lundin
2009-09-22 15:50   ` PT
2009-09-22 16:42     ` Matt Lundin
2009-09-22 17:12       ` PT
2009-09-23 12:18         ` J. David Boyd

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