emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [help] need help with a skip function


From: Samuel Loury
Subject: Re: [O] [help] need help with a skip function
Date: Fri, 26 Sep 2014 12:15:41 +0200
User-agent: Notmuch/0.17 (http://notmuchmail.org) Emacs/24.3.1 (x86_64-pc-linux-gnu)

Subhan Michael Tindall <address@hidden> 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: pgp5nAIjmgmde.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]