lisp/org.el: Minor enhancement to `org-priority'

* lisp/org.el (org-priority): When the set of numeric priorities
only comprises single digits, ask for a single char event.
This commit is contained in:
Bastien 2021-05-15 23:07:50 +02:00
parent 747b10c2e0
commit 1d99f5a65a
1 changed files with 7 additions and 4 deletions

View File

@ -11258,10 +11258,13 @@ or a character."
(setq
new
(if nump
(string-to-number
(read-string (format "Priority %s-%s, SPC to remove: "
(number-to-string org-priority-highest)
(number-to-string org-priority-lowest))))
(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)))))
(progn (message "Priority %c-%c, SPC to remove: "
org-priority-highest org-priority-lowest)
(save-match-data