Forráskód Böngészése

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

* lisp/ox-publish.el (org-publish-property): New function.
Nicolas Goaziou 8 éve
szülő
commit
c7cc30b4d6
1 módosított fájl, 9 hozzáadás és 0 törlés
  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."