From 3e13ffdfb6ebfb15213b8175702f03df51cbe46d Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Tue, 18 Nov 2014 10:27:45 +0100 Subject: [PATCH] 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. --- lisp/org.el | 1 + testing/lisp/test-org.el | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/lisp/org.el b/lisp/org.el index 8fa895817..f8c83ebe5 100755 --- a/lisp/org.el +++ b/lisp/org.el @@ -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. diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el index cacfd8de2..6a71938f8 100644 --- a/testing/lisp/test-org.el +++ b/testing/lisp/test-org.el @@ -2770,6 +2770,10 @@ Text. (should (equal "cat" (org-test-with-temp-text "#+CATEGORY: cat\n* H" + (cdr (assoc "CATEGORY" (org-entry-properties)))))) + (should + (equal "cat" + (org-test-with-temp-text "#+CATEGORY: cat\n* H" (cdr (assoc "CATEGORY" (org-entry-properties nil "CATEGORY")))))) (should (equal "cat" -- 2.11.4.GIT