From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id iO1jIdCL4l8ZRAAA0tVLHw (envelope-from ) for ; Wed, 23 Dec 2020 00:14:08 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id GCExHdCL4l8RZwAA1q6Kng (envelope-from ) for ; Wed, 23 Dec 2020 00:14:08 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 822FA9403C5 for ; Wed, 23 Dec 2020 00:14:07 +0000 (UTC) Received: from localhost ([::1]:59390 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1krrn3-0003Uc-83 for larch@yhetil.org; Tue, 22 Dec 2020 19:14:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:48830) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1krrmX-0003UR-J0 for emacs-orgmode@gnu.org; Tue, 22 Dec 2020 19:13:33 -0500 Received: from mail-ed1-f46.google.com ([209.85.208.46]:44935) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1krrmU-00006y-EF for emacs-orgmode@gnu.org; Tue, 22 Dec 2020 19:13:33 -0500 Received: by mail-ed1-f46.google.com with SMTP id p22so14541408edu.11 for ; Tue, 22 Dec 2020 16:13:29 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=6/h++KFatj2THz6g5TK9dfEKCtxV1Tr3LimAHEHukb0=; b=O0fgUN9969UN/QiBxATfB1MoiiZPCXaTwO/1ygNFGFgNykmpmwAgYeKkbhjvBW7nnD Gf48MbBsX3iJAIJYEyPnztXTtb11roLvbYRkenICz1dnLEoANfT8boOvsNWvBaurgE8W zb+iyXTSQUOqDhaGVaNX3U/mH2Tb+v+6OndDFa8W/plfSDJ4B/+xJRsxcc3KyS6RpqrK pDcFvVYTTv36UFFqb47VRuIPt1VqLheb07ULJ1gnUw2j4vIIDnjhQhAggMPSsUfXj3OM anm0+uKQw0QvnzxsjA5J6tqEw6bpulF1hQMrpXdHFPyNLE5RQLpuErNsc2Ya1COYjIn1 vFUg== X-Gm-Message-State: AOAM5333hPInO8XTzHSOzYEklrJ/niKpNoQL6kQ/LeuoSX6f9flp5g8i WvVO/OU3KQZAK7y/VSIi/1rTQy6PNwZXaptbG3s= X-Google-Smtp-Source: ABdhPJx+0MBr6lTZVldjCJEsD6s1wMcBFAWm8vshjzg6pwPvoHu0yF0Iqoxd40A9TwPaGWRqhpz7SaFtSE/p60F4sY8= X-Received: by 2002:a50:c053:: with SMTP id u19mr22454876edd.109.1608682408444; Tue, 22 Dec 2020 16:13:28 -0800 (PST) MIME-Version: 1.0 References: <20201202142053.zexzdpmyv4ear3zc@gmail.com> <20201222150516.kqounuguau3odhr7@gmail.com> In-Reply-To: From: Adam Spiers Date: Wed, 23 Dec 2020 00:13:19 +0000 Message-ID: Subject: Re: overloading of internal priority calculations in agenda To: Samuel Wales Content-Type: multipart/alternative; boundary="00000000000083072405b7168f6d" Received-SPF: pass client-ip=209.85.208.46; envelope-from=adam.spiers@gmail.com; helo=mail-ed1-f46.google.com X-Spam_score_int: -13 X-Spam_score: -1.4 X-Spam_bar: - X-Spam_report: (-1.4 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: org-mode mailing list Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -2.22 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=adamspiers.org (policy=none); spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 822FA9403C5 X-Spam-Score: -2.22 X-Migadu-Scanner: scn0.migadu.com X-TUID: RoN3m2HJGrL1 --00000000000083072405b7168f6d Content-Type: text/plain; charset="UTF-8" Thanks a lot - appreciate the feedback! On Tue, 22 Dec 2020 at 23:38, Samuel Wales wrote: > if my opinion is worth anything [perhaps not much here :]], i like > your proposals and the idea of being able to re-sort an existing > agenda assuming that is your goal. > > i don't use any priority sorting except in user-customizable but it > makes sense to decouple them for those who do. and i frequently want > to differently sort an existing agenda view. > > > On 12/22/20, Adam Spiers wrote: > > Hi again, > > > > On Wed, Dec 02, 2020 at 02:20:53PM +0000, Adam Spiers wrote: > >>Hi all, > >> > >>I'm currently working on adding a feature to org-agenda which allows > >>manual ordering of entries in combination with the existing automatic > >>ordering (as dictated by `org-agenda-sorting-strategy'). > >> > >>During my investigations I noticed that while `org-get-priority' converts > >>[#B] style cookies into a numeric priority which is a multiple of > >>1000, further adjustments are made in functions like > >>`org-agenda-get-scheduled' before adding this numeric priority as a > >>text property on the entry: > >> > >> 'priority (if habitp (org-habit-get-priority habitp) > >> (+ 99 diff (org-get-priority item))) > >> > >>In this case `diff' refers to the number of days between now and when > >>the item was scheduled. A slightly different calculation is made in > >>`org-agenda-get-timestamps': > >> > >> (org-add-props item props > >> 'priority (if habit? > >> (org-habit-get-priority (org-habit-parse-todo)) > >> (org-get-priority item)) > >> > >>I further noticed that this overloading of the internal priority by > >>including timestamp and habit data causes disruption to the behaviour > >>I imagine most users would expect from `org-agenda-sorting-strategy'. > >>For example, if you have `priority-down' as the first entry in the > >>`agenda' section and `category-keep' as the second, then differences > >>in the SCHEDULED timestamp are included in the priority calculation > >>and can therefore prevent sorting of two adjacent [#B] items by > >>category. This seems like a bug to me, or at least breaks the > >>Principle of Least Surprise. > > > > [snipped] > > > >>Given that `org-agenda-sorting-strategy' now supports all manner of > >>sorting criteria, many of which are time-sensitive, I would like to > >>know if there is any reason not to remove this overloading of the > >>priority calculation, i.e. decoupling it to depend purely on the > >>result of `org-get-priority' and `org-habit-get-priority'? > >> > >>If fact, perhaps we could go one step further and add support for new > >>habit-priority-{up,down} sorters to `org-agenda-sorting-strategy', so > >>that the priority-{up,down} sorters sort purely by the priority cookie > >>and nothing else? > > > > Gently bumping this as I didn't get any replies yet. I would like to > > continue working on a solution, but obviously don't want to waste time > > on something which would be rejected. > > > > If it is considered important to preserve the exact behaviour > > currently offered by `org-agenda-sorting-strategy' then I would > > propose the following: > > > > - Keep the existing priority-{up,down} which combine priority cookies > > with timestamp data and the result from `org-habit-get-priority', > > but probably also deprecate it and remove it from the default value. > > > > - Introduce new priority-cookie-{up,down} sorters which operate purely > > on [#A] and [#1] style priority cookies and nothing else. > > > > This would facilitate decoupling of the sortable criteria whilst > > remaining backwards compatible. > > > > Does this sound reasonable? I am keen to proceed very soon (ideally > > over the Xmas break). I have already written some new ert tests for > > `org-agenda-sorting-strategy' which would be included in any submitted > > patches. > > > > Thanks! > > Adam > > > > > > > -- > The Kafka Pandemic > > Please learn what misopathy is. > > https://thekafkapandemic.blogspot.com/2013/10/why-some-diseases-are-wronged.html > --00000000000083072405b7168f6d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks a lot - appreciate the feedback!

On Tue, 22 Dec 2020= at 23:38, Samuel Wales <samolog= ist@gmail.com> wrote:
if my opinion is worth anything [perhaps not much here :]], i = like
your proposals and the idea of being able to re-sort an existing
agenda assuming that is your goal.

i don't use any priority sorting except in user-customizable but it
makes sense to decouple them for those who do.=C2=A0 and i frequently want<= br> to differently sort an existing agenda view.


On 12/22/20, Adam Spiers <orgmode@adamspiers.org> wrote:
> Hi again,
>
> On Wed, Dec 02, 2020 at 02:20:53PM +0000, Adam Spiers wrote:
>>Hi all,
>>
>>I'm currently working on adding a feature to org-agenda which a= llows
>>manual ordering of entries in combination with the existing automat= ic
>>ordering (as dictated by `org-agenda-sorting-strategy').
>>
>>During my investigations I noticed that while `org-get-priority'= ; converts
>>[#B] style cookies into a numeric priority which is a multiple of >>1000, further adjustments are made in functions like
>>`org-agenda-get-scheduled' before adding this numeric priority = as a
>>text property on the entry:
>>
>>=C2=A0 =C2=A0 'priority (if habitp (org-habit-get-priority habi= tp)
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (+ 99 diff = (org-get-priority item)))
>>
>>In this case `diff' refers to the number of days between now an= d when
>>the item was scheduled.=C2=A0 A slightly different calculation is m= ade in
>>`org-agenda-get-timestamps':
>>
>>=C2=A0 =C2=A0 (org-add-props item props
>>=C2=A0 =C2=A0 =C2=A0 'priority (if habit?
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 (org-habit-get-priority (org-habit-parse-todo))
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (org= -get-priority item))
>>
>>I further noticed that this overloading of the internal priority by=
>>including timestamp and habit data causes disruption to the behavio= ur
>>I imagine most users would expect from `org-agenda-sorting-strategy= '.
>>For example, if you have `priority-down' as the first entry in = the
>>`agenda' section and `category-keep' as the second, then di= fferences
>>in the SCHEDULED timestamp are included in the priority calculation=
>>and can therefore prevent sorting of two adjacent [#B] items by
>>category.=C2=A0 This seems like a bug to me, or at least breaks the=
>>Principle of Least Surprise.
>
> [snipped]
>
>>Given that `org-agenda-sorting-strategy' now supports all manne= r of
>>sorting criteria, many of which are time-sensitive, I would like to=
>>know if there is any reason not to remove this overloading of the >>priority calculation, i.e. decoupling it to depend purely on the >>result of `org-get-priority' and `org-habit-get-priority'?<= br> >>
>>If fact, perhaps we could go one step further and add support for n= ew
>>habit-priority-{up,down} sorters to `org-agenda-sorting-strategy= 9;, so
>>that the priority-{up,down} sorters sort purely by the priority coo= kie
>>and nothing else?
>
> Gently bumping this as I didn't get any replies yet.=C2=A0 I would= like to
> continue working on a solution, but obviously don't want to waste = time
> on something which would be rejected.
>
> If it is considered important to preserve the exact behaviour
> currently offered by `org-agenda-sorting-strategy' then I would > propose the following:
>
> - Keep the existing priority-{up,down} which combine priority cookies<= br> >=C2=A0 =C2=A0 with timestamp data and the result from `org-habit-get-pr= iority',
>=C2=A0 =C2=A0 but probably also deprecate it and remove it from the def= ault value.
>
> - Introduce new priority-cookie-{up,down} sorters which operate purely=
>=C2=A0 =C2=A0 on [#A] and [#1] style priority cookies and nothing else.=
>
> This would facilitate decoupling of the sortable criteria whilst
> remaining backwards compatible.
>
> Does this sound reasonable?=C2=A0 I am keen to proceed very soon (idea= lly
> over the Xmas break).=C2=A0 I have already written some new ert tests = for
> `org-agenda-sorting-strategy' which would be included in any submi= tted
> patches.
>
> Thanks!
> Adam
>
>


--
The Kafka Pandemic

Please learn what misopathy is.
https://thekafkapand= emic.blogspot.com/2013/10/why-some-diseases-are-wronged.html
--00000000000083072405b7168f6d--