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.
This commit is contained in:
Nicolas Goaziou 2015-08-19 11:12:43 +02:00
parent cf31ea1660
commit 1abc4887a2
2 changed files with 9 additions and 6 deletions

View File

@ -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)))

View File

@ -3356,9 +3356,10 @@ Paragraph<point>"
(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"