Tommy also brought up a good point about the ambiguity about ranges
that cross between numeric and alphabetic:

On 2024-10-12, Tommy Jollyboat wrote:
> From the docs, it seems that sort-order of mixed numbers and letters
> is intentionally undefined, and users are expected to stick to
> either alphabetic or numerical priorities. So technically all that
> matters is that prios 0-64 sort correctly, and that A-Z sort
> correctly. Since the numerical values of A-Z continue from 65
> upwards, I think sorting 0-64 then A-Z makes sense, because it's the
> easiest behaviour and gets all defined cases right.

[PR #313] <https://github.com/alphapapa/org-ql/pull/313>

The manual mostly constraints the individual values:

>> You can also use numeric values for priorities
>> --8<--
>> When using numeric priorities, you need to set
>> ~org-priority-highest~, ~org-priority-lowest~ and
>> ~org-priority-default~ to integers, which must all be a
>> non-negative integer between 0 and 64, inclusive.
>> --8<--
>> Valid priority values are single uppercase Latin alphabetical
>> characters A-Z, and non-negative integers in between 0 and 64,
>> inclusive.

but the doc strings of 'org-priority-highest' and
'org-priority-lowest' are more insistent that Org either thinks about
them of numeric or alphabetic:

>> If you set […] to a numeric value inferior to 65, Org assumes you
>> want to use digits for the priority cookie.  If you set it to >=65,
>> Org assumes you want to use alphabetical characters.

In practice, they can coexist and the values are sorted numerically
0–64 then by character value ?A–?Z, e.g. sorting ‘Tasks’:

#+PRIORITIES: 0 Z 45
* Tasks
** [#45] Middle
** [#Z] Lowest
** [#0] Highest

Is this something we want to pin down?

-- 
Jacob S. Gordon
[email protected]
Please don’t send me HTML emails or MS Office/Apple iWork documents.
https://useplaintext.email/#etiquette
https://www.fsf.org/campaigns/opendocument

Reply via email to