Re: [BUG] Agenda not sorting by priority THEN todo state (todo state ignored) [9.6.1 (9.6.1-??-fe92a3c @ /Users/polofsson/.emacs.d/.local/straight/build-28.2/org/)]

2023-04-06 Thread Samuel Wales
thank you.

On 4/6/23, Ihor Radchenko  wrote:
> Ihor Radchenko  writes:
>
>> See the attached fix making use of Samuel's suggestion.
>
> Applied, onto main.
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=8fab6eeef
> Fixed.
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 
>


-- 
The Kafka Pandemic

A blog about science, health, human rights, and misopathy:
https://thekafkapandemic.blogspot.com



Re: [BUG] Agenda not sorting by priority THEN todo state (todo state ignored) [9.6.1 (9.6.1-??-fe92a3c @ /Users/polofsson/.emacs.d/.local/straight/build-28.2/org/)]

2023-04-06 Thread Ihor Radchenko
Ihor Radchenko  writes:

> See the attached fix making use of Samuel's suggestion.

Applied, onto main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=8fab6eeef
Fixed.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [BUG] Agenda not sorting by priority THEN todo state (todo state ignored) [9.6.1 (9.6.1-??-fe92a3c @ /Users/polofsson/.emacs.d/.local/straight/build-28.2/org/)]

2023-04-03 Thread Ihor Radchenko
Samuel Wales  writes:

> i was not intending to talk about that xkcd.  there has been confusion
> about 2 definitions of priority, and your urgent will likely help.  if
> the docs referred to priority cookies, your argument is good.  i did
> not think every reference did incl code.

Well. I am pretty sure that the docstring in org-agenda was talking
about agenda-specific priorities. However, it was against Org's
terminology even 15 years ago - the earliest time I can track the
discussed docstring and manual entry in Git history. Now and earlier,
Org manual introduced priorities as [#A]-[#C] basically everywhere with
a single exception: when talking about agenda default sorting

"Within each category, items are sorted by priority
(@pxref{Priorities}), which is composed of the base priority (2000 for
priority @samp{A}, 1000 for @samp{B}, and 0 for @samp{C}), plus
additional increments for overdue scheduled or deadline items."

Notably, no reference has been ever made to this statement in the manual
from `org-agenda-sorting-strategy' docstring.

So, the terminology here has been confusing since forever and the only
clue about agenda special treatment of "priority" term has been in the
manual, not even linked to `org-agenda-sorting-strategy',- only to the
"default order" of agenda sorting.

My patch does not affect the default agenda sorting, so the previous
manual's claim is not contradicted. My commit also solves the
terminology confusion. Thus, I observe no regression and see not why we
should not be free to adjust how agenda treats 'priority-up/down in
`org-agenda-sorting-strategy'.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [BUG] Agenda not sorting by priority THEN todo state (todo state ignored) [9.6.1 (9.6.1-??-fe92a3c @ /Users/polofsson/.emacs.d/.local/straight/build-28.2/org/)]

2023-04-02 Thread Samuel Wales
i was not intending to talk about that xkcd.  there has been confusion
about 2 definitions of priority, and your urgent will likely help.  if
the docs referred to priority cookies, your argument is good.  i did
not think every reference did incl code.


On 4/2/23, Ihor Radchenko  wrote:
> Samuel Wales  writes:
>
>> it is all ok with me, but not everybody has personal test cases for
>> sorting sequence, and soembvody might get bitten by a subtle change
>> like this which pop up every once in a while.
>
> What you are describing is https://xkcd.com/1172/
> We have no obligation to preserve backwards compatibility for people
> relying on bugs.
>
> Since the documentation previously told users that
> priority-up/priority-down sort by priority, we have no obligation to
> care about the fact that Org did not behave as described.
>
> We just need to preserve the default agenda behaviour described in the
> manual, which my patch does.
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 
>


-- 
The Kafka Pandemic

A blog about science, health, human rights, and misopathy:
https://thekafkapandemic.blogspot.com



Re: [BUG] Agenda not sorting by priority THEN todo state (todo state ignored) [9.6.1 (9.6.1-??-fe92a3c @ /Users/polofsson/.emacs.d/.local/straight/build-28.2/org/)]

2023-04-02 Thread Ihor Radchenko
Samuel Wales  writes:

> it is all ok with me, but not everybody has personal test cases for
> sorting sequence, and soembvody might get bitten by a subtle change
> like this which pop up every once in a while.

What you are describing is https://xkcd.com/1172/
We have no obligation to preserve backwards compatibility for people
relying on bugs.

Since the documentation previously told users that
priority-up/priority-down sort by priority, we have no obligation to
care about the fact that Org did not behave as described.

We just need to preserve the default agenda behaviour described in the
manual, which my patch does.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [BUG] Agenda not sorting by priority THEN todo state (todo state ignored) [9.6.1 (9.6.1-??-fe92a3c @ /Users/polofsson/.emacs.d/.local/straight/build-28.2/org/)]

2023-03-25 Thread Samuel Wales
it is all ok with me, but not everybody has personal test cases for
sorting sequence, and soembvody might get bitten by a subtle change
like this which pop up every once in a while.  thus the conflated
thing -> 2 names.  the old one could be deprecated or so, i was
thinking.  i get your points though and didn't realize about the
docstroing.  i have no strong opinion on this; just wanted the idea of
disambiguating out there.  as long as 2 things are not conflated
that's good.


On 3/24/23, Ihor Radchenko  wrote:
> Samuel Wales  writes:
>
>> i find that when 2 things are being conflated, whether in software or
>> in anything else, it is useful to change the name of both of them for
>> maximum clarity, future git searches, etc.
>>
>> thus, perhaps i would suggest somthign like this slight tweak instead.
>>
>>   priority-cookie-up
>>   priority-cookie-and-planning-urgency-up
>
> I do not like the idea of changing both the names. The current change
> will ensure that existing uses of "priority-up"/"priority-down" sorting
> strategies won't be affected too much. Forcing every Org user who
> customized agenda sorting to change the variable values is not
> acceptable.
>
> Note that the patch, despite changing the actual meaning of
> priority-up/down, makes it more conforming with
> `org-agenda-sorting-strategy' docstring. So, this change is, in fact,
> safe.
>
>> if not too verbose.  reasoning: urgency is occasionally considered
>> orthogonal to priority in some philosophies, and some users have
>> :urgent: tags.  so this might eliminate slightly more confusion in
>> principle.
>
> I am neutral wrt "urgency" term. We can use some other.
>
> I do not like the verbosity. Even something like
> "priority-and-urgency-up/down" sounds awkward, IMHO.
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 
>


-- 
The Kafka Pandemic

A blog about science, health, human rights, and misopathy:
https://thekafkapandemic.blogspot.com



Re: [BUG] Agenda not sorting by priority THEN todo state (todo state ignored) [9.6.1 (9.6.1-??-fe92a3c @ /Users/polofsson/.emacs.d/.local/straight/build-28.2/org/)]

2023-03-24 Thread Ihor Radchenko
Samuel Wales  writes:

> i find that when 2 things are being conflated, whether in software or
> in anything else, it is useful to change the name of both of them for
> maximum clarity, future git searches, etc.
>
> thus, perhaps i would suggest somthign like this slight tweak instead.
>
>   priority-cookie-up
>   priority-cookie-and-planning-urgency-up

I do not like the idea of changing both the names. The current change
will ensure that existing uses of "priority-up"/"priority-down" sorting
strategies won't be affected too much. Forcing every Org user who
customized agenda sorting to change the variable values is not
acceptable.

Note that the patch, despite changing the actual meaning of
priority-up/down, makes it more conforming with
`org-agenda-sorting-strategy' docstring. So, this change is, in fact,
safe.

> if not too verbose.  reasoning: urgency is occasionally considered
> orthogonal to priority in some philosophies, and some users have
> :urgent: tags.  so this might eliminate slightly more confusion in
> principle.

I am neutral wrt "urgency" term. We can use some other.

I do not like the verbosity. Even something like
"priority-and-urgency-up/down" sounds awkward, IMHO.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [BUG] Agenda not sorting by priority THEN todo state (todo state ignored) [9.6.1 (9.6.1-??-fe92a3c @ /Users/polofsson/.emacs.d/.local/straight/build-28.2/org/)]

2023-03-24 Thread Samuel Wales
thank you for that.  surely now fewer users will be confused.

i find that when 2 things are being conflated, whether in software or
in anything else, it is useful to change the name of both of them for
maximum clarity, future git searches, etc.

thus, perhaps i would suggest somthign like this slight tweak instead.

  priority-cookie-up
  priority-cookie-and-planning-urgency-up

if not too verbose.  reasoning: urgency is occasionally considered
orthogonal to priority in some philosophies, and some users have
:urgent: tags.  so this might eliminate slightly more confusion in
principle.


On 3/23/23, Ihor Radchenko  wrote:
> Samuel Wales  writes:
>
>> perhaps we could have 2 names: one for the priority cookie setting and
>> one for whatever the agenda does.
>
> This is a good idea. Thanks!
>
> See the attached fix making use of Samuel's suggestion.
>
>


-- 
The Kafka Pandemic

A blog about science, health, human rights, and misopathy:
https://thekafkapandemic.blogspot.com



Re: [BUG] Agenda not sorting by priority THEN todo state (todo state ignored) [9.6.1 (9.6.1-??-fe92a3c @ /Users/polofsson/.emacs.d/.local/straight/build-28.2/org/)]

2023-03-24 Thread Samuel Wales
[feel free to ignore those suggestions as surely there are better
alterntives, and urgency is still good.]

On 3/23/23, Samuel Wales  wrote:
> thank you for that.  surely now fewer users will be confused.
>
> i find that when 2 things are being conflated, whether in software or
> in anything else, it is useful to change the name of both of them for
> maximum clarity, future git searches, etc.
>
> thus, perhaps i would suggest somthign like this slight tweak instead.
>
>   priority-cookie-up
>   priority-cookie-and-planning-urgency-up
>
> if not too verbose.  reasoning: urgency is occasionally considered
> orthogonal to priority in some philosophies, and some users have
> :urgent: tags.  so this might eliminate slightly more confusion in
> principle.
>
>
> On 3/23/23, Ihor Radchenko  wrote:
>> Samuel Wales  writes:
>>
>>> perhaps we could have 2 names: one for the priority cookie setting and
>>> one for whatever the agenda does.
>>
>> This is a good idea. Thanks!
>>
>> See the attached fix making use of Samuel's suggestion.
>>
>>
>
>
> --
> The Kafka Pandemic
>
> A blog about science, health, human rights, and misopathy:
> https://thekafkapandemic.blogspot.com
>


-- 
The Kafka Pandemic

A blog about science, health, human rights, and misopathy:
https://thekafkapandemic.blogspot.com



Re: [BUG] Agenda not sorting by priority THEN todo state (todo state ignored) [9.6.1 (9.6.1-??-fe92a3c @ /Users/polofsson/.emacs.d/.local/straight/build-28.2/org/)]

2023-03-23 Thread Ihor Radchenko
Samuel Wales  writes:

> perhaps we could have 2 names: one for the priority cookie setting and
> one for whatever the agenda does.

This is a good idea. Thanks!

See the attached fix making use of Samuel's suggestion.

>From d6881c39c91beabdc0bfb29d6dc8a81202a84e40 Mon Sep 17 00:00:00 2001
Message-Id: 
From: Ihor Radchenko 
Date: Thu, 23 Mar 2023 12:20:19 +0100
Subject: [PATCH] org-agenda: Rename sorting "priority" to "urgency"

* lisp/org-habit.el (org-habit-get-priority): Rename to
`org-habit-get-urgency'.
* lisp/org-compat.el (org-habit-get-priority): Obsolete the old name.
* lisp/org-agenda.el (org-agenda-sorting-strategy):
* lisp/org-agenda.el (org-search-view):
(org-agenda-get-todos):
(org-agenda-get-timestamps):
(org-agenda-get-progress):
(org-agenda-get-deadlines):
(org-agenda-get-scheduled):
(org-agenda-get-blocks):
(org-entries-lessp): Alter priority-up and priority-down sorting
strategies to only sort by actual priority.  Rename the previous
composite sorting rank to urgency, corresponding to the new urgency-up
and urgency-down sorting strategies.  Store the new rank in 'urgency
text property.  Update the docstrings accordingly.  Use `urgency-down'
in place of `priority-down' in the default sorting strategy.
(org-set-sorting-strategy): Use `urgency-down' in place of
`priority-down'.
* etc/ORG-NEWS ("Priority" used to sort items in agenda is renamed to
"urgency"): Document the change.
* doc/org-manual.org (Sorting of agenda items): Update manual using
"urgency" term in place of confusing "priority".

Thanks to Samuel Wales for the idea how to fix the inconsistency.

Reported-by: Jonas Olofsson 
Link: https://orgmode.org/list/26396316-1201-4d88-9d81-c87ddda88...@apple.com
---
 doc/org-manual.org | 16 +--
 etc/ORG-NEWS   | 15 ++
 lisp/org-agenda.el | 72 +-
 lisp/org-compat.el |  2 ++
 lisp/org-habit.el  |  4 +--
 5 files changed, 73 insertions(+), 36 deletions(-)

diff --git a/doc/org-manual.org b/doc/org-manual.org
index 37fd3df14..ff06694a8 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -9419,16 +9419,16 @@ *** Sorting of agenda items
   time-of-day specification.  These entries are shown at the beginning
   of the list, as a /schedule/ for the day.  After that, items remain
   grouped in categories, in the sequence given by ~org-agenda-files~.
-  Within each category, items are sorted by priority (see
-  [[*Priorities]]), which is composed of the base priority (2000 for
-  priority =A=, 1000 for =B=, and 0 for =C=), plus additional
-  increments for overdue scheduled or deadline items.
+  Within each category, items are sorted by urgency, which is composed
+  of the base priority (see [[*Priorities]]; 2000 for priority =A=, 1000
+  for =B=, and 0 for =C=), plus additional increments for overdue
+  scheduled or deadline items.
 
 - For the TODO list, items remain in the order of categories, but
-  within each category, sorting takes place according to priority (see
-  [[*Priorities]]).  The priority used for sorting derives from the
-  priority cookie, with additions depending on how close an item is to
-  its due or scheduled date.
+  within each category, sorting takes place according to urgency.  The
+  urgency used for sorting derives from the priority cookie, with
+  additions depending on how close an item is to its due or scheduled
+  date.
 
 - For tags matches, items are not sorted at all, but just appear in
   the sequence in which they are found in the agenda files.
diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 4ca13af17..2b055a76a 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -13,6 +13,21 @@ Please send Org bug reports to mailto:emacs-orgmode@gnu.org.
 
 * Version 9.7 (not released yet)
 ** Important announcements and breaking changes
+*** "Priority" used to sort items in agenda is renamed to "urgency"
+
+Previously, ~priority-up~ and ~priority-down~ in
+~org-agenda-sorting-strategy~ used a composite rank depending on
+item's priority (=[#A]=, =[#B]=, =[#C]=, etc) and overdue time to
+order agenda items (see "11.4.3 Sorting of agenda items" section of
+Org manual).
+
+Now, this composite rank is renamed to =urgency= and the relevant
+sorting strategies are renamed to ~urgency-up~ and ~urgency-down~.
+~priority-up~ and ~priority-down~ sort by item's priority only.
+
+Users relying on the previous composite ranking should adjust their
+agenda sorting settings.
+
 *** =python-mode.el (MELPA)= support in =ob-python.el= is removed
 
 =python-mode.el= support has been removed from =ob-python.el=.  The
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 892d88a77..263f242d4 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -85,7 +85,7 @@ (declare-function org-habit-insert-consistency-graphs
 		  "org-habit" ( line))
 (declare-function org-is-habit-p "org-habit" ( pom))
 (declare-function org-habit-parse-todo "org-habit" ( pom))
-(declare-function org-habit-get-priority "org-habit" (habit  

Re: [BUG] Agenda not sorting by priority THEN todo state (todo state ignored) [9.6.1 (9.6.1-??-fe92a3c @ /Users/polofsson/.emacs.d/.local/straight/build-28.2/org/)]

2023-03-22 Thread Samuel Wales
perhaps we could have 2 names: one for the priority cookie setting and
one for whatever the agenda does.


On 3/22/23, Ihor Radchenko  wrote:
> Jonas Olofsson  writes:
>
>> I am trying to sort my agenda by a number of variables, but it seems
>> that todo-state-down is not applied if added after priority-down.
>> Instead it seems as if Priority first is applied, then the date the
>> item is scheduled.
>>
>> Repro:
>> 1. Set
>>org-agenda-sorting-strategy
>>'((agenda priority-down todo-state-down)
>>  (todo priority-down todo-state-down effort-up category-keep
>> scheduled-up)
>>  (tags priority-down todo-state-down effort-up category-keep)
>>  (search category-keep))
>> 2. Set
>>org-todo-keywords '(
>>(sequence "TODO(t!)" "NEXT(n!)" "WAIT(w!)" "|"
>> "DONE(d!)" "CANC(c!)" "DUPE(D!)")
>>)
>> 3. Have three todos scheduled:
>>
>> * TODO [#C] Test
>> SCHEDULED: <2023-03-16 Thu>
>> * NEXT [#C] Test
>> SCHEDULED: <2023-03-15 Wed>
>> * WAIT [#C] Test
>> SCHEDULED: <2023-03-17 Fri>
>>
>> 4. Go to agenda.
>>
>> I expect to see items in the following order, since they are the same
>> priority.
>> WAIT C Test
>> NEXT C Test
>> TODO C Test
>>
>> But I see:
>> NEXT C Test
>> TODO C Test
>> WAIT C Test
>
> Confirmed.
>
> Yet another agenda madness I have no clue about.
>
> `org-agenda-get-scheduled' sets the priority as
>
> 'priority (if habitp (org-habit-get-priority habitp)
> (+ 99 diff (org-get-priority item)))
>
> where diff is the number of overdue days for a given entry.
>
> Further,
>
> `org-agenda-get-deadlines' has
>
> 'priority
> ;; Adjust priority to today reminders about deadlines.
> ;; Overdue deadlines get the highest priority
> ;; increase, then imminent deadlines and eventually
> ;; more distant deadlines.
> (let ((adjust (if today? (- diff) 0)))
>   (+ adjust (org-get-priority item)))
>
> `org-agenda-get-todos' has
>
> priority (1+ (org-get-priority txt)))
>
> All these dates back to the initial Org release.
>
> From what I am seeing, these awkward priority adjustments are hard-coded
> for fine-tune agenda sorting in some (unknown) scenarios.
>
> Changing them will likely break existing sorting.
>
> To fix this, we should carefully check what will happen if we set the
> agenda priority to be the actual user-defined priority. And then fix the
> sorting back somehow.
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 
>
>


-- 
The Kafka Pandemic

A blog about science, health, human rights, and misopathy:
https://thekafkapandemic.blogspot.com



Re: [BUG] Agenda not sorting by priority THEN todo state (todo state ignored) [9.6.1 (9.6.1-??-fe92a3c @ /Users/polofsson/.emacs.d/.local/straight/build-28.2/org/)]

2023-03-22 Thread Ihor Radchenko
Jonas Olofsson  writes:

> I am trying to sort my agenda by a number of variables, but it seems
> that todo-state-down is not applied if added after priority-down.
> Instead it seems as if Priority first is applied, then the date the
> item is scheduled.
>
> Repro:
> 1. Set 
>org-agenda-sorting-strategy
>'((agenda priority-down todo-state-down)
>  (todo priority-down todo-state-down effort-up category-keep scheduled-up)
>  (tags priority-down todo-state-down effort-up category-keep)
>  (search category-keep))
> 2. Set 
>org-todo-keywords '(
>(sequence "TODO(t!)" "NEXT(n!)" "WAIT(w!)" "|" 
> "DONE(d!)" "CANC(c!)" "DUPE(D!)")
>)
> 3. Have three todos scheduled:
>
> * TODO [#C] Test
> SCHEDULED: <2023-03-16 Thu>
> * NEXT [#C] Test
> SCHEDULED: <2023-03-15 Wed>
> * WAIT [#C] Test 
> SCHEDULED: <2023-03-17 Fri>
>
> 4. Go to agenda.
>
> I expect to see items in the following order, since they are the same 
> priority.
> WAIT C Test
> NEXT C Test
> TODO C Test
>
> But I see:
> NEXT C Test
> TODO C Test
> WAIT C Test

Confirmed.

Yet another agenda madness I have no clue about.

`org-agenda-get-scheduled' sets the priority as

'priority (if habitp (org-habit-get-priority habitp)
  (+ 99 diff (org-get-priority item)))

where diff is the number of overdue days for a given entry.

Further,

`org-agenda-get-deadlines' has

  'priority
  ;; Adjust priority to today reminders about deadlines.
  ;; Overdue deadlines get the highest priority
  ;; increase, then imminent deadlines and eventually
  ;; more distant deadlines.
  (let ((adjust (if today? (- diff) 0)))
(+ adjust (org-get-priority item)))

`org-agenda-get-todos' has

  priority (1+ (org-get-priority txt)))

All these dates back to the initial Org release.

>From what I am seeing, these awkward priority adjustments are hard-coded
for fine-tune agenda sorting in some (unknown) scenarios.

Changing them will likely break existing sorting.

To fix this, we should carefully check what will happen if we set the
agenda priority to be the actual user-defined priority. And then fix the
sorting back somehow.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



[BUG] Agenda not sorting by priority THEN todo state (todo state ignored) [9.6.1 (9.6.1-??-fe92a3c @ /Users/polofsson/.emacs.d/.local/straight/build-28.2/org/)]

2023-03-20 Thread Jonas Olofsson



Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.  You don't know how to make a good report?  See

 https://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org mailing list.


I am trying to sort my agenda by a number of variables, but it seems
that todo-state-down is not applied if added after priority-down.
Instead it seems as if Priority first is applied, then the date the
item is scheduled.

Repro:
1. Set 
   org-agenda-sorting-strategy
   '((agenda priority-down todo-state-down)
 (todo priority-down todo-state-down effort-up category-keep scheduled-up)
 (tags priority-down todo-state-down effort-up category-keep)
 (search category-keep))
2. Set 
   org-todo-keywords '(
   (sequence "TODO(t!)" "NEXT(n!)" "WAIT(w!)" "|" 
"DONE(d!)" "CANC(c!)" "DUPE(D!)")
   )
3. Have three todos scheduled:

* TODO [#C] Test
SCHEDULED: <2023-03-16 Thu>
* NEXT [#C] Test
SCHEDULED: <2023-03-15 Wed>
* WAIT [#C] Test 
SCHEDULED: <2023-03-17 Fri>

4. Go to agenda.

I expect to see items in the following order, since they are the same priority.
WAIT C Test
NEXT C Test
TODO C Test

But I see:
NEXT C Test
TODO C Test
WAIT C Test

It seems the sorting is based on the scheduled time - NOT the todo state
(since they are the same priority). 

I've checked various things and priority, habit, all other
org-agenda-sorting-strategy variables sort ok if indepdendently applied.
I am only able to reproduce this issuey when I have todo-state-down
AFTER priority-down in org-agenda-sorting-strategies.

Any help appreciated.

Regards,
Jonas


Emacs  : GNU Emacs 28.2 (build 1, aarch64-apple-darwin21.6.0, Carbon Version 
165 AppKit 2113.6)
of 2022-09-15
Package: Org mode version 9.6.1 (9.6.1-??-fe92a3c @ 
/Users/polofsson/.emacs.d/.local/straight/build-28.2/org/)