Subhan Michael Tindall <subh...@familycareinc.org> writes:

> Hi, I'm looking for an example org-agenda-skip-function that I can use to 
> include all items for an agenda (IE alltodo) that have a certain property set 
> (value doesn't particularly matter)
> IE:
>>* TODO H1
>>  :PROPERTIES:
>>  :P1: date
>>  :END:
>>* TODO H2
>>  :PROPERTIES:
>>  :END:
> So that H1 gets included, but H2 does not.
> I know, it's simple to do with a search-type agenda, but unfortunately a bug 
> in sorting for inactive time stamps makes that route unsuitable for my 
> purposes.
>
>
> Thanks!
> Subhan
I would do

--8<---------------cut here---------------start------------->8---
(defun my/skip-if-not-p1 ()
 (not (org-entry-get (point) "P1")))
...

(setq org-agenda-custom-commands
  '(
    ("p" "Todo entries with property p1"
     (
      (todo nil)
      )
     (
      (org-agenda-skip-function 'my/skip-if-not-p1)
      )
     )
    )
)
--8<---------------cut here---------------end--------------->8---

I have not tested it so beware the typo and reasoning errors but the
idea is there.

I think you could use org-element.el instead of the probably obsolete
`org-entry-get' but I don't know it well enough to propose a solution...

I hope it helps.

Best regards
-- 
Konubinix
GPG Key    : 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A

Attachment: pgpyux0YJXMb7.pgp
Description: PGP signature

Reply via email to