From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Behavior Change/Bug: Agenda sorting of deadline itemsv > 4.73 Date: Sun, 3 Feb 2008 09:21:52 +0100 Message-ID: <3BA48DE0-7304-4189-93B0-6BC2A1FA2A1E@science.uva.nl> References: <20080131103218.GB21734@atlantic.linksys.moosehall><8616E01A-5786-49E5-BA14-C5968EA2FE4A@science.uva.nl><20080131120310.GD21734@atlantic.linksys.moosehall><803AD9DF-C436-4733-B83D-90DBB16ADC21@science.uva.nl> <52D89C75FEE9444E8D9C016E3730098306CEB4@chsa1036.share.beluni.net> Mime-Version: 1.0 (Apple Message framework v915) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JLa6y-0003Bk-MQ for emacs-orgmode@gnu.org; Sun, 03 Feb 2008 03:22:00 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JLa6x-0003BY-2z for emacs-orgmode@gnu.org; Sun, 03 Feb 2008 03:21:59 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JLa6w-0003BV-Tf for emacs-orgmode@gnu.org; Sun, 03 Feb 2008 03:21:58 -0500 Received: from ug-out-1314.google.com ([66.249.92.168]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JLa6w-00020E-EY for emacs-orgmode@gnu.org; Sun, 03 Feb 2008 03:21:58 -0500 Received: by ug-out-1314.google.com with SMTP id a2so1286436ugf.48 for ; Sun, 03 Feb 2008 00:21:57 -0800 (PST) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Eric J Haywiser Cc: emacs-orgmode@gnu.org Hi Eric, thanks for your report, this is fixed now. The deadline priority is now 100 on the due date, and it changes by 100 over the duration of the warning day period. I hope this does work better. - Carsten On Feb 1, 2008, at 5:57 PM, Eric J Haywiser wrote: >> Hm, the 4.67c behaviour seems a bit more sensible as it >> incorporates the >> number of days that a deadline is delayed into the priority >> calculation. >> Have a look at the function org-agenda-get-deadlines where the >> priority >> of a deadline is calculated. Specifically the following code: >> >> : (setq s (match-string 1) >> : pos (1- (match-beginning 1)) >> : d2 (org-time-string-to-absolute (match-string 1) d1) >> : diff (- d2 d1) >> : wdays (org-get-wdays s) >> : dfrac (/ (* 1.0 (- wdays diff)) wdays) >> : upcomingp (and todayp (> diff 0))) >> >> and >> >> : 'priority (+ (if upcomingp (floor (* dfrac 10.)) 100) >> : (org-get-priority txt)) >> >> You might be able to tweak this to get the desired behaviour. >> >> Hope that helps >> Christian >> > Thank you. That pointer was very helpful. > > Without understanding all the details of the priority mechanism, I > have this tweak which may introduce other issues. > > It maps deadlines in range [-deadline-warning-days -> +deadline- > warning-days] > to a priority [2*d-w-d -> 0]. The other priorities coming from > org-get-priority are shifted 10x relative to 2*d-w-d regardless of > d-w-d's value. This makes priorites coming from o-g-p have more > weight than those calculated within o-a-g-d. I think this may have > been the original idea with the (* 1000 and (+ 100 but I'm not > really sure. > > diff org-5.19a.el org.el > 14979d14978 > < > 14984,14985c14983,14984 > < (* 1000 (- org-lowest-priority org-default-priority)) > < (* 1000 (- org-lowest-priority > --- >> (* (expt 10 (+ (floor (log10 (* 2 org-deadline-warning-days))) >> 1)) (- > org-lowest-priority org-default-priority)\ > ) >> (* (expt 10 (+ (floor (log10 (* 2 org-deadline-warning-days))) >> 1)) (- > org-lowest-priority > 21165c21164,21167 > < upcomingp (and todayp (> diff 0))) > --- >> partialpriority (+ (- 0 diff) wdays) >> upcomingp (and todayp (> diff 0)) >> pastp (<= diff 0) >> ) > 21204,21205c21206 > < 'priority (+ (if upcomingp (floor (* dfrac 10.)) > 100) > < (org-get-priority txt)) > --- >> 'priority (+ partialpriority (org-get-priority txt)) > > > > _______________________________________________ > Emacs-orgmode mailing list > Remember: use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode