Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Making org-agenda-list hide items scheduled for the future

Tags:

emacs

org-mode

I use the org-mode weekly/daily agenda and want to be able to use the SCHEDULED keyword to hide items until the scheduled time comes up. I don't want to think about them until then. How can I set up org-agenda-list to do this?

This is the list of agenda items, not the TODO list. I already have org-agenda-todo-ignore-scheduled set to future. It does not help.

like image 393
Michael Hoffman Avatar asked Jan 14 '14 16:01

Michael Hoffman


2 Answers

Set

(setq org-agenda-todo-ignore-scheduled 'future)

and

(setq org-agenda-tags-todo-honor-ignore-options t)
like image 107
fniessen Avatar answered Oct 09 '22 14:10

fniessen


You can probably get what you want using org-modes confusing set of parameters but it's probably just easier creating a custom filter function

  (defun my/org-skip-function (part)
    "Partitions things to decide if they should go into the agenda '(agenda future-scheduled done)"
    (let* ((skip (save-excursion (org-entry-end-position)))
           (dont-skip nil)
           (scheduled-time (org-get-scheduled-time (point)))
           (result
            (or (and scheduled-time
                     (time-less-p (current-time) scheduled-time)
                     'future-scheduled)  ; This is scheduled for a future date
                (and (org-entry-is-done-p) ; This entry is done and should probably be ignored
                     'done)
                'agenda)))                 ; Everything else should go in the agenda
      (if (eq result part) dont-skip skip)))
   (setq org-agenda-skip-function '(my/org-skip-function 'agenda))

If you want other filters just add them to the or-block with a different tag.

like image 26
Moyamo Avatar answered Oct 09 '22 12:10

Moyamo