From 1abc4887a2748863e06e3f3b9ade050bbd6edb2e Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Wed, 19 Aug 2015 11:12:43 +0200 Subject: [PATCH] Fix `org-entry-properties' with default priority * lisp/org.el (org-entry-properties): When no priority is explicitly set, report `org-default-priority' instead. * testing/lisp/test-org.el (test-org/entry-properties): Update test. --- lisp/org.el | 8 +++++--- testing/lisp/test-org.el | 7 ++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 10a1d8350..7bb16a1c4 100755 --- a/lisp/org.el +++ b/lisp/org.el @@ -15728,9 +15728,11 @@ strings." (push (cons "TODO" (org-match-string-no-properties 2)) props))) (when specific (throw 'exit props))) (when (or (not specific) (string= specific "PRIORITY")) - (when (looking-at org-priority-regexp) - (push (cons "PRIORITY" (org-match-string-no-properties 2)) - props)) + (push (cons "PRIORITY" + (if (looking-at org-priority-regexp) + (org-match-string-no-properties 2) + (char-to-string org-default-priority))) + props) (when specific (throw 'exit props))) (when (or (not specific) (string= specific "FILE")) (push (cons "FILE" (buffer-file-name (buffer-base-buffer))) diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el index 5b80c483f..d41e3a349 100644 --- a/testing/lisp/test-org.el +++ b/testing/lisp/test-org.el @@ -3356,9 +3356,10 @@ Paragraph" (equal "A" (org-test-with-temp-text "* [#A] H" (cdr (assoc "PRIORITY" (org-entry-properties)))))) - (should-not - (org-test-with-temp-text "* H" - (assoc "PRIORITY" (org-entry-properties nil "PRIORITY")))) + (should + (equal (char-to-string org-default-priority) + (org-test-with-temp-text "* H" + (cdr (assoc "PRIORITY" (org-entry-properties nil "PRIORITY")))))) ;; Get "FILE" property. (should (org-test-with-temp-text-in-file "* H\nParagraph" -- 2.11.4.GIT