浏览代码

Merge branch 'bugfix'

Nicolas Goaziou 3 年之前
父节点
当前提交
d2f4d4b457
共有 2 个文件被更改,包括 10 次插入1 次删除
  1. 1 1
      lisp/org-macro.el
  2. 9 0
      testing/lisp/test-org-macro.el

+ 1 - 1
lisp/org-macro.el

@@ -127,7 +127,7 @@ previous one, unless VALUE is nil.  Return the updated list."
   "Collect macro definitions in current buffer and setup files.
   "Collect macro definitions in current buffer and setup files.
 Return an alist containing all macro templates found."
 Return an alist containing all macro templates found."
   (let ((templates
   (let ((templates
-         `(("author" . ,(org-macro--find-keyword-value "AUTHOR"))
+         `(("author" . ,(org-macro--find-keyword-value "AUTHOR" t))
 	   ("email" . ,(org-macro--find-keyword-value "EMAIL"))
 	   ("email" . ,(org-macro--find-keyword-value "EMAIL"))
 	   ("title" . ,(org-macro--find-keyword-value "TITLE" t))
 	   ("title" . ,(org-macro--find-keyword-value "TITLE" t))
 	   ("date" . ,(org-macro--find-date)))))
 	   ("date" . ,(org-macro--find-date)))))

+ 9 - 0
testing/lisp/test-org-macro.el

@@ -314,6 +314,15 @@
 	    (org-macro-replace-all org-macro-templates)
 	    (org-macro-replace-all org-macro-templates)
 	    (buffer-substring-no-properties
 	    (buffer-substring-no-properties
 	     (line-beginning-position) (point-max)))))
 	     (line-beginning-position) (point-max)))))
+  ;; Return AUTHOR keyword value.
+  (should
+   (equal "author 1 author 2"
+	  (org-test-with-temp-text
+              "#+author: author 1\n#+author: author 2\n<point>{{{author}}}"
+	    (org-macro-initialize-templates)
+	    (org-macro-replace-all org-macro-templates)
+	    (buffer-substring-no-properties
+	     (line-beginning-position) (point-max)))))
   ;; When AUTHOR keyword is missing, return the empty string.
   ;; When AUTHOR keyword is missing, return the empty string.
   (should
   (should
    (equal ""
    (equal ""