summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2014-06-18 21:30:54 (GMT)
committer Nicolas Goaziou <mail@nicolasgoaziou.fr>2014-06-18 21:30:54 (GMT)
commit8b959237fca518fbd6dc7cd36a67093e1ec1f00b (patch)
treef305d7676356c3b14ae839781fa50c4da2e1f05e
parentab145f0df553e0bb77795c946ff158d8c069f6e4 (diff)
downloadorg-mode-8b959237fca518fbd6dc7cd36a67093e1ec1f00b.zip
org-mode-8b959237fca518fbd6dc7cd36a67093e1ec1f00b.tar.gz
ox: Small refactoring
* lisp/ox.el (org-export-get-category): Refactor code.
-rw-r--r--lisp/ox.el14
1 files changed, 1 insertions, 13 deletions
diff --git a/lisp/ox.el b/lisp/ox.el
index 4bfef52..4a538ae 100644
--- a/lisp/ox.el
+++ b/lisp/ox.el
@@ -3875,19 +3875,7 @@ INFO is a plist used as a communication channel.
CATEGORY is automatically inherited from a parent headline, from
#+CATEGORY: keyword or created out of original file name. If all
fail, the fall-back value is \"???\"."
- (or (let ((headline (if (eq (org-element-type blob) 'headline) blob
- (org-export-get-parent-headline blob))))
- ;; Almost like `org-export-node-property', but we cannot trust
- ;; `plist-member' as every headline has a `:CATEGORY'
- ;; property, would it be nil or equal to "???" (which has the
- ;; same meaning).
- (let ((parent headline) value)
- (catch 'found
- (while parent
- (let ((category (org-element-property :CATEGORY parent)))
- (and category (not (equal "???" category))
- (throw 'found category)))
- (setq parent (org-element-property :parent parent))))))
+ (or (org-export-get-node-property :CATEGORY blob t)
(org-element-map (plist-get info :parse-tree) 'keyword
(lambda (kwd)
(when (equal (org-element-property :key kwd) "CATEGORY")