emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Agenda: skip sub-item if parent is scheduled


From: Bastien
Subject: Re: [O] Agenda: skip sub-item if parent is scheduled
Date: Fri, 27 Apr 2018 01:34:37 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)

Hi Matthieu,

Matthieu Caneill <address@hidden> writes:

> In a custom `tags-todo` agenda view, I can't manage to skip sub-items
> if their parent is scheduled.
>
> If I have this:
>
> * TODO parent item
>   SCHEDULED: <2018-02-11>
> ** TODO child sub-item
>
> I don't want any item to appear in the `tags-todo` list.
>
> I have: `org-tags-match-list-sublevels nil`.
> If I set `org-agenda-skip-entry-if'scheduled 'deadline`, the child
> will appear in the list, and if I don't have it the parent will
> (expectedly) appear in the list.
>
> Any idea how to solve this?

Something like this:

(defun my-skip-entries-below-scheduled-entry ()
  (when (save-excursion
          (org-up-heading-safe)
          (org-get-scheduled-time (point)))
    (org-end-of-subtree t t)))

(setq org-agenda-skip-function-global
      #'my-skip-entries-below-scheduled-entry)

Don't use `org-agenda-skip-function-global' though, use
`org-agenda-skip-function' within `org-agenda-custom-commands'.

HTH,

-- 
 Bastien



reply via email to

[Prev in Thread] Current Thread [Next in Thread]