emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Altering effect of deadline on priority calculation
@ 2014-04-07 22:43 peregrinehill
  2014-04-17 18:59 ` Bastien
  0 siblings, 1 reply; 4+ messages in thread
From: peregrinehill @ 2014-04-07 22:43 UTC (permalink / raw)
  To: emacs-orgmode

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

Hi,

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?

Thanks - I've looked and looked.

Inanna

[-- Attachment #2: Type: text/html, Size: 693 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Altering effect of deadline on priority calculation
  2014-04-07 22:43 Altering effect of deadline on priority calculation peregrinehill
@ 2014-04-17 18:59 ` Bastien
  2014-04-27 13:24   ` peregrinehill
  0 siblings, 1 reply; 4+ messages in thread
From: Bastien @ 2014-04-17 18:59 UTC (permalink / raw)
  To: peregrinehill; +Cc: emacs-orgmode

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.
>  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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Altering effect of deadline on priority calculation
  2014-04-17 18:59 ` Bastien
@ 2014-04-27 13:24   ` peregrinehill
  2014-04-27 13:36     ` peregrinehill
  0 siblings, 1 reply; 4+ messages in thread
From: peregrinehill @ 2014-04-27 13:24 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode

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

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 <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.
> >  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
>

[-- Attachment #2: Type: text/html, Size: 3239 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Altering effect of deadline on priority calculation
  2014-04-27 13:24   ` peregrinehill
@ 2014-04-27 13:36     ` peregrinehill
  0 siblings, 0 replies; 4+ messages in thread
From: peregrinehill @ 2014-04-27 13:36 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode

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

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 <peregrinehill@gmail.com>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 <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.
>> >  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
>>
>
>

[-- Attachment #2: Type: text/html, Size: 3816 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-04-27 13:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-07 22:43 Altering effect of deadline on priority calculation peregrinehill
2014-04-17 18:59 ` Bastien
2014-04-27 13:24   ` peregrinehill
2014-04-27 13:36     ` peregrinehill

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).