Hey,

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.

The edge behaviour appears when calling ‘org-priority-up’ (‘S-<up>’)
with point on on the priority cookie, which signals ‘Invalid priority
value ‘-1’’ (the message is new but the error is not):

  #+PRIORITIES: 0 10 5
  * [#0] Heading

With non-numeric priorities and ‘org-priority-down’ (‘S-<down>’) you
can get a similar error (which AFAICT is a regression)

  #+PRIORITIES: A Z M
  * [#Z] Heading

Thanks again for all your work on this Derek!

Best,

-- 
Jacob S. Gordon
[email protected]
Please avoid sending me HTML emails and MS Office documents.
https://useplaintext.email/#etiquette
diff --git a/lisp/org.el b/lisp/org.el
index 7b455a18a..572a2c448 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -13958,10 +13958,9 @@ (defun org-property-get-allowed-values (epom property &optional table)
       (setq vals (org-with-point-at epom
 		   (append org-todo-keywords-1 '("")))))
      ((equal property "PRIORITY")
-      (let ((n org-priority-lowest))
-	(while (>= n org-priority-highest)
-	  (push (char-to-string n) vals)
-	  (setq n (1- n)))))
+      (setq vals (mapcar #'org-priority-to-string
+                         (number-sequence org-priority-highest
+                                          org-priority-lowest))))
      ((equal property "CATEGORY"))
      ((member property org-special-properties))
      ((setq vals (run-hook-with-args-until-success

Reply via email to