浏览代码

Remove `org-babel-in-example-or-verbatim'

* lisp/ob-exp.el (org-babel-in-example-or-verbatim): Remove function.

* testing/lisp/test-ob.el (test-ob/combining-scalar-and-raw-result-types):
Update test.

This function is unused and inaccurate.  If needed, the parser should be
used instead.
Nicolas Goaziou 9 年之前
父节点
当前提交
33aeec4a61
共有 3 个文件被更改,包括 3 次插入17 次删除
  1. 0 14
      lisp/ob-exp.el
  2. 0 1
      lisp/ob-lob.el
  3. 3 2
      testing/lisp/test-ob.el

+ 0 - 14
lisp/ob-exp.el

@@ -30,7 +30,6 @@
 
 (defvar org-babel-lob-one-liner-regexp)
 (defvar org-babel-ref-split-regexp)
-(defvar org-list-forbidden-blocks)
 
 (declare-function org-babel-lob-get-info "ob-lob" (&optional datum))
 (declare-function org-babel-eval-wipe-error-buffer "ob-eval" ())
@@ -301,19 +300,6 @@ may make them unreachable."
 	      (set-marker begin nil)
 	      (set-marker end nil))))))))
 
-(defun org-babel-in-example-or-verbatim ()
-  "Return true if point is in example or verbatim code.
-Example and verbatim code include escaped portions of
-an org-mode buffer code that should be treated as normal
-org-mode text."
-  (or (save-match-data
-	(save-excursion
-	  (goto-char (point-at-bol))
-	  (looking-at "[ \t]*:[ \t]")))
-      (org-in-verbatim-emphasis)
-      (org-in-block-p org-list-forbidden-blocks)
-      (org-between-regexps-p "^[ \t]*#\\+begin_src" "^[ \t]*#\\+end_src")))
-
 (defun org-babel-exp-do-export (info type &optional hash)
   "Return a string with the exported content of a code block.
 The function respects the value of the :exports header argument."

+ 0 - 1
lisp/ob-lob.el

@@ -28,7 +28,6 @@
 (require 'ob-core)
 (require 'ob-table)
 
-(declare-function org-babel-in-example-or-verbatim "ob-exp" nil)
 (declare-function org-element-context "org-element" (&optional element))
 (declare-function org-element-property "org-element" (property element))
 (declare-function org-element-type "org-element" (element))

+ 3 - 2
testing/lisp/test-ob.el

@@ -502,9 +502,10 @@ echo \"[[file:./cv.cls]]\"
 			(forward-line 1)))
       (goto-char (point-min))
       (next-result)
-      (should (org-babel-in-example-or-verbatim))
+      (should (eq (org-element-type (org-element-at-point)) 'fixed-width))
       (next-result)
-      (should (not (org-babel-in-example-or-verbatim))))))
+      (should-not
+       (eq (org-element-type (org-element-at-point)) 'fixed-width)))))
 
 (ert-deftest test-ob/no-defaut-value-for-var ()
   "Test that the absence of a default value for a variable DOES THROW