Hey Jack,

Thanks for the feedback!

On 2026-05-17 22:22, Jack Kamm wrote:
> I think in both cases, the mapping from Org priorities to iCal
> priorities is a step function on [org-priority-highest,
> org-priority-lowest], where the step height is 1 and the step width
> is (org-priority-lowest - org-priority-highest)/8.
> 
> In the current case of using floor, the first step has the full
> width, and the last step has width 0. In your preferred scheme
> (round) both the first and last steps would have half width.

Yes, modulo some edge details, ceiling, floor, and round are all the
same step functions with unit width, just shifted relative to each
other.  Not all the steps can have full width since we have to divide
an interval of length 8 across 9 numbers, so the first and last are
always ‘sharing’.

> If so, it would suggest a defcustom for the relative size of the
> first step, which would take a value between 0 and 1 -- with the
> current default being 1, but your preferred value being 0.5.

IIUC you’re suggesting we use something like ceil(x-s) where s∈[0,1]
is a user option, and using the fact that ceil(x-1/2) ~ round(x) and
ceil(x-1) ~ floor(x)?  I’m not sure why other values of the shift
would be desirable, e.g. if I set s = 1/3, in the limit L-H → ∞ then
1/3*1/8 of the priorities will map to 1 and 2/3*1/8 will map to 9 [1]:

histogram of ceil(x-1/3):

                    #   #   #   #   #   #   #
                    #   #   #   #   #   #   #   #
                #   #   #   #   #   #   #   #   #
             ---|---|---|---|---|---|---|---|---|---
                1   2   3   4   5   6   7   8   9

If there needs to be a user option I’d suggest something more
coarse-grained, like the following choices, plus maybe a user-provided
function:

  round: I want priorities {H,…,L} to map onto the iCalendar
  priorities {1,…,9} in a way that minimizes error.

  ceiling: I want only the highest priority H to map onto iCalendar
  priority 1, with all the rest {H+1,…,L} mapping into {2,…,9}.

  floor: I want only the lowest priority L to map onto iCalendar
  priority 9, with all the rest {H,…,L-1} mapping into {1,…,8}.

[1] It also has a larger error: e → 1/4 + (s-1/2)^2 as as L-H → ∞, or
1 + (2s-1)^2 times larger than rounding.

Best,

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