浏览代码

org-export: Fix bug with default DATE value

* contrib/lisp/org-export.el (org-export-get-global-options): Parse
  default value from parsed keywords, too.
* testing/lisp/test-org-export.el: Change test accordingly.
Nicolas Goaziou 13 年之前
父节点
当前提交
bafe0fb295
共有 2 个文件被更改,包括 18 次插入5 次删除
  1. 17 4
      contrib/lisp/org-export.el
  2. 1 1
      testing/lisp/test-org-export.el

+ 17 - 4
contrib/lisp/org-export.el

@@ -1332,12 +1332,25 @@ process."
 		     (and backend
 			  (let ((var (intern
 				      (format "org-%s-options-alist" backend))))
-			    (and (boundp var) (eval var))))))
+			    (and (boundp var) (symbol-value var))))))
 	;; Output value.
 	plist)
-    (mapc (lambda (cell)
-	    (setq plist (plist-put plist (car cell) (eval (nth 3 cell)))))
-	  all)
+    (mapc
+     (lambda (cell)
+       (setq plist
+	     (plist-put
+	      plist
+	      (car cell)
+	      ;; Eval default value provided.  If keyword is a member
+	      ;; of `org-element-parsed-keywords', parse it as
+	      ;; a secondary string before storing it.
+	      (let ((value (eval (nth 3 cell))))
+		(if (not (stringp value)) value
+		  (let ((keyword (nth 1 cell)))
+		    (if (not (member keyword org-element-parsed-keywords)) value
+		      (org-element-parse-secondary-string
+		       value (org-element-restriction 'keyword)))))))))
+     all)
     ;; Return value.
     plist))
 

+ 1 - 1
testing/lisp/test-org-export.el

@@ -107,7 +107,7 @@ already filled in `info'."
 #+TITLE: with spaces"
       (org-export-get-inbuffer-options))
     '(:author
-      ("Me, Myself and I") :creator "Idem" :date "Today"
+      ("Me, Myself and I") :creator "Idem" :date ("Today")
       :description "Testing\nwith two lines" :email "some@email.org"
       :exclude-tags ("noexport" "invisible") :keywords "test" :language "en"
       :select-tags ("export") :title ("Some title with spaces")))))