浏览代码

Add ability to remove #+begin_example blocks of output.

Dan Davison 16 年之前
父节点
当前提交
bcfa3b95c7
共有 1 个文件被更改,包括 9 次插入5 次删除
  1. 9 5
      lisp/org-babel.el

+ 9 - 5
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)