emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Kyle Meyer <kyle@kyleam.com>
To: Alexander Adolf <alexander.adolf@condition-alpha.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: [feature request] org-agenda-skip-unless
Date: Mon, 07 Dec 2020 05:14:27 GMT	[thread overview]
Message-ID: <87pn3mgpvf.fsf@kyleam.com> (raw)
In-Reply-To: <c3b65ac4715b3b81dc9e5d6737cdb954@condition-alpha.com>


[ sorry for the slow response ]

Alexander Adolf writes:

[...]
> and achieve an agenda with three sections:
> 1) (agenda "" nil)
> 2) all todos with some planning information (scheduled or deadline)
> 3) all todos without any planning information
>
> Number 1 I already have. Number 3 can be achieved with
>
> (org-agenda-skip-function '(org-agenda-skip-if nil '(scheduled deadline)))
>
> But what about number 2? I searched the docs and code, bout couldn't
> seem to find anything.
>
> I hence ended up with the idea that I would need a new function,
> hypothetically (and cunningly) called org-agenda-skip-unless, which
> would do the same as org-agenda-skip-if, but with inverted logic.

I'm not necessarily against the idea, though I'm not yet convinced
there's a big need...

> With that, my dream agenda would be:
>
> (setq org-agenda-custom-commands
>       '(("n" "Agenda and all TODOs"
> 	 ((agenda "" nil)
>           (alltodo "" ((org-agenda-block-separator "")
> 		       (org-agenda-overriding-header "TODO items with a date:")
> 		       (org-agenda-skip-function '(org-agenda-skip-unless nil '(scheduled deadline)))))

org-agenda-skip-if accepts notscheduled and notdeadline conditions.
Passing them both to a single org-agenda-skip-if wouldn't do what you
want because org-agenda-skip-if combines its conditions with `or'.
However, you could combine two separate org-agenda-skip-if calls:

    (org-agenda-skip-function
     '(and (org-agenda-skip-if nil '(notscheduled))
           (org-agenda-skip-if nil '(notdeadline))))


  reply	other threads:[~2020-12-07  5:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-28 21:40 Alexander Adolf
2020-12-07  5:14 ` Kyle Meyer [this message]
2020-12-22 21:06   ` Alexander Adolf
2020-12-22 21:24     ` Kyle Meyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pn3mgpvf.fsf@kyleam.com \
    --to=kyle@kyleam.com \
    --cc=alexander.adolf@condition-alpha.com \
    --cc=emacs-orgmode@gnu.org \
    --subject='Re: [feature request] org-agenda-skip-unless' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Code repositories for project(s) associated with this 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).