summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2017-12-10 23:05:32 +0100
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2017-12-10 23:05:32 +0100
commitfc5abc2d55fc357a0055d22c569c8b57e3d574df (patch)
treed3ad6583580aeece947cb9c21aa88bdd8b44846e
parenta34431f6ea57a361020660f83fcbcc41c81dc4b6 (diff)
downloadorg-mode-fc5abc2d55fc357a0055d22c569c8b57e3d574df.tar.gz
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.
-rw-r--r--lisp/ob-core.el18
-rw-r--r--testing/lisp/test-ob.el20
2 files changed, 19 insertions, 19 deletions
diff --git a/lisp/ob-core.el b/lisp/ob-core.el
index d76f664..fbde08c 100644
--- a/lisp/ob-core.el
+++ b/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(" ")}}}"))
diff --git a/testing/lisp/test-ob.el b/testing/lisp/test-ob.el
index 7035e67..4097ee0 100644
--- a/testing/lisp/test-ob.el
+++ b/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