Derek Chen-Becker <de...@chen-becker.org> writes: > 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? 1. (integerp ?a) ; => t and (characterp 30) ;=> t, so you can never tell 2. The code has (and (= (upcase org-priority-highest) org-priority-highest) (= (upcase org-priority-lowest) org-priority-lowest)) and, more importantly ((or (< (upcase new) org-priority-highest) (> (upcase new) org-priority-lowest)) (user-error (if nump "Priority must be between `%s' and `%s'" "Priority must be between `%c' and `%c'") org-priority-highest org-priority-lowest)) - those only work reliably for priority being not too large number (up to 64). (upcase 1) ; => 1, but (upcase 98) ; => 66. So, handling of numbers is not reliable at best: ;; Numerical priorities are limited to 64, beyond that number, ;; assume the priority cookie is a character. -- 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>