From e6bde308c75a1ed0cd26959fc6c9b5d5cc0bc975 Mon Sep 17 00:00:00 2001 From: Tommy Jollyboat <11634808+ComedyTomedy@users.noreply.github.com> Date: Fri, 11 Oct 2024 00:19:29 +0100 Subject: [PATCH] Feat: Enable all valid priority values Expand recognised priority values from A-C to current org-mode standard of A-Z and 0-64. Futher work is required to use `org-get-priority-function` and support custom priority values. --- org-ql.el | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/org-ql.el b/org-ql.el index 76af6fc..91cf0ad 100644 --- a/org-ql.el +++ b/org-ql.el @@ -1735,15 +1735,14 @@ priority B)." `(priority ',comparator ,letter))) :preambles - (;; NOTE: This only accepts A, B, or C. I haven't seen - ;; other priorities in the wild, so this will do for now. - (`(,predicate-names) + ((`(,predicate-names) ;; Any priority cookie. - (list :regexp (rx-to-string `(seq bol (1+ "*") (1+ blank) (0+ nonl) "[#" (in "ABC") "]") t))) + (list :regexp (rx-to-string `(seq bol (1+ "*") (1+ blank) (0+ nonl) "[#" (or (in "A-Z") (1+ (in "0-9"))) "]") t))) (`(,predicate-names ,(and (or ''= ''< ''> ''<= ''>=) comparator) ,letter) ;; Comparator and priority letter. ;; NOTE: The double-quoted comparators. See below. - (let* ((priority-letters '("A" "B" "C")) + (let* ((priority-letters (append (mapcar #'number-to-string (number-sequence 0 64)) + (mapcar #'string (number-sequence ?A ?Z)))) (index (-elem-index letter priority-letters)) ;; NOTE: Higher priority == lower number. ;; NOTE: Because we need to support both preamble-based queries and