Browse Source

ob-core: Insert lowercase results

* lisp/ob-core.el (org-babel-insert-result): Insert lower case blocks
  and drawers.

* testing/lisp/test-ob.el (test-ob/org-babel-remove-result--results-wrap):
(test-ob/org-babel-remove-result--results-org):
(test-ob/org-babel-remove-result--results-html):
(test-ob/org-babel-remove-result--results-latex):
(test-ob/org-babel-remove-result--results-code): Update tests.
Nicolas Goaziou 2 years ago
parent
commit
fc5abc2d55
2 changed files with 19 additions and 19 deletions
  1. 9 9
      lisp/ob-core.el
  2. 10 10
      testing/lisp/test-ob.el

+ 9 - 9
lisp/ob-core.el

@@ -2353,24 +2353,24 @@ INFO may provide the values of these header arguments (in the
 		  ;; possibly wrap result
 		  (cond
 		   ((assq :wrap (nth 2 info))
-		    (let ((name (or (cdr (assq :wrap (nth 2 info))) "RESULTS")))
-		      (funcall wrap (concat "#+BEGIN_" name)
-			       (concat "#+END_" (car (split-string name)))
+		    (let ((name (or (cdr (assq :wrap (nth 2 info))) "results")))
+		      (funcall wrap (concat "#+begin_" name)
+			       (concat "#+end_" (car (split-string name)))
 			       nil nil (concat "{{{results(@@" name ":") "@@)}}}")))
 		   ((member "html" result-params)
-		    (funcall wrap "#+BEGIN_EXPORT html" "#+END_EXPORT" nil nil
+		    (funcall wrap "#+begin_export html" "#+end_export" nil nil
 			     "{{{results(@@html:" "@@)}}}"))
 		   ((member "latex" result-params)
-		    (funcall wrap "#+BEGIN_EXPORT latex" "#+END_EXPORT" nil nil
+		    (funcall wrap "#+begin_export latex" "#+end_export" nil nil
 			     "{{{results(@@latex:" "@@)}}}"))
 		   ((member "org" result-params)
 		    (goto-char beg) (when (org-at-table-p) (org-cycle))
-		    (funcall wrap "#+BEGIN_SRC org" "#+END_SRC" nil nil
+		    (funcall wrap "#+begin_src org" "#+end_src" nil nil
 			     "{{{results(src_org{" "})}}}"))
 		   ((member "code" result-params)
 		    (let ((lang (or lang "none")))
-		      (funcall wrap (format "#+BEGIN_SRC %s%s" lang results-switches)
-			       "#+END_SRC" nil nil
+		      (funcall wrap (format "#+begin_src %s%s" lang results-switches)
+			       "#+end_src" nil nil
 			       (format "{{{results(src_%s[%s]{" lang results-switches)
 			       "})}}}")))
 		   ((member "raw" result-params)
@@ -2379,7 +2379,7 @@ INFO may provide the values of these header arguments (in the
 			;; Stay backward compatible with <7.9.2
 			(member "wrap" result-params))
 		    (goto-char beg) (when (org-at-table-p) (org-cycle))
-		    (funcall wrap ":RESULTS:" ":END:" 'no-escape nil
+		    (funcall wrap ":results:" ":end:" 'no-escape nil
 			     "{{{results(" ")}}}"))
 		   ((and inline (member "file" result-params))
 		    (funcall wrap nil nil nil nil "{{{results(" ")}}}"))

+ 10 - 10
testing/lisp/test-ob.el

@@ -1003,9 +1003,9 @@ replacement happens correctly."
 (ert-deftest test-ob/org-babel-remove-result--results-wrap ()
   "Test `org-babel-remove-result' with :results wrap."
   (test-ob-verify-result-and-removed-result
-   ":RESULTS:
+   ":results:
 hello there
-:END:"
+:end:"
 
    "* org-babel-remove-result
 
@@ -1018,11 +1018,11 @@ hello there
 (ert-deftest test-ob/org-babel-remove-result--results-org ()
   "Test `org-babel-remove-result' with :results org."
   (test-ob-verify-result-and-removed-result
-   "#+BEGIN_SRC org
+   "#+begin_src org
 ,* heading
 ,** subheading
 content
-#+END_SRC"
+#+end_src"
 
    "* org-babel-remove-result
 #+begin_src emacs-lisp :results org
@@ -1036,9 +1036,9 @@ content\"
 (ert-deftest test-ob/org-babel-remove-result--results-html ()
   "Test `org-babel-remove-result' with :results html."
   (test-ob-verify-result-and-removed-result
-   "#+BEGIN_EXPORT html
+   "#+begin_export html
 <head><body></body></head>
-#+END_EXPORT"
+#+end_export"
 
    "* org-babel-remove-result
 #+begin_src emacs-lisp :results html
@@ -1050,11 +1050,11 @@ content\"
 (ert-deftest test-ob/org-babel-remove-result--results-latex ()
   "Test `org-babel-remove-result' with :results latex."
   (test-ob-verify-result-and-removed-result
-   "#+BEGIN_EXPORT latex
+   "#+begin_export latex
 Line 1
 Line 2
 Line 3
-#+END_EXPORT"
+#+end_export"
 
    "* org-babel-remove-result
 #+begin_src emacs-lisp :results latex
@@ -1069,9 +1069,9 @@ Line 3\"
   "Test `org-babel-remove-result' with :results code."
 
   (test-ob-verify-result-and-removed-result
-   "#+BEGIN_SRC emacs-lisp
+   "#+begin_src emacs-lisp
 \"I am working!\"
-#+END_SRC"
+#+end_src"
 
    "* org-babel-remove-result
 #+begin_src emacs-lisp :results code