From 5aea96e258b694d25aa9ebc0012f499d09b415b6 Mon Sep 17 00:00:00 2001 From: alexgiorev Date: Sat, 5 Feb 2022 00:50:26 +0200 Subject: [PATCH 3/3] lisp/org.el: Fix priority 32 removing the cookie in org-priority * lisp/org.el (org-priority): When numerical priorities are used, and the caller supplies 32 as the new priority value, the priority cookie is removed because this is the code point of the space character. This patch fixes this so that supplying 32 will change the priority to 32. TINYCHANGE --- lisp/org.el | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 757c306bc..3ffddff94 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -11382,21 +11382,23 @@ When called programmatically, ACTION can be `set', `up', `down', (read-string msg) (message msg) (char-to-string (read-char-exclusive))))) - (if (equal s " ") ?\s (string-to-number s))) + (if (equal s " ") + (progn (setq remove t) ?\s) + (string-to-number s))) (progn (message "Priority %c-%c, SPC to remove: " org-priority-highest org-priority-lowest) (save-match-data - (setq new (read-char-exclusive))))))) + (setq new (read-char-exclusive) + remove (= new ?\s))))))) (when (and (= (upcase org-priority-highest) org-priority-highest) (= (upcase org-priority-lowest) org-priority-lowest)) (setq new (upcase new))) - (cond ((equal new ?\s) (setq remove t)) - ((or (< new org-priority-highest) (> new org-priority-lowest)) - (user-error - (if nump - "Priority must be between `%s' and `%s'" - "Priority must be between `%c' and `%c'") - org-priority-highest org-priority-lowest)))) + (when (or (< new org-priority-highest) (> new org-priority-lowest)) + (user-error + (if nump + "Priority must be between `%s' and `%s'" + "Priority must be between `%c' and `%c'") + org-priority-highest org-priority-lowest))) ((eq action 'up) (setq new (if have (1- current) ; normal cycling -- 2.25.1