summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2015-08-19 11:12:43 +0200
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2015-08-19 11:12:43 +0200
commit1abc4887a2748863e06e3f3b9ade050bbd6edb2e (patch)
treef87772e8bb8dec4be64243b2c6d48dfe44297a50
parentcf31ea16609fd37eed55e2b137009e5a78cb3203 (diff)
downloadorg-mode-1abc4887a2748863e06e3f3b9ade050bbd6edb2e.tar.gz
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.
-rwxr-xr-xlisp/org.el8
-rw-r--r--testing/lisp/test-org.el7
2 files changed, 9 insertions, 6 deletions
diff --git a/lisp/org.el b/lisp/org.el
index 10a1d83..7bb16a1 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 5b80c48..d41e3a3 100644
--- a/testing/lisp/test-org.el
+++ b/testing/lisp/test-org.el
@@ -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"