From mboxrd@z Thu Jan 1 00:00:00 1970 From: peregrinehill Subject: Re: Altering effect of deadline on priority calculation Date: Sun, 27 Apr 2014 09:36:01 -0400 Message-ID: References: <87mwfjwzml.fsf@bzg.ath.cx> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=089e013a18c2c8485104f80648da Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55320) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WePFn-0000I4-CA for emacs-orgmode@gnu.org; Sun, 27 Apr 2014 09:36:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WePFm-0003CJ-7a for emacs-orgmode@gnu.org; Sun, 27 Apr 2014 09:36:23 -0400 In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Bastien Cc: emacs-orgmode@gnu.org --089e013a18c2c8485104f80648da Content-Type: text/plain; charset=UTF-8 Sorry, I misspoke. What I meant to say was that I altered org-get-priority to keep priority cookies more significant than due dates. On Sun, Apr 27, 2014 at 9:24 AM, peregrinehill wrote: > > Actually, I have no complaints about the built-in sorting functions > themselves. It's the priority calculation. I guess priority-down would > show that problem most clearly. I have a lot of tasks, so I've altered the > priority calculation to produce a larger number for each item, like this: > > (defun org-get-priority (s) > "Find priority cookie and return priority." > (save-match-data > (if (functionp org-get-priority-function) > (funcall org-get-priority-function) > (if (not (string-match org-priority-regexp s)) > (* org-custom-sorting-intensity (- org-lowest-priority > org-default-priority)) > (* org-custom-sorting-intensity (- org-lowest-priority > (string-to-char (match-string 2 s)))))))) > > custom-sorting-intensity is usually around 4500, so I get large numbers > and therefore lots of gradations. But this is just takes care of the > priority-cookie part of the calculation. > > My issue is that incrementing the calculated priority by 1 for each day > past due is not dramatic enough when using these large numbers. I'd like it > to be 100 instead. Or even, just to get crazy, 100 for each day past > deadline and 50 for each day past scheduled due date! > > I know that I should be doing this as a user-defined-function for > org-agenda-sorting-strategy, but I don't understand how. The documentation > is clear, I'm just not very good with lisp. So I've copied the function > from org.el into my .org file and tweaked it a little. That's why I'm > looking for the part of org.el or whichever file that increases calculated > priority according to number of days past deadline. > > > Thanks, > Inanna > > > On Thu, Apr 17, 2014 at 2:59 PM, Bastien wrote: > >> Hi Inanna, >> >> peregrinehill writes: >> >> > I would like to make deadlines have a larger impact on priority >> > calculation than scheduled date, but I can't figure out how to >> > extract how many days before or past deadline from an agenda entry. >> > I would also like to extract how many days overdue a task is from >> > its scheduled date. >> > >> > Is there a function that gives me this information easily? >> > >> > Alternatively, can anybody point me to where priority is increased by >> > 1 for each day late? >> >> I'm not sure where do you want to get this information from: >> from an agenda view? from a normal buffer? >> >> What value of `org-agenda-sorting-strategy' comes closest to >> what you are trying to achieve? >> >> Let us know, >> >> -- >> Bastien >> > > --089e013a18c2c8485104f80648da Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Sorry, I misspoke.=C2=A0 What I meant to say was that I al= tered org-get-priority to keep priority cookies more significant than due d= ates.


On Sun, Apr 27, 2014 at 9:24 AM, peregrinehill <peregrinehill@gmai= l.com> wrote:
Actually, I have no complaints about the built-in sorting functions thems= elves.=C2=A0 It's the priority calculation.=C2=A0 I guess priority-down= would show that problem most clearly.=C2=A0 I have a lot of tasks, so I= 9;ve altered the priority calculation to produce a larger number for each i= tem, like this:

(defun org-get-priority (s)
=C2=A0 "Find priority cookie and re= turn priority."
=C2=A0 (save-match-data
=C2=A0=C2=A0=C2=A0 (if (= functionp org-get-priority-function)
=C2=A0=C2=A0=C2=A0 (funcall org-get= -priority-function)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (if (not (string-matc= h org-priority-regexp s))
=C2=A0=C2=A0=C2=A0 =C2=A0 (* org-custom-sorting-intensity (- org-lowest-pri= ority org-default-priority))
=C2=A0=C2=A0=C2=A0 (* org-custom-sorting-in= tensity (- org-lowest-priority
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2= =A0=C2=A0 (string-to-char (match-string 2 s))))))))

custom-sor= ting-intensity is usually around 4500, so I get large numbers and therefore= lots of gradations.=C2=A0 But this is just takes care of the priority-cook= ie part of the calculation.=C2=A0

My issue is that incrementing the calculated priority by 1 for each day= past due is not dramatic enough when using these large numbers. I'd li= ke it to be 100 instead.=C2=A0 Or even, just to get crazy, 100 for each day= past deadline and 50 for each day past scheduled due date!

I know that I should be doing this as a user-defined-function for= org-agenda-sorting-strategy, but I don't understand how.=C2=A0 The doc= umentation is clear, I'm just not very good with lisp.=C2=A0 So I'v= e copied the function from org.el into my .org file and tweaked it a little= .=C2=A0 That's why I'm looking for the part of org.el or whichever = file that increases calculated priority according to number of days past de= adline.


Thanks,
Inanna
=


On Thu, Apr 17, 2014 at 2:59 PM, Bastien <bzg@gnu.org> wrote:=
Hi Inanna,

peregrinehill <peregrinehill@gmail.com> writes:

> I would like to make deadlines have a larger impact on priority
> calculation than scheduled date, but I can't figure out how to
> extract how many days before or past deadline from an agenda entry. > =C2=A0I would also like to extract how many days overdue a task is fro= m
> its scheduled date.
>
> Is there a function that gives me this information easily?
>
> Alternatively, can anybody point me to where priority is increased by<= br> > 1 for each day late?

I'm not sure where do you want to get this information from= :
from an agenda view? from a normal buffer?

What value of `org-agenda-sorting-strategy' comes closest to
what you are trying to achieve?

Let us know,

--
=C2=A0Bastien


--089e013a18c2c8485104f80648da--