From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: Agenda: skip sub-item if parent is scheduled Date: Fri, 27 Apr 2018 01:34:37 +0200 Message-ID: <87in8dtucy.fsf@bzg.fr> References: <20180211173902.GI1433@brokenwa.re> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41242) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fBqPU-00080U-J7 for emacs-orgmode@gnu.org; Thu, 26 Apr 2018 19:34:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fBqPS-0001JE-24 for emacs-orgmode@gnu.org; Thu, 26 Apr 2018 19:34:44 -0400 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Matthieu Caneill Cc: emacs-orgmode@gnu.org Hi Matthieu, Matthieu Caneill 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