[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals-release/org 4aca51f: org-priority: Fix SPC handling for
From: |
ELPA Syncer |
Subject: |
[elpa] externals-release/org 4aca51f: org-priority: Fix SPC handling for numeric priorities (bug#52341) |
Date: |
Thu, 9 Dec 2021 22:57:29 -0500 (EST) |
branch: externals-release/org
commit 4aca51fcbec7c4753792998a8a6afb36af2ea7c4
Author: Kyle Meyer <kyle@kyleam.com>
Commit: Kyle Meyer <kyle@kyleam.com>
org-priority: Fix SPC handling for numeric priorities (bug#52341)
* lisp/org.el (org-priority): When reading numeric priorities, provide
special handling of SPC so that it clears the priority, as advertised.
If the user has configured numeric priorities and tries to clear a
priority by inputting SPC at the prompt, org-priority feeds " " to
string-to-number and ends up with 0 instead of the ?\s (32) that's
used downstream to signal "remove". Explicitly check for " " and
translate it to ?\s.
Reported-by: "Bruce E. Robertson" <brucer42@gmail.com>
Link: https://list.orgmode.org/877dch89s1.fsf@kyleam.com/
---
lisp/org.el | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/lisp/org.el b/lisp/org.el
index 1a13754..998da06 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -11323,13 +11323,14 @@ or a character."
(setq
new
(if nump
- (let ((msg (format "Priority %s-%s, SPC to remove: "
- (number-to-string org-priority-highest)
- (number-to-string org-priority-lowest))))
- (if (< 9 org-priority-lowest)
- (string-to-number (read-string msg))
- (message msg)
- (string-to-number (char-to-string
(read-char-exclusive)))))
+ (let* ((msg (format "Priority %s-%s, SPC to remove: "
+ (number-to-string org-priority-highest)
+ (number-to-string org-priority-lowest)))
+ (s (if (< 9 org-priority-lowest)
+ (read-string msg)
+ (message msg)
+ (char-to-string (read-char-exclusive)))))
+ (if (equal s " ") ?\s (string-to-number s)))
(progn (message "Priority %c-%c, SPC to remove: "
org-priority-highest org-priority-lowest)
(save-match-data
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [elpa] externals-release/org 4aca51f: org-priority: Fix SPC handling for numeric priorities (bug#52341),
ELPA Syncer <=