diff options
author | Carsten Dominik <carsten.dominik@gmail.com> | 2011-10-25 16:07:01 +0200 |
---|---|---|
committer | Carsten Dominik <carsten.dominik@gmail.com> | 2011-10-25 16:07:01 +0200 |
commit | 8444207d3e65e107b6d00d320b156ec65bf80abe (patch) | |
tree | a2b7d76ae2f2d01bfd09fb6a2b83cff2e5cefd74 | |
parent | 4e33bfb83ac200b2bea9bfabb33ce1619960e7ff (diff) | |
download | org-mode-8444207d3e65e107b6d00d320b156ec65bf80abe.tar.gz |
Make `diary-class' skip hlidays if the user asks for it.
* lisp/org-agenda.el (org-class): Allow holidays to be skipped.
-rw-r--r-- | lisp/org-agenda.el | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index d0e7a03..66686f9 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -4891,9 +4891,11 @@ This function is invoked if `org-agenda-todo-ignore-deadlines', ;; Define the` org-class' function (defun org-class (y1 m1 d1 y2 m2 d2 dayname &rest skip-weeks) "Entry applies if date is between dates on DAYNAME, but skips SKIP-WEEKS. -DAYNAME is a number between 0 (Sunday) and 6 (Saturday). SKIP-WEEKS -is any number of ISO weeks in the block period for which the item should -be skipped." +DAYNAME is a number between 0 (Sunday) and 6 (Saturday). +SKIP-WEEKS is any number of ISO weeks in the block period for which the +item should be skipped. If any of the SKIP-WEEKS arguments is the symbol +`holidays', then any date that is known by the Emacs calendar to be a +holidy will also be skipped." (let* ((date1 (calendar-absolute-from-gregorian (list m1 d1 y1))) (date2 (calendar-absolute-from-gregorian (list m2 d2 y2))) (d (calendar-absolute-from-gregorian date))) @@ -4905,6 +4907,8 @@ be skipped." (progn (require 'cal-iso) (not (member (car (calendar-iso-from-absolute d)) skip-weeks)))) + (not (and (memq `holidays' skip-weeks) + (calendar-check-holidays date))) entry))) (defun org-diary-class (m1 d1 y1 m2 d2 y2 dayname &rest skip-weeks) |