Browse Source

ox-publish: Back-port `org-publish-property'

* lisp/ox-publish.el (org-publish-property): New function.
Nicolas Goaziou 3 years ago
parent
commit
c7cc30b4d6
1 changed files with 9 additions and 0 deletions
  1. 9 0
      lisp/ox-publish.el

+ 9 - 0
lisp/ox-publish.el

@@ -386,6 +386,15 @@ If there is no timestamp, create one."
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Getting project information out of `org-publish-project-alist'
 
+(defun org-publish-property (property project &optional default)
+  "Return value PROPERTY, as à symbol, in PROJECT.
+DEFAULT is returned when PROPERTY is not actually set in PROJECT
+definition."
+  (let ((properties (cdr project)))
+    (if (plist-member properties property)
+	(plist-get properties property)
+      default)))
+
 (defun org-publish-expand-projects (projects-alist)
   "Expand projects in PROJECTS-ALIST.
 This splices all the components into the list."