diff options
author | Carsten Dominik <carsten.dominik@gmail.com> | 2010-01-14 23:06:13 +0100 |
---|---|---|
committer | Carsten Dominik <carsten.dominik@gmail.com> | 2010-01-14 23:06:13 +0100 |
commit | a1e0409ab7c2fb6f902d2413295f16b32f3f516f (patch) | |
tree | 177a395ac9237f1af110b7f5d8fb126d6aa64aff | |
parent | 2b45d655bb6e828c40a95fafc3e77489d21e80e3 (diff) | |
download | org-mode-a1e0409ab7c2fb6f902d2413295f16b32f3f516f.tar.gz |
Keep byte compiler happy
-rwxr-xr-x | lisp/ChangeLog | 5 | ||||
-rw-r--r-- | lisp/org-agenda.el | 17 | ||||
-rw-r--r-- | lisp/org.el | 17 |
3 files changed, 29 insertions, 10 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 58ca50d..88cd22e 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,10 @@ 2010-01-14 Carsten Dominik <carsten.dominik@gmail.com> + * org-agenda.el (org-diary-class): Use + `org-order-calendar-date-args'. + + * org.el (org-order-calendar-date-args): New function. + * org-exp.el (org-export-target-internal-links): Check for protectedness after the first bracket. diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index bb2efba..21768b9 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -4216,20 +4216,17 @@ the documentation of `org-diary'." (defun org-diary-class (m1 d1 y1 m2 d2 y2 dayname &rest skip-weeks) "Entry applies if date is between dates on DAYNAME, but skips SKIP-WEEKS. -Order of the parameters is M1, D1, Y1, M2, D2, Y2 if -`european-calendar-style' is nil, and D1, M1, Y1, D2, M2, Y2 if -`european-calendar-style' is t. +The order of the first 2 times 3 arguments depends on the variable +`calendar-date-style' or, if that is not defined, on `european-calendar-style'. +So for american calendars, give this as MONTH DAY YEAR, for european as +DAY MONTH YEAR, and for ISO as YEAR MONTH DAY. 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." (let* ((date1 (calendar-absolute-from-gregorian - (if european-calendar-style - (list d1 m1 y1) - (list m1 d1 y1)))) + (org-order-calendar-date-args m1 d1 y1))) (date2 (calendar-absolute-from-gregorian - (if european-calendar-style - (list d2 m2 y2) - (list m2 d2 y2)))) + (org-order-calendar-date-args m2 d2 y2))) (d (calendar-absolute-from-gregorian date))) (and (<= date1 d) @@ -6877,7 +6874,7 @@ the resulting entry will not be shown. When TEXT is empty, switch to (let ((calendar-date-display-form (if (if (boundp 'calendar-date-style) (eq calendar-date-style 'european) - european-calendar-style) ; Emacs 22 + (org-bound-and-true-p european-calendar-style)) ; Emacs 22 '(day " " month " " year) '(month " " day " " year)))) diff --git a/lisp/org.el b/lisp/org.el index 7e039be..8859b27 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -13561,6 +13561,23 @@ DEF-FLAG is t when a double ++ or -- indicates shift relative to (list delta "d" rel)) (list (* n (if (= dir ?-) -1 1)) what rel))))) +(defun org-order-calendar-date-args (arg1 arg2 arg3) + "Turn a user-specified date into the internal representation. +The internal representation needed by the calendar is (month day year). +This is a wrapper to handle the brain-dead convention in calendar that +user function argument order change dependent on argument order." + (if (boundp 'calendar-date-style) + (cond + ((eq calendar-date-style 'american) + (list arg1 arg2 arg3)) + ((eq calendar-date-style 'european) + (list arg2 arg1 arg3)) + ((eq calendar-date-style 'iso) + (list arg2 arg3 arg1))) + (if (org-bound-and-true-p european-calendar-style) + (list arg2 arg1 arg3) + (list arg1 arg2 arg3)))) + (defun org-eval-in-calendar (form &optional keepdate) "Eval FORM in the calendar window and return to current window. Also, store the cursor date in variable org-ans2." |