[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Orgmode] Re: Is it possible to show an agenda item only if it's due?
From: |
Matt Lundin |
Subject: |
[Orgmode] Re: Is it possible to show an agenda item only if it's due? |
Date: |
Tue, 22 Sep 2009 12:42:59 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1 (darwin) |
PT <address@hidden> 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