emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Agenda: skip sub-item if parent is scheduled
@ 2018-02-11 17:39 Matthieu Caneill
  2018-04-26 23:34 ` Bastien
  0 siblings, 1 reply; 2+ messages in thread
From: Matthieu Caneill @ 2018-02-11 17:39 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 520 bytes --]

Hi,

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?

Thanks in advance,
--
Matthieu

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Agenda: skip sub-item if parent is scheduled
  2018-02-11 17:39 Agenda: skip sub-item if parent is scheduled Matthieu Caneill
@ 2018-04-26 23:34 ` Bastien
  0 siblings, 0 replies; 2+ messages in thread
From: Bastien @ 2018-04-26 23:34 UTC (permalink / raw)
  To: Matthieu Caneill; +Cc: emacs-orgmode

Hi Matthieu,

Matthieu Caneill <matt@brokenwa.re> 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-04-26 23:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-11 17:39 Agenda: skip sub-item if parent is scheduled Matthieu Caneill
2018-04-26 23:34 ` Bastien

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).