summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <n.goaziou@gmail.com>2014-01-20 17:16:32 +0100
committerNicolas Goaziou <n.goaziou@gmail.com>2014-01-20 17:16:32 +0100
commite5617b88cbe420b706548ca058e0a5c64f15bcd3 (patch)
treeef7ba306dc0bb4394a9f325bde01e823b7af5c0e
parent80fc5adb58c13297214799cc924c294b771169f9 (diff)
parentdde6af3a6230b37aabfb4f75c2dee89433958375 (diff)
downloadorg-mode-e5617b88cbe420b706548ca058e0a5c64f15bcd3.tar.gz
Merge branch 'maint'
-rw-r--r--lisp/ob-exp.el3
-rw-r--r--testing/lisp/test-ob-exp.el9
2 files changed, 11 insertions, 1 deletions
diff --git a/lisp/ob-exp.el b/lisp/ob-exp.el
index a5cca87..509a6d8 100644
--- a/lisp/ob-exp.el
+++ b/lisp/ob-exp.el
@@ -343,11 +343,12 @@ replaced with its value."
org-babel-exp-code-template
`(("lang" . ,(nth 0 info))
("body" . ,(org-escape-code-in-string (nth 1 info)))
+ ("flags" . ,(let ((f (assq :flags (nth 2 info))))
+ (when f (concat " " (cdr f)))))
,@(mapcar (lambda (pair)
(cons (substring (symbol-name (car pair)) 1)
(format "%S" (cdr pair))))
(nth 2 info))
- ("flags" . ,(let ((f (nth 3 info))) (when f (concat " " f))))
("name" . ,(or (nth 4 info) "")))))
(defun org-babel-exp-results (info type &optional silent hash)
diff --git a/testing/lisp/test-ob-exp.el b/testing/lisp/test-ob-exp.el
index 2f5342b..33585e4 100644
--- a/testing/lisp/test-ob-exp.el
+++ b/testing/lisp/test-ob-exp.el
@@ -303,6 +303,15 @@ Here is one at the end of a line. =2=
(org-export-execute-babel-code)
(buffer-string)))))
+(ert-deftest ob-export/export-src-block-with-flags ()
+ "Test exporting a source block with a flag."
+ (should
+ (string-match "\\`#\\+BEGIN_SRC emacs-lisp -some-flag$"
+ (org-test-with-temp-text
+ "#+BEGIN_SRC emacs-lisp :flags -some-flag\n\(+ 1 1)\n#+END_SRC"
+ (org-export-execute-babel-code)
+ (buffer-string)))))
+
(provide 'test-ob-exp)
;;; test-ob-exp.el ends here