emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [feature request] org-agenda-skip-unless
@ 2020-09-28 21:40 Alexander Adolf
  2020-12-07  5:14 ` Kyle Meyer
  0 siblings, 1 reply; 4+ messages in thread
From: Alexander Adolf @ 2020-09-28 21:40 UTC (permalink / raw)
  To: emacs-orgmode

Hello All,

I wanted to improve a bit on my current, simple agenda setup

(setq org-agenda-custom-commands
      '(("n" "Agenda and all TODOs"
	 ((agenda "" nil)
          (alltodo "" ((org-agenda-block-separator "")))))))

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.

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)))))
          (alltodo "" ((org-agenda-block-separator "")
		       (org-agenda-overriding-header "Other TODO items:")
		       (org-agenda-skip-function '(org-agenda-skip-if nil '(scheduled deadline)))))))))



Many thanks and looking forward to your thoughts,

  --alexander


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

* Re: [feature request] org-agenda-skip-unless
  2020-09-28 21:40 [feature request] org-agenda-skip-unless Alexander Adolf
@ 2020-12-07  5:14 ` Kyle Meyer
  2020-12-22 21:06   ` Alexander Adolf
  0 siblings, 1 reply; 4+ messages in thread
From: Kyle Meyer @ 2020-12-07  5:14 UTC (permalink / raw)
  To: Alexander Adolf; +Cc: emacs-orgmode


[ 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))))


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

* Re: [feature request] org-agenda-skip-unless
  2020-12-07  5:14 ` Kyle Meyer
@ 2020-12-22 21:06   ` Alexander Adolf
  2020-12-22 21:24     ` Kyle Meyer
  0 siblings, 1 reply; 4+ messages in thread
From: Alexander Adolf @ 2020-12-22 21:06 UTC (permalink / raw)
  To: Kyle Meyer; +Cc: emacs-orgmode

Hello Kyle,

Kyle Meyer <kyle@kyleam.com> writes:

> [ sorry for the slow response ]

Same here...

> [...]
>> 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))))

Ha, that's genius! Many thanks for sharing your wisdom!

While I'm apparently still on the learning curve, would you agree that
wishing for some more documentation around org-agenda would not bear the
danger of fostering opulence? ;-)


Many thanks and happy holidays,

  --alexander


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

* Re: [feature request] org-agenda-skip-unless
  2020-12-22 21:06   ` Alexander Adolf
@ 2020-12-22 21:24     ` Kyle Meyer
  0 siblings, 0 replies; 4+ messages in thread
From: Kyle Meyer @ 2020-12-22 21:24 UTC (permalink / raw)
  To: Alexander Adolf; +Cc: emacs-orgmode

Alexander Adolf writes:

> While I'm apparently still on the learning curve, would you agree that
> wishing for some more documentation around org-agenda would not bear the
> danger of fostering opulence? ;-)

I rarely think more documentation is a bad thing :), and any help in
that regard is greatly appreciated.


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

end of thread, other threads:[~2020-12-22 21:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-28 21:40 [feature request] org-agenda-skip-unless Alexander Adolf
2020-12-07  5:14 ` Kyle Meyer
2020-12-22 21:06   ` Alexander Adolf
2020-12-22 21:24     ` Kyle Meyer

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).