branch: externals/org
commit 237c1671d5dad5e3e00f49e1bfd1301401d18868
Author: Derek Chen-Becker <[email protected]>
Commit: Ihor Radchenko <[email protected]>

    org.el: Add a meaningful message for `org-priority' invalid argument
    
    * lisp/org.el (org-priority): Change the error message when an invalid
    actions is passed to `org-priority' so that it indicates valid actions and
    values based on the current high and low bounds.
---
 lisp/org.el | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lisp/org.el b/lisp/org.el
index 445f0d9ea4..172b5c5592 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -11461,7 +11461,12 @@ interactive prompt, it will automatically be converted 
to uppercase."
                        (if org-priority-start-cycle-with-default
                            org-priority-default
                          (1+ org-priority-default))))))
-        (t (user-error "Invalid action")))
+        (t (user-error (concat "Invalid action: `%s'.  Action must be one of "
+                                "`up', `down', `set', `remove' or a value "
+                                "between `%s' and `%s'")
+                        action
+                        (org-priority-to-string org-priority-highest)
+                        (org-priority-to-string org-priority-lowest))))
         ;; Check against the current high/low range if we need to wrap
        (when (not (org-priority-valid-value-p new-value))
          (if (and (memq action '(up down))

Reply via email to