forked from mirrors/org-mode
Fix CATEGORY property retrieval
* lisp/org.el (org-entry-properties): Fix returned CATEGORY property when no specific keyword is provided. * testing/lisp/test-org.el (test-org/entry-properties): Add test.
This commit is contained in:
parent
4375a941cc
commit
3e13ffdfb6
|
@ -15730,6 +15730,7 @@ strings."
|
|||
(if p (setcdr p (concat value " " (cdr p)))
|
||||
(push (cons key value) props))))))))))))
|
||||
(unless (assoc "CATEGORY" props)
|
||||
(goto-char beg)
|
||||
(push (cons "CATEGORY" (org-get-category)) props)
|
||||
(when (string= specific "CATEGORY") (throw 'exit props)))
|
||||
;; Return value.
|
||||
|
|
|
@ -2767,6 +2767,10 @@ Text.
|
|||
(org-test-with-temp-text "* H"
|
||||
(cdr (assoc "SCHEDULED" (org-entry-properties nil "SCHEDULED")))))
|
||||
;; Get "CATEGORY"
|
||||
(should
|
||||
(equal "cat"
|
||||
(org-test-with-temp-text "#+CATEGORY: cat\n<point>* H"
|
||||
(cdr (assoc "CATEGORY" (org-entry-properties))))))
|
||||
(should
|
||||
(equal "cat"
|
||||
(org-test-with-temp-text "#+CATEGORY: cat\n<point>* H"
|
||||
|
|
Loading…
Reference in a new issue