浏览代码

Merge branch 'maint'

Kyle Meyer 4 年之前
父节点
当前提交
edda21e931
共有 3 个文件被更改,包括 19 次插入6 次删除
  1. 1 1
      lisp/org-footnote.el
  2. 4 4
      testing/lisp/test-org-archive.el
  3. 14 1
      testing/lisp/test-org-footnote.el

+ 1 - 1
lisp/org-footnote.el

@@ -704,7 +704,7 @@ function doesn't move point."
 	   (concat "^\\*+[ \t]+" (regexp-quote org-footnote-section) "[ \t]*$")
 	   nil t))
 	(goto-char (match-end 0))
-	(forward-line)
+        (org-end-of-meta-data t)
 	(unless (bolp) (insert "\n")))
        (t (org-footnote--clear-footnote-section)))
       (when (zerop (org-back-over-empty-lines)) (insert "\n"))

+ 4 - 4
testing/lisp/test-org-archive.el

@@ -63,7 +63,7 @@
     ;; Test in buffer target with no additional subheadings...
     (should
      (string-match-p
-      (regexp-quote "*** 2020-07-05 Sunday\n**** a")
+      (regexp-quote (format-time-string "*** 2020-07-05 %A\n**** a"))
       (org-test-with-temp-text-in-file "* a\n"
 	(let ((org-archive-location "::datetree/"))
 	  (org-archive-subtree)
@@ -71,7 +71,7 @@
     ;; ... and with `org-odd-levels-only' non-nil.
     (should
      (string-match-p
-      (regexp-quote "***** 2020-07-05 Sunday\n******* a")
+      (regexp-quote (format-time-string "***** 2020-07-05 %A\n******* a"))
       (org-test-with-temp-text-in-file "* a\n"
 	(let ((org-archive-location "::datetree/")
 	      (org-odd-levels-only t))
@@ -80,7 +80,7 @@
     ;; Test in buffer target with an additional subheading...
     (should
      (string-match-p
-      (regexp-quote "*** 2020-07-05 Sunday\n**** a\n***** b")
+      (regexp-quote (format-time-string "*** 2020-07-05 %A\n**** a\n***** b"))
       (org-test-with-temp-text-in-file "* b\n"
 	(let ((org-archive-location "::datetree/* a"))
 	  (org-archive-subtree)
@@ -88,7 +88,7 @@
     ;; ... and with `org-odd-levels-only' non-nil.
     (should
      (string-match-p
-      (regexp-quote "***** 2020-07-05 Sunday\n******* a\n********* b")
+      (regexp-quote (format-time-string "***** 2020-07-05 %A\n******* a\n********* b"))
       (org-test-with-temp-text-in-file "* b\n"
 	(let ((org-archive-location "::datetree/* a")
 	      (org-odd-levels-only t))

+ 14 - 1
testing/lisp/test-org-footnote.el

@@ -138,7 +138,20 @@
 	  (org-test-with-temp-text
 	      "Paragraph<point>\n# Local Variables:\n# foo: t\n# End:"
 	    (let ((org-footnote-section "Footnotes")) (org-footnote-new))
-	    (buffer-string)))))
+	    (buffer-string))))
+  (should
+   (equal "Para[fn:1]
+* Footnotes
+:properties:
+:custom_id: id
+:end:
+
+\[fn:1]"
+          (org-test-with-temp-text
+              "Para<point>\n* Footnotes\n:properties:\n:custom_id: id\n:end:"
+            (let ((org-footnote-section "Footnotes"))
+              (org-footnote-new))
+            (org-trim (buffer-string))))))
 
 (ert-deftest test-org-footnote/delete ()
   "Test `org-footnote-delete' specifications."