Browse Source

Update tests and comments for new snippet syntax

* contrib/lisp/org-export.el (org-export-snippet-translation-alist):
  Fix docstring.
(org-export-as): Fix code comment.
* testing/lisp/test-org-element.el: Update tests.
* testing/lisp/test-org-export.el: Update tests.
Nicolas Goaziou 13 years ago
parent
commit
ab82a9dcfe
3 changed files with 9 additions and 11 deletions
  1. 5 7
      contrib/lisp/org-export.el
  2. 3 3
      testing/lisp/test-org-element.el
  3. 1 1
      testing/lisp/test-org-export.el

+ 5 - 7
contrib/lisp/org-export.el

@@ -641,9 +641,9 @@ confirm the use of these lines."
 
 This variable allows to provide shortcuts for export snippets.
 
-For example, with a value of '\(\(\"h\" . \"html\"\)\), the HTML
-back-end will recognize the contents of \"@h{<b>}\" as HTML code
-while every other back-end will ignore it."
+For example, with a value of '\(\(\"h\" . \"e-html\"\)\), the
+HTML back-end will recognize the contents of \"@@h:<b>@@\" as
+HTML code while every other back-end will ignore it."
   :group 'org-export-general
   :type '(repeat
 	  (cons
@@ -2320,10 +2320,8 @@ Return code as a string."
 	     (goto-char (point-min))
 	     (forward-line)
 	     (narrow-to-region (point) (point-max))))
-      ;; 1. Get export environment from original buffer.  Store
-      ;;    original footnotes definitions in communication channel as
-      ;;    they might not be accessible anymore in a narrowed parse
-      ;;    tree.  Also install user's and developer's filters.
+      ;; 1. Get export environment from original buffer.  Also install
+      ;;    user's and developer's filters.
       (let ((info (org-export-install-filters
 		   (org-export-get-environment backend subtreep ext-plist)))
 	    ;; 2. Get parse tree.  Buffer isn't parsed directly.

+ 3 - 3
testing/lisp/test-org-element.el

@@ -470,7 +470,7 @@ CLOCK: [2012-01-01 sun. 00:01]--[2012-01-01 sun. 00:02] =>  0:01"
   (should
    (equal
     '("back-end" . "contents")
-    (org-test-with-temp-text "<back-end@contents>"
+    (org-test-with-temp-text "@@back-end:contents@@"
       (org-element-map
        (org-element-parse-buffer) 'export-snippet
        (lambda (snippet) (cons (org-element-property :back-end snippet)
@@ -1758,8 +1758,8 @@ CLOSED: <2012-01-01> DEADLINE: <2012-01-01> SCHEDULED: <2012-01-01>\n"))))
 
 (ert-deftest test-org-element/export-snippet-interpreter ()
   "Test export snippet interpreter."
-  (should (equal (org-test-parse-and-interpret "<back-end@contents>")
-		 "<back-end@contents>\n")))
+  (should (equal (org-test-parse-and-interpret "@@back-end:contents@@")
+		 "@@back-end:contents@@\n")))
 
 (ert-deftest test-org-element/footnote-reference-interpreter ()
   "Test footnote reference interpreter."

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

@@ -295,7 +295,7 @@ Paragraph"
 
 (ert-deftest test-org-export/export-snippet ()
   "Test export snippets transcoding."
-  (org-test-with-temp-text "<test@A><t@B>"
+  (org-test-with-temp-text "@@test:A@@@@t:B@@"
     (org-test-with-backend test
       (flet ((org-test-export-snippet
 	      (snippet contents info)