On 2026-01-23 00:38, Derek Chen-Becker wrote:
> Let me take a look at the mouse patch. In the meantime, I worked
> through a bunch (but not all) of the export formatting issues you
> found.
Awesome, thanks! They generally look good to me (modulo some minor
nits like long lines in ‘org-html--priority’)
The ODT style file might also need to be updated, since the change
will wrap numeric priorities in styles ‘OrgPriority-#’ but only the
‘A’, ‘B’, ‘C’ styles are defined in ‘etc/styles/OrgOdtStyles.xml’.
<style:style style:name="OrgPriority" […]/> <style:style
style:name="OrgPriority-A" […]/> <style:style
style:name="OrgPriority-B" […]/> <style:style
style:name="OrgPriority-C" […]/>
> So far the only one I'm not 100% happy about is the ox-odt fix,
> because there don't appear to be any unit tests for ox-odt that I
> can add to and I need to think about the best way to test ODT export
> (suggestions, anyone?).
Yeah the lack of tests isn't great, but it’s a more general problem
that could wait IMO. There isn’t any public ‘plain text’/buffer
export for ODT since it wouldn’t make much sense, but the
‘content.xml’ inside the ZIP is testable like HTML. Instead of
exporting normally and unzipping (e.g., ‘org-odt--zip-extract’), maybe
a test harness could be built around some export functions (e.g.,
‘org-odt-template’)? If I get a chance I’ll give it a try.
Last dump of the remaining things I've found (with patches attached),
mostly grepping around with ‘\(priority\|urgen\)\|%[-]*[0-9]*c’.
Squash and rearrange to your heart’s content, Ihor.
1. Completion of the ‘PRIORITIES’ file option: go to an Org buffer,
enter ‘#+PRIO’ and hit ‘M-<tab>’ twice. With numeric priorities
you should see, e.g.,
#+PRIORITIES: 1 10 5
2. Speed commands ‘1’, ‘2,’ and ‘3’ were hard-coded to insert ‘?A’,
‘?B’, and ‘?C’, causing errors for numeric priorities. They now
insert the highest, default, and lowest priorities, respectively.
Some undocumented behaviour of ‘org-priority’ was also changed that
the ‘0’ speed command relied on, which is fixed by passing a symbol
instead. You can try it out with the following buffer and option:
#+PRIORITIES: 1 10 5
* Heading
#+begin_src emacs-lisp
(setopt org-use-speed-commands t)
#+end_src
I also noticed that the error messages have degraded a bit for
‘org-priority’ (‘Invalid action’ vs. ‘Priority must be between ‘N’
and ‘M’’), but left them as-is. WDYT about restoring the old ones?
3. Font-locking of numeric priorities can fail when the user
customizes ‘org-priority-faces’, e.g.,
(setopt org-priority-faces '((1 . "red")))
OR with ‘org-agenda-fontify-priorities’ (they're overridden by the
former), e.g.,
(setopt org-agenda-fontify-priorities '((1 . "green")))
OR with neither of these set, the lowest (highest) should be set in
bold (italic). The customization type was actually wrong in the
agenda case, and I’ve updated some related doc strings and
customization types to make them easier to use.
4. Some documentation improvements in the manual and guide. In
particular, it wasn’t clear to me how the ‘urgency’ acted for
numeric priorities, but could just be me.
5. A small correction in a test case.
6. It would be nice if ‘org-lint’ checked for out-of-bounds, invalid
or malformed priorities, so I’ve implemented it.
Phew, that’s all that’s on my radar in Org. There’s some priority
logic that has to change in [‘org-ql'] (and [‘org-super-agenda’] to a
lesser extent) which may need bug reports. I have some quick patches
in my local versions; should we loop in Adam? Are there any other
popular packages that might be affected?
Besides ‘org-mouse’ I hope that’s it!
[‘org-ql’]<https://github.com/alphapapa/org-ql>
[‘org-super-agenda’]<https://github.com/alphapapa/org-super-agenda>
Best,
--
Jacob S. Gordon [email protected] Please don’t send me HTML
emails or MS Office/Apple iWork documents.
https://useplaintext.email/#etiquette
https://www.fsf.org/campaigns/opendocument
From f651b0cbf6b93cf7aca9c876920c3507aca12d33 Mon Sep 17 00:00:00 2001
From: "Jacob S. Gordon" <[email protected]>
Date: Fri, 23 Jan 2026 16:20:00 -0500
Subject: [PATCH 1/6] pcomplete: Fix completion of numeric priorities in file
option
* lisp/org-pcomplete.el (org-priority-to-string): Declare.
(org-priority-default, org-priority-lowest): Move together.
(pcomplete/org-mode/file-option/priorities): Handle numeric priorities
properly with `org-priority-to-string'.
---
lisp/org-pcomplete.el | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/lisp/org-pcomplete.el b/lisp/org-pcomplete.el
index b1bde7a17..4b2ba63c8 100644
--- a/lisp/org-pcomplete.el
+++ b/lisp/org-pcomplete.el
@@ -54,10 +54,10 @@ (declare-function org-get-tags "org" (&optional pos local))
(declare-function org-link-heading-search-string "ol" (&optional string))
(declare-function org-tag-alist-to-string "org" (alist &optional skip-key))
(declare-function org-time-stamp-format "org" (&optional with-time inactive custom))
+(declare-function org-priority-to-string "org" (priority))
(defvar org-babel-common-header-args-w-values)
(defvar org-current-tag-alist)
-(defvar org-priority-default)
(defvar org-drawer-regexp)
(defvar org-element-affiliated-keywords)
(defvar org-entities)
@@ -66,9 +66,10 @@ (defvar org-export-exclude-tags)
(defvar org-export-select-tags)
(defvar org-file-tags)
(defvar org-priority-highest)
+(defvar org-priority-default)
+(defvar org-priority-lowest)
(defvar org-link-abbrev-alist)
(defvar org-link-abbrev-alist-local)
-(defvar org-priority-lowest)
(defvar org-options-keywords)
(defvar org-outline-regexp)
(defvar org-property-re)
@@ -274,10 +275,11 @@ (defun pcomplete/org-mode/file-option/language ()
(defun pcomplete/org-mode/file-option/priorities ()
"Complete arguments for the #+PRIORITIES file option."
- (pcomplete-here (list (format "%c %c %c"
- org-priority-highest
- org-priority-lowest
- org-priority-default))))
+ (pcomplete-here
+ (list (format "%s %s %s"
+ (org-priority-to-string org-priority-highest)
+ (org-priority-to-string org-priority-lowest)
+ (org-priority-to-string org-priority-default)))))
(defun pcomplete/org-mode/file-option/select_tags ()
"Complete arguments for the #+SELECT_TAGS file option."
--
Jacob S. Gordon
[email protected]
Please don’t send me HTML emails or MS Office/Apple iWork documents.
https://useplaintext.email/#etiquette
https://www.fsf.org/campaigns/opendocument
From 5c9f7ad164f382a4cdc4de16ff5bdc4a3517a284 Mon Sep 17 00:00:00 2001
From: "Jacob S. Gordon" <[email protected]>
Date: Fri, 23 Jan 2026 16:21:00 -0500
Subject: [PATCH 2/6] 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 2e1f79f8c..04befe123 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, =0=, =1=, and =2= 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 0094ed71b..dded5f054 100644
--- a/lisp/org-keys.el
+++ b/lisp/org-keys.el
@@ -159,6 +159,9 @@ (declare-function org-previous-block "org" (arg &optional block-regexp))
(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 @@ (defcustom org-speed-commands
("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)
--
Jacob S. Gordon
[email protected]
Please don’t send me HTML emails or MS Office/Apple iWork documents.
https://useplaintext.email/#etiquette
https://www.fsf.org/campaigns/opendocument
From 2aa4104e23aedaa5c66fb9d79a154a909dd83e3f Mon Sep 17 00:00:00 2001
From: "Jacob S. Gordon" <[email protected]>
Date: Fri, 23 Jan 2026 16:22:00 -0500
Subject: [PATCH 3/6] org-faces: Correct font locking of numeric priorities
* lisp/org-agenda.el (org-agenda-fontify-priorities): Use
`org-priority-to-value' instead of `string-to-char'.
(org-agenda-fontify-priorities):
* lisp/org-faces.el (org-priority-faces): Correct type to an alist and
add non-negative numbers as an option for the key.
* lisp/org.el (org-font-lock-add-priority-faces): Use
`org-priority-to-value' instead of `string-to-char'.
(org-get-priority-face): Generalize doc string.
---
lisp/org-agenda.el | 27 ++++++++++++++-------------
lisp/org-faces.el | 21 ++++++++++++---------
lisp/org.el | 4 ++--
3 files changed, 28 insertions(+), 24 deletions(-)
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index f6ccc1a09..106a0919b 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -2025,23 +2025,24 @@ (defcustom org-agenda-fontify-priorities 'cookies
However, settings in `org-priority-faces' will overrule these faces.
When this variable is the symbol `cookies', only fontify the
cookies, not the entire task.
-This may also be an association list of priority faces, whose
-keys are the character values of `org-priority-highest',
-`org-priority-default', and `org-priority-lowest' (the default values
-are ?A, ?B, and ?C, respectively). The face may be a named face, a
-color as a string, or a list like `(:background \"Red\")'.
-If it is a color, the variable `org-faces-easy-properties'
-determines if it is a foreground or a background color."
+
+This may also be an association list of priority faces, whose keys are
+priorities and values are faces. The face may be a named face, a color
+as a string, or a list like `(:background \"Red\")'. If it is a color,
+the variable `org-faces-easy-properties' determines if it is a
+foreground or a background color."
:group 'org-agenda-line-format
:type '(choice
(const :tag "Never" nil)
(const :tag "Defaults" t)
(const :tag "Cookies only" cookies)
- (repeat :tag "Specify"
- (list (character :tag "Priority" :value ?A)
- (choice :tag "Face "
- (string :tag "Color")
- (sexp :tag "Face"))))))
+ (alist :tag "Association list"
+ :key-type (choice :tag "Priority"
+ (character :tag "Character" :value ?A)
+ (natnum :tag "Number" :value 1))
+ :value-type (choice :tag "Face "
+ (string :tag "Color")
+ (sexp :tag "Face")))))
(defcustom org-agenda-day-face-function nil
"Function called to determine what face should be used to display a day.
@@ -4129,7 +4130,7 @@ (defun org-agenda-fontify-priorities ()
org-priority-highest)
l (or (get-char-property (point) 'org-priority-lowest)
org-priority-lowest)
- p (string-to-char (match-string 2))
+ p (org-priority-to-value (match-string 2))
b (match-beginning 1)
e (if (eq org-agenda-fontify-priorities 'cookies)
(1+ (match-end 2))
diff --git a/lisp/org-faces.el b/lisp/org-faces.el
index 85a24b00a..b0f5ef9d7 100644
--- a/lisp/org-faces.el
+++ b/lisp/org-faces.el
@@ -325,20 +325,23 @@ (defface org-priority '((t :inherit font-lock-keyword-face))
(defcustom org-priority-faces nil
"Faces for specific Priorities.
-This is a list of cons cells, with priority character in the car
-and faces in the cdr. The face can be a symbol, a color
-as a string, or a property list of attributes, like
+This is an association list, whose keys are priorities and values are
+faces. The face can be a symbol, a color as a string, or a property
+list of attributes, like
(:foreground \"blue\" :weight bold :underline t).
If it is a color string, the variable `org-faces-easy-properties'
determines if it is a foreground or a background color."
:group 'org-faces
:group 'org-todo
- :type '(repeat
- (cons
- (character :tag "Priority")
- (choice :tag "Face "
- (string :tag "Color")
- (sexp :tag "Face")))))
+ :type '(choice (const :tag "Defaults" nil)
+ (alist :tag "Association list"
+ :key-type
+ (choice :tag "Priority"
+ (character :tag "Character" :value ?A)
+ (natnum :tag "Number" :value 1))
+ :value-type (choice :tag "Face "
+ (string :tag "Color")
+ (sexp :tag "Face")))))
(defvar org-tags-special-faces-re nil)
(defun org-set-tag-faces (var value)
diff --git a/lisp/org.el b/lisp/org.el
index a8c7ef9d2..50c163610 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -6291,7 +6291,7 @@ (defun org-get-todo-face (kwd)
(defun org-get-priority-face (priority)
"Get the right face for PRIORITY.
-PRIORITY is a character."
+PRIORITY is a number from 0-64 or a character value from ?A to ?Z."
(or (org-face-from-face-or-color
'priority 'org-priority (cdr (assq priority org-priority-faces)))
'org-priority))
@@ -6313,7 +6313,7 @@ (defun org-font-lock-add-priority-faces (limit)
(end (1+ (match-end 2))))
(add-face-text-property
beg end
- (org-get-priority-face (string-to-char (match-string 2))))
+ (org-get-priority-face (org-priority-to-value (match-string 2))))
(add-text-properties
beg end
(list 'font-lock-fontified t)))))
--
Jacob S. Gordon
[email protected]
Please don’t send me HTML emails or MS Office/Apple iWork documents.
https://useplaintext.email/#etiquette
https://www.fsf.org/campaigns/opendocument
From 0ee3a317e000b9214e5e95fb63e197a8ae68d2fc Mon Sep 17 00:00:00 2001
From: "Jacob S. Gordon" <[email protected]>
Date: Fri, 23 Jan 2026 16:23:00 -0500
Subject: [PATCH 4/6] Improve documentation of numeric priorities
* doc/org-guide.org (Priorities): Describe numeric priorities and
in-buffer settings.
(Export Settings): Correct typo.
* doc/org-manual.org (Sorting of agenda items): Improve description of
urgency score.
(Summary of In-Buffer Settings): Correct range of numeric priorities.
---
doc/org-guide.org | 25 +++++++++++++++++++++----
doc/org-manual.org | 12 +++++++-----
2 files changed, 28 insertions(+), 9 deletions(-)
diff --git a/doc/org-guide.org b/doc/org-guide.org
index ae8fe602d..186babdf2 100644
--- a/doc/org-guide.org
+++ b/doc/org-guide.org
@@ -800,9 +800,26 @@ ** Priorities
: *** TODO [#A] Write letter to Sam Fortune
-Org mode supports three priorities: =A=, =B=, and =C=. =A= is the
-highest, =B= the default if none is given. Priorities make
-a difference only in the agenda.
+By default, Org mode supports three priorities: =A=, =B=, and =C=.
+=A= is the highest, =B= the default if none is given. Priorities only
+make a difference in sorting the agenda (see [[*The Weekly/Daily
+Agenda]]).
+
+You can alternatively use numeric values (0-64, inclusive) for
+priorities, such as
+
+: *** TODO [#1] Write letter to Sam Fortune
+
+or other ranges of the alphabet (Latin, A-Z) by customizing the
+variables ~org-priority-highest~, ~org-priority-lowest~, and
+~org-priority-default~. On a per-buffer basis you may set the values
+of (highest, lowest, default) with a line
+
+: #+PRIORITIES: A C B
+
+or, for numeric priorities
+
+: #+PRIORITIES: 1 10 5
#+attr_texinfo: :sep ;
- {{{kbd(C-c \,)}}} (~org-priority~) ::
@@ -2150,7 +2167,7 @@ ** Export Settings
: #+TITLE: I'm in the Mood for Org
-Most proeminent export options include:
+Most prominent export options include:
| =TITLE= | the title to be shown |
| =AUTHOR= | the author (default taken from ~user-full-name~) |
diff --git a/doc/org-manual.org b/doc/org-manual.org
index 8f917a57e..59117037f 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -9790,10 +9790,12 @@ *** Sorting of agenda items
time-of-day specification. These entries are shown at the beginning
of the list, as a /schedule/ for the day. After that, items remain
grouped in categories, in the sequence given by ~org-agenda-files~.
- Within each category, items are sorted by urgency, which is composed
- of the base priority (see [[*Priorities]]; 2000 for priority =A=, 1000
- for =B=, and 0 for =C=), plus additional increments for overdue
- scheduled or deadline items.
+ Within each category, items are sorted by urgency, which is derived
+ from the priority (see [[*Priorities]]), plus additional increments
+ for overdue scheduled or deadline items. The minimum priority is
+ scored as 0, the next as 1000, and continues in steps of 1000 until
+ reaching the maximum priority, e.g., =C=, =B=, =A= are scored as 0,
+ 1000, and 2000, respectively.
- For the TODO list, items remain in the order of categories, but
within each category, sorting takes place according to urgency. The
@@ -20774,7 +20776,7 @@ ** Summary of In-Buffer Settings
#+vindex: org-priority-lowest
#+vindex: org-priority-default
This line sets the limits and the default for the priorities. All
- three must be either letters A--Z or numbers 0--9. The highest
+ three must be either letters A--Z or numbers 0--64. The highest
priority must have a lower ASCII number than the lowest priority.
- =#+PROPERTY: Property_Name Value= ::
--
Jacob S. Gordon
[email protected]
Please don’t send me HTML emails or MS Office/Apple iWork documents.
https://useplaintext.email/#etiquette
https://www.fsf.org/campaigns/opendocument
From 6ad0e3d76abc80b2fd19c0e865a7b987ef186351 Mon Sep 17 00:00:00 2001
From: "Jacob S. Gordon" <[email protected]>
Date: Fri, 23 Jan 2026 16:24:00 -0500
Subject: [PATCH 5/6] ; test-org: Use `org-priority-to-string' to convert
priorities
* testing/lisp/test-org.el (test-org/entry-properties): Use
`org-priority-to-string' instead of `char-to-string'.
---
testing/lisp/test-org.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el
index 7205ab948..6015e6fd0 100644
--- a/testing/lisp/test-org.el
+++ b/testing/lisp/test-org.el
@@ -7254,7 +7254,7 @@ (ert-deftest test-org/entry-properties ()
(org-test-with-temp-text "* [#A] H"
(cdr (assoc "PRIORITY" (org-entry-properties))))))
(should
- (equal (char-to-string org-priority-default)
+ (equal (org-priority-to-string org-priority-default)
(org-test-with-temp-text "* H"
(cdr (assoc "PRIORITY" (org-entry-properties nil "PRIORITY"))))))
;; Get "FILE" property.
--
Jacob S. Gordon
[email protected]
Please don’t send me HTML emails or MS Office/Apple iWork documents.
https://useplaintext.email/#etiquette
https://www.fsf.org/campaigns/opendocument
From 3e5737e8ec90ab2e88aa11fa42501421ed819b1e Mon Sep 17 00:00:00 2001
From: "Jacob S. Gordon" <[email protected]>
Date: Fri, 23 Jan 2026 16:25:00 -0500
Subject: [PATCH 6/6] org-lint: Add check for priorities
* lisp/org-lint.el (org-lint-priority): Raise warnings on headlines
containing out-of-bounds, invalid (e.g., `[#-1]', `[#AA]'), or
malformed (e.g., `[#1', `[#A') priorities.
* testing/lisp/test-org-lint.el (test-org-lint/priority): Add test.
* etc/ORG-NEWS (New features): Announce feature.
---
etc/ORG-NEWS | 6 ++++++
lisp/org-lint.el | 31 +++++++++++++++++++++++++++++++
testing/lisp/test-org-lint.el | 24 ++++++++++++++++++++++++
3 files changed, 61 insertions(+)
diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 04befe123..e3c1d4fd9 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -286,6 +286,12 @@ executable can be configured via =org-ditaa-exec=.
SVG output can now be generated; note, however, that this requires a
ditaa version of at least 0.11.0.
+*** ~org-lint~ now checks priorities
+
+Warnings are raised on headlines containing out-of-bounds, invalid
+(e.g., =[#-1]=, =[#AA]=), or malformed (e.g., =[#1=, =[#A=)
+priorities.
+
** New and changed options
# Changes dealing with changing default values of customizations,
diff --git a/lisp/org-lint.el b/lisp/org-lint.el
index 00bc9c340..04474b4b0 100644
--- a/lisp/org-lint.el
+++ b/lisp/org-lint.el
@@ -1506,6 +1506,32 @@ (defun org-lint-item-number (ast)
(format "Bullet counter \"%s\" is not the same with item position %d. Consider adding manual [@%d] counter."
bullet (car (last true-number)) bullet-number))))))))
+(defun org-lint-priority (ast)
+ "Report out-of-bounds, invalid, and malformed priorities.
+Raise warnings on headlines containing out-of-bounds, invalid (e.g.,
+`[#-1]', `[#AA]'), or malformed (e.g., `[#1', `[#A') priorities."
+ (let ((bad-priority-rx (rx line-start ?\[ ?#
+ (group (zero-or-more (not (in ?\[ ?\]))))
+ (group (zero-or-more ?\])))))
+ (org-element-map ast 'headline
+ (lambda (headline)
+ (if-let* ((priority (org-element-property :priority headline)))
+ (when (and (not (org-priority-valid-value-p priority))
+ (org-priority-valid-value-p priority t))
+ (list (org-element-begin headline)
+ (format "Out-of-bounds priority '%s'"
+ (org-priority-to-string priority))))
+ (when-let* ((headline-value (org-element-property
+ :raw-value headline))
+ (matches (string-match bad-priority-rx
+ headline-value)))
+ (list (org-element-begin headline)
+ (if (string-empty-p (match-string 2 headline-value))
+ (format "Malformed priority '%s'"
+ (match-string 0 headline-value))
+ (format "Invalid priority '%s'"
+ (match-string 1 headline-value))))))))))
+
(defun org-lint-LaTeX-$ (ast)
"Report semi-obsolete $...$ LaTeX fragments.
AST is the buffer parse tree."
@@ -1864,6 +1890,11 @@ (org-lint-add-checker 'item-number
#'org-lint-item-number
:categories '(plain-list))
+(org-lint-add-checker 'priority
+ "Report out-of-bounds, invalid, and malformed priorities."
+ #'org-lint-priority
+ :categories '(markup))
+
(org-lint-add-checker 'LaTeX-$
"Report potentially confusing $...$ LaTeX markup."
#'org-lint-LaTeX-$
diff --git a/testing/lisp/test-org-lint.el b/testing/lisp/test-org-lint.el
index dd22fa682..a2c7a06e6 100644
--- a/testing/lisp/test-org-lint.el
+++ b/testing/lisp/test-org-lint.el
@@ -648,5 +648,29 @@ (ert-deftest test-org-lint/incomplete-citation ()
(org-test-with-temp-text "[cite:@foo]"
(org-lint '(incomplete-citation)))))
+(ert-deftest test-org-lint/priority ()
+ "Test `org-lint-priority'."
+ (dolist (bounds '((0 . 10) (?A . ?K)))
+ (let* ((org-priority-highest (car bounds))
+ (org-priority-lowest (cdr bounds)))
+ (let ((valid-buffer (mapconcat
+ #'(lambda (p) (format "* [#%s]"
+ (org-priority-to-string p)))
+ (number-sequence org-priority-highest
+ org-priority-lowest) "\n")))
+ (should-not (org-test-with-temp-text valid-buffer
+ (org-lint '(priority)))))
+ (dolist (invalid-buffer
+ (let ((priorities (list (1- org-priority-highest)
+ (1+ org-priority-lowest)
+ (1- 0) (1+ ?Z) "" "]" "AA")))
+ (append
+ (mapcar #'(lambda (p) (format "* [#%s]" p))
+ priorities)
+ (mapcar #'(lambda (p) (format "* [#%s" p))
+ priorities))))
+ (should (org-test-with-temp-text invalid-buffer
+ (org-lint '(priority))))))))
+
(provide 'test-org-lint)
;;; test-org-lint.el ends here
--
Jacob S. Gordon
[email protected]
Please don’t send me HTML emails or MS Office/Apple iWork documents.
https://useplaintext.email/#etiquette
https://www.fsf.org/campaigns/opendocument