diff options
author | Michael Brand <michael.ch.brand@gmail.com> | 2011-08-01 10:53:33 +0200 |
---|---|---|
committer | Bastien Guerry <bzg@altern.org> | 2011-08-14 18:40:42 +0200 |
commit | 2f07dd516326289260e547705ad529788c080f87 (patch) | |
tree | 6720325e3982ddccb6baab96be0422cbd3d91ec1 | |
parent | 662c7a047be8beb124a020e8da2831d181bb7965 (diff) | |
download | org-mode-2f07dd516326289260e547705ad529788c080f87.tar.gz |
Agenda: Simplify old fix of face for deadline warning 0 day
* lisp/org-agenda.el (org-agenda-get-deadlines): Fix dfrac for the
case of wdays being 0. Don't pass wdays to org-agenda-deadline-face,
like before the old fix.
(org-agenda-deadline-face): Revert to old state that was without
wdays.
This allows a deadline warning period of "-0d" to work also with a
custom configuration like:
(setq org-agenda-deadline-faces
'((1.0001 . org-warning) ; due yesterday or before
(0.0 . org-upcoming-deadline))) ; due today or later
For org-agenda-deadline-faces left at default and all other settings
not exceeding 1.0, the face for a deadline warning of any length
remains untouched by this patch.
references to history:
* commit of the old fix
- http://orgmode.org/w/?p=org-mode.git;a=commitdiff;h=d0d6325
- git show d0d6325
* mailing list old thread
- http://thread.gmane.org/gmane.emacs.orgmode/5753
- http://lists.gnu.org/archive/html/emacs-orgmode/2008-02/msg00395.html
-rw-r--r-- | lisp/org-agenda.el | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index 7e346a7..c27969c 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -5169,7 +5169,7 @@ See also the user option `org-agenda-clock-consistency-checks'." (let ((org-deadline-warning-days suppress-prewarning)) (org-get-wdays s)) (org-get-wdays s)) - dfrac (/ (* 1.0 (- wdays diff)) (max wdays 1)) + dfrac (- 1 (/ (* 1.0 diff) (max wdays 1))) upcomingp (and todayp (> diff 0))) ;; When to show a deadline in the calendar: ;; If the expiration is within wdays warning time. @@ -5211,7 +5211,7 @@ See also the user option `org-agenda-clock-consistency-checks'." head category tags (if (not (= diff 0)) nil timestr))))) (when txt - (setq face (org-agenda-deadline-face dfrac wdays)) + (setq face (org-agenda-deadline-face dfrac)) (org-add-props txt props 'org-marker (org-agenda-new-marker pos) 'org-hd-marker (org-agenda-new-marker pos1) @@ -5226,10 +5226,9 @@ See also the user option `org-agenda-clock-consistency-checks'." (push txt ee)))))) (nreverse ee))) -(defun org-agenda-deadline-face (fraction &optional wdays) +(defun org-agenda-deadline-face (fraction) "Return the face to displaying a deadline item. FRACTION is what fraction of the head-warning time has passed." - (if (equal wdays 0) (setq fraction 1.)) (let ((faces org-agenda-deadline-faces) f) (catch 'exit (while (setq f (pop faces)) |