On 2026-01-10 08:25, Ihor Radchenko wrote:
> "Jacob S. Gordon" <[email protected]> writes:
> 
>> I found one more place and some (partially existing) edge behaviour.
>>
>> If you enter column mode on the following header (‘C-c C-x C-c’),
>> place the point on the priority column, and hit ‘S-<left>’ or
>> ‘S-<right>’ it should correctly cycle through the allowed values:
>>
>>   #+PRIORITIES: 1 10 7
>>   #+COLUMNS: %PRIORITY %ITEM
>>   * Heading
>>
>> Attached is a small patch to ‘org-property-get-allowed-values’ that
>> fixes it.
>> --8,--
>> diff --git a/lisp/org.el b/lisp/org.el
>> index 7b455a18a..572a2c448 100644
> 
> Do you want to create a full patch with commit message?

Sure, please find one attached!  (I thought Derek might have folded it
into their changes).

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
From 981015d80fd735c8db2c4b11539f27e918ce86bf Mon Sep 17 00:00:00 2001
From: "Jacob S. Gordon" <[email protected]>
Date: Sun, 11 Jan 2026 16:20:00 -0500
Subject: [PATCH v1] org: Account for numeric priorities in allowed property
 values

* lisp/org.el (org-property-get-allowed-values): Use
'org-priority-to-string' instead of 'char-to-string'.
* testing/lisp/test-org.el (test-org/priority-allowed-values): Add
tests.
---
 lisp/org.el              |  2 +-
 testing/lisp/test-org.el | 17 +++++++++++++++++
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/lisp/org.el b/lisp/org.el
index e3d0073c2..a8c7ef9d2 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -13963,7 +13963,7 @@ (defun org-property-get-allowed-values (epom property &optional table)
      ((equal property "PRIORITY")
       (let ((n org-priority-lowest))
 	(while (>= n org-priority-highest)
-	  (push (char-to-string n) vals)
+	  (push (org-priority-to-string n) vals)
 	  (setq n (1- n)))))
      ((equal property "CATEGORY"))
      ((member property org-special-properties))
diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el
index cd884c02f..7205ab948 100644
--- a/testing/lisp/test-org.el
+++ b/testing/lisp/test-org.el
@@ -10232,6 +10232,23 @@ (ert-deftest test-org/org-priority-cycling ()
                                 (goto-char (point-max))
                                 (org-priority-down)))))
 
+(ert-deftest test-org/priority-allowed-values ()
+  "Test `org-property-get-allowed-values' for priorities."
+  (dolist (bounds '((?A . ?J) (1 . 10)))
+    (let* ((org-priority-highest (car bounds))
+           (org-priority-lowest (cdr bounds))
+           (allowed-priorities-expected
+            (mapcar #'org-priority-to-string
+                    (number-sequence org-priority-highest
+                                     org-priority-lowest)))
+           (allowed-priorities
+            (org-property-get-allowed-values nil "PRIORITY")))
+      (should (= (length allowed-priorities-expected)
+                 (length allowed-priorities)))
+      (dotimes (n (length allowed-priorities))
+        (should (string-equal (elt allowed-priorities-expected n)
+                              (elt allowed-priorities n)))))))
+
 (provide 'test-org)
 
 ;;; test-org.el ends here

base-commit: ce83328b023e988aa8cbb8e8743db35abc24134e
-- 
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