emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Rüdiger Sonderfeld" <ruediger@c-plusplus.de>
To: emacs-orgmode@gnu.org
Subject: Patch: Mark org-diary-class as obsolete and skip entries on holidays in org-class
Date: Mon, 10 Oct 2011 21:15:58 +0200	[thread overview]
Message-ID: <948200b88322d1f5701f0347b3c19f31@pseudoterminal.org> (raw)

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

Hello,
I wrote two small patches. The first one marks org-diary-class as obsolete
(according to its documentation it is deprecated). The second one is a
patch for org-class. It changes org-class to skip entries that are on
holidays.

Maybe the second change should be made optional.

Regards,
Rüdiger

P.S. I have signed the FSF papers.

[-- Attachment #2: 0001-Mark-org-diary-class-as-obsolete-use-org-class.patch --]
[-- Type: text/plain, Size: 791 bytes --]

From 3774298aeb959b36bf39ac0988999b94198c1984 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=BCdiger=20Sonderfeld?= <ruediger@c-plusplus.de>
Date: Mon, 10 Oct 2011 20:59:28 +0200
Subject: [PATCH 1/2] Mark org-diary-class as obsolete (use org-class).

---
 lisp/org-agenda.el |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index b208d1e..faca285 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -4913,6 +4913,7 @@ please use `org-class' instead."
      (nth 2 date1) (car date1) (nth 1 date1)
      (nth 2 date2) (car date2) (nth 1 date2)
      dayname skip-weeks)))
+(make-obsolete 'org-diary-class 'org-class "")
 
 (defalias 'org-get-closed 'org-agenda-get-progress)
 (defun org-agenda-get-progress ()
-- 
1.7.7


[-- Attachment #3: 0002-org-class-Skip-entries-on-holidays.patch --]
[-- Type: text/plain, Size: 1303 bytes --]

From 66fdd7995556002c4b5061641dbac5c1a7788d02 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=BCdiger=20Sonderfeld?= <ruediger@c-plusplus.de>
Date: Mon, 10 Oct 2011 21:07:02 +0200
Subject: [PATCH 2/2] org-class: Skip entries on holidays.

---
 lisp/org-agenda.el |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index faca285..8fe9cc7 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -4881,7 +4881,7 @@ This function is invoked if `org-agenda-todo-ignore-deadlines',
   "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."
+be skipped. Entries are also skipped if they happen on a holiday."
   (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)))
@@ -4893,6 +4893,7 @@ be skipped."
 	 (progn
 	   (require 'cal-iso)
 	   (not (member (car (calendar-iso-from-absolute d)) skip-weeks))))
+     (not (calendar-check-holidays date))
      entry)))
 
 (defun org-diary-class (m1 d1 y1 m2 d2 y2 dayname &rest skip-weeks)
-- 
1.7.7


             reply	other threads:[~2011-10-10 19:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-10 19:15 Rüdiger Sonderfeld [this message]
2011-10-25 14:08 ` Patch: Mark org-diary-class as obsolete and skip entries on holidays in org-class Carsten Dominik
2011-10-25 17:03   ` Rüdiger Sonderfeld
2011-10-27  6:22 ` Carsten Dominik
2011-10-27 16:44   ` Achim Gratz
2011-10-28 14:53     ` Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=948200b88322d1f5701f0347b3c19f31@pseudoterminal.org \
    --to=ruediger@c-plusplus.de \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).