From bcfa3b95c7bb1c0f5fc58a6be4c44f5d3746bbc8 Mon Sep 17 00:00:00 2001 From: Dan Davison Date: Sat, 18 Jul 2009 17:47:30 -0400 Subject: [PATCH] Add ability to remove #+begin_example blocks of output. --- lisp/org-babel.el | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lisp/org-babel.el b/lisp/org-babel.el index ba6fb831..e991731e 100644 --- a/lisp/org-babel.el +++ b/lisp/org-babel.el @@ -451,11 +451,15 @@ relies on `org-babel-insert-result'." (save-excursion (if (org-at-table-p) (org-table-end) - (while (if (looking-at "\\(: \\|\\[\\[\\)") - (progn (while (looking-at "\\(: \\|\\[\\[\\)") - (forward-line 1)) t)) - (forward-line 1)) - (forward-line -1) + (let ((case-fold-search nil)) + (if (looking-at-p "#\\+begin_example") + (search-forward "#+end_example" nil t) + (progn + (while (if (looking-at "\\(: \\|\\[\\[\\)") + (progn (while (looking-at "\\(: \\|\\[\\[\\)") + (forward-line 1)) t)) + (forward-line 1)) + (forward-line -1)))) (point)))) (defun org-babel-result-to-file (result) -- 2.11.4.GIT