emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Guide to writing custom skip functions for agenda views using org-agenda-skip-function
@ 2014-06-25  8:18 Arunabha Ghosh
  2014-06-25  8:42 ` Sebastien Vauban
  0 siblings, 1 reply; 2+ messages in thread
From: Arunabha Ghosh @ 2014-06-25  8:18 UTC (permalink / raw)
  To: emacs-orgmode

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

Hi,
    Is there a guide on writing functions for implementing custom skip
criteria for agenda items using org-agenda-skip-function ? I understand the
basic premise behind org-agenda-skip-function but examples from other
people's configs don't make much sense.

What are the inputs to the skip function, there seem to be none. If so, how
do I figure out which entry is the skip function is being called on and how
do I evaluate predicates over that entry ? e.g. I'd like to have a skip
function that skips entries only if they are scheduled *in the future*. How
would I go about implementing such a function ?

Thanks,
Arunabha

[-- Attachment #2: Type: text/html, Size: 1152 bytes --]

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

* Re: Guide to writing custom skip functions for agenda views using org-agenda-skip-function
  2014-06-25  8:18 Guide to writing custom skip functions for agenda views using org-agenda-skip-function Arunabha Ghosh
@ 2014-06-25  8:42 ` Sebastien Vauban
  0 siblings, 0 replies; 2+ messages in thread
From: Sebastien Vauban @ 2014-06-25  8:42 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Arunabha Ghosh wrote:
>     Is there a guide on writing functions for implementing custom skip
> criteria for agenda items using org-agenda-skip-function ? I understand the
> basic premise behind org-agenda-skip-function but examples from other
> people's configs don't make much sense.

Here some working examples extracted from my config:

--8<---------------cut here---------------start------------->8---
    ...
    (org-agenda-skip-function
     '(org-agenda-skip-entry-if 'notdeadline))
--8<---------------cut here---------------end--------------->8---

and

--8<---------------cut here---------------start------------->8---
    ...
    (org-agenda-skip-function
     '(org-agenda-skip-entry-when-regexp-matches))
    (org-agenda-skip-regexp "\\[#A\\]")))
--8<---------------cut here---------------end--------------->8---

A more complex one:

--8<---------------cut here---------------start------------->8---
  (add-to-list 'org-agenda-custom-commands
               `("r" "All active tasks, by due date"
                 ((agenda ""
                          ((org-agenda-overriding-header "Today")
                           ;; !FIXME! We don't see "timed" DEADLINE
                           (org-agenda-skip-function
                            (lambda ()
                              (let* ((dl (org-entry-get nil "DEADLINE")))
                                (if (or (not dl)
                                        (equal dl "")
                                        (org-time> dl (org-time-today)))
                                    (progn (outline-next-heading) (point))))))
                           (org-agenda-skip-scheduled-if-deadline-is-shown t)
                           (org-agenda-span 'day)
                           (org-deadline-warning-days 0))))))
--8<---------------cut here---------------end--------------->8---

Best regards,
  Seb

-- 
Sebastien Vauban

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

end of thread, other threads:[~2014-06-25  8:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-25  8:18 Guide to writing custom skip functions for agenda views using org-agenda-skip-function Arunabha Ghosh
2014-06-25  8:42 ` Sebastien Vauban

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