I guess looking at https://orgmode.org/manual/Priorities.html, it's not clearly defined what valid ranges are. Are upper and lower cases considered equivalent? Is it strictly A-Z, or a-z, or 1-64? If it's not numeric, do we just allow any character whose value is >= 65? For example, 一,二, 三, 四? Technically, is 1 the highest possible numeric priority or would zero (or a negative number) be valid? I feel like maybe we should update the manual at the same time, and precisely specify what the allowed values are. I can sort of reverse engineer from the code, but is this documented anywhere other than the manual?
Thanks, Derek On Sat, Jul 19, 2025 at 8:07 AM Ihor Radchenko <yanta...@posteo.net> wrote: > Derek Chen-Becker <de...@chen-becker.org> writes: > > > I'm also not clear on why we upcase again when checking the bounds: > > > > ((or (< (upcase new) org-priority-highest) (> (upcase new) > > org-priority-lowest)) > > That's a historical code. It has been there before the earlier upcase > was introduced. > > Here is the initial version of that code: > ((eq action 'set) > (message "Priority A-%c, SPC to remove: " org-lowest-priority) > (setq new (read-char-exclusive)) > (cond ((equal new ?\ ) (setq remove t)) > ((or (< (upcase new) ?A) (> (upcase new) > org-lowest-priority)) > (error "Priority must be between `%c' and `%c'" > ?A org-lowest-priority)))) > > > -- > 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 | +---------------------------------------------------------------+