Just double-checking my understanding of things, but it looks like `org-priority' already handles number inputs, despite the docstring:
((or (eq action 'set) (integerp action)) (if (not (eq action 'set)) (setq new action) My read of that is that if the argument to `org-priority` is an actual integer (not an integer string), then it uses that integer as the new value. Am I missing something? Thanks, Derek On Sat, Jul 12, 2025 at 10:11 AM Ihor Radchenko <yanta...@posteo.net> wrote: > Derek Chen-Becker <de...@chen-becker.org> writes: > > > Summer schedules got the better of me, but here's the first of hopefully > > several patches to address this is small pieces rather than trying to > > commit to one large chunk of work. Tests pass locally and I added some > new > > ones as well. > > Thanks! > > > - (org-priority (if (org-string-nw-p value) (string-to-char value) > ?\s)) > > + (org-priority (if (org-string-nw-p value) (org-priority-to-value > value) ?\s)) > > I am not sure if it is the cleanest approach. > Maybe we should instead modify `org-priority' itself to handle string > and non-string properties? For now, your patch is basically violating > the docstring of `org-priority' by feeding a number instead of > character. > > > + (should ;; Set a numeric priority with double digits > > + (equal "* [#20] H" > > + (org-test-with-temp-text "* H" > > + (let ((org-priority-lowest 20) > > 20 - lowest? > More importantly, try the same test but with priority = 97 > > -- > Ihor Radchenko // yantar92, > Org mode maintainer, > Learn more about Org mode at <https://orgmode.org/>. > Support Org development at <https://liberapay.com/org-mode>, > or support my work at <https://liberapay.com/yantar92> > -- +---------------------------------------------------------------+ | Derek Chen-Becker | | GPG Key available at https://keybase.io/dchenbecker and | | https://pgp.mit.edu/pks/lookup?search=derek%40chen-becker.org | | Fngrprnt: EB8A 6480 F0A3 C8EB C1E7 7F42 AFC5 AFEE 96E4 6ACC | +---------------------------------------------------------------+