branch: externals/org
commit 8e0c195ccacb4370706d369af5ee59fb06da6a5b
Author: Jacob S. Gordon <[email protected]>
Commit: Ihor Radchenko <[email protected]>

    speed-commands: Adapt priority commands to user options
    
    * lisp/org-keys.el (org-speed-commands): For speed commands 1, 2, and
    3, insert the highest, default, and lowest priorities instead of ?A,
    ?B,and ?C, respectively.  Fix the argument of `org-priority' when
    removing with the 0 speed key.
    (org-priority-highest, org-priority-default, org-priority-lowest):
    Declare.
    * etc/ORG-NEWS (Important announcements and breaking changes):
    Announce change.
---
 etc/ORG-NEWS     |  7 +++++++
 lisp/org-keys.el | 11 +++++++----
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 2e1f79f8c2..d37d7f6c5a 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -167,6 +167,13 @@ The =show= parameter for the =org-priority= function was 
deprecated in
 Org 9.2 (released in 2017). Sufficient time has passed and it is being
 removed as part of refactoring for numeric priorities.
 
+*** Priority speed commands adapt to user options
+
+Previously, =1=, =2=, and =3= would insert priorities =A=, =B=, and
+=C=, which causes errors when using numeric priorities.  These now
+insert ~org-priority-highest~, ~org-priority-default~, and
+~org-priority-lowest~, respectively.
+
 ** New features
 
 # We list the most important features, and the features that may
diff --git a/lisp/org-keys.el b/lisp/org-keys.el
index 0094ed71b5..dded5f0545 100644
--- a/lisp/org-keys.el
+++ b/lisp/org-keys.el
@@ -159,6 +159,9 @@
 (declare-function org-previous-link "ol" ())
 (declare-function org-previous-visible-heading "org" (arg))
 (declare-function org-priority "org" (&optional action show))
+(defvar org-priority-highest)
+(defvar org-priority-default)
+(defvar org-priority-lowest)
 (declare-function org-promote-subtree "org" ())
 (declare-function org-refile "org-refile" (&optional arg1 default-buffer rfloc 
msg))
 (declare-function org-refile-copy "org-refile" ())
@@ -757,10 +760,10 @@ hook.  The default setting is 
`org-speed-command-activate'."
     ("Meta Data Editing")
     ("t" . org-todo)
     ("," . (org-priority))
-    ("0" . (org-priority ?\ ))
-    ("1" . (org-priority ?A))
-    ("2" . (org-priority ?B))
-    ("3" . (org-priority ?C))
+    ("0" . (org-priority 'remove))
+    ("1" . (org-priority org-priority-highest))
+    ("2" . (org-priority org-priority-default))
+    ("3" . (org-priority org-priority-lowest))
     (":" . org-set-tags-command)
     ("e" . org-set-effort)
     ("E" . org-inc-effort)

Reply via email to