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:
parent
cf31ea1660
commit
1abc4887a2
|
@ -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)))
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue