0

In my org-agenda view I have some todos which are way past their scheduled time, but I have not had the chance to get to them.

Is there any way to hide such todos, which have past their sceduled time, by lets say ten days?

 quasar-agenda:Sched.34x: TODO Hukarz 

1 Answer 1

1

This is a two-part answer. The first part is how to do what you asked; the second part is why someone asking this question might be misusing org-mode features.

Org agenda has a lot of built-in ways to filter, and it also has a "make your own". We're going to be using this latter feature.

(defun jhunt-skip-if-missed-plans () "Skip if scheduled date is ten days or more into the past" (let ((subtree-end (save-excursion (org-end-of-subtree t))) (scheduled-start (org-time-string-to-time (org-entry-get (point) "SCHEDULED"))) (ten-days-ago (org-time-string-to-time (org-read-date nil nil "-10d" nil nil nil nil)))) (if (and scheduled-start (time-less-p scheduled-start ten-days-ago)) subtree-end nil))) (let ((org-agenda-custom-commands '(("g" "skip unstarted scheduled things" ((agenda "" (org-agenda-skip-function 'jhunt-skip-if-missed-plans)))))))) (org-agenda nil "g")) 

Basically these skip functions must return the location where to continue or nil if we should process this entry.

Now, why might this be the wrong question to ask?

Well, because SCHEDULED in org-mode is to be used only for activities that must start by a certain time; if they have slipped and your main issue is that they show up in the agenda, then probably they shouldn't have been SCHEDULED.

Also, from inside the agenda you can call C-c C-s to reschedule them to start at a later date, which .. Maybe you need to take a long time to figure out that date, and that's why you want to hide them. But... Hiding the problem is not great, generally :D

Anyway. There ya go.

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.