소스 검색

call lines are more careful about being in example or verbatim blocks

* lisp/ob-lob.el (org-babel-lob-execute-maybe): Don't execute a call
  inside a verbatim block.
* lisp/ob-exp.el (org-babel-in-example-or-verbatim): Check for example
  blocks.
Eric Schulte 14 년 전
부모
커밋
a4273cbe0e
2개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 0
      lisp/ob-exp.el
  2. 3 1
      lisp/ob-lob.el

+ 1 - 0
lisp/ob-exp.el

@@ -172,6 +172,7 @@ org-mode text."
 	  (goto-char (point-at-bol))
 	  (goto-char (point-at-bol))
 	  (looking-at "[ \t]*:[ \t]")))
 	  (looking-at "[ \t]*:[ \t]")))
       (org-in-verbatim-emphasis)
       (org-in-verbatim-emphasis)
+      (org-in-block-p org-list-forbidden-blocks)
       (org-between-regexps-p "^[ \t]*#\\+begin_src" "^[ \t]*#\\+end_src")))
       (org-between-regexps-p "^[ \t]*#\\+begin_src" "^[ \t]*#\\+end_src")))
 
 
 (defvar org-babel-default-lob-header-args)
 (defvar org-babel-default-lob-header-args)

+ 3 - 1
lisp/ob-lob.el

@@ -95,7 +95,9 @@ Detect if this is context for a Library Of Babel source block and
 if so then run the appropriate source block from the Library."
 if so then run the appropriate source block from the Library."
   (interactive)
   (interactive)
   (let ((info (org-babel-lob-get-info)))
   (let ((info (org-babel-lob-get-info)))
-    (if (nth 0 info) (progn (org-babel-lob-execute info) t) nil)))
+    (if (and (nth 0 info) (not (org-babel-in-example-or-verbatim)))
+	(progn (org-babel-lob-execute info) t)
+      nil)))
 
 
 ;;;###autoload
 ;;;###autoload
 (defun org-babel-lob-get-info ()
 (defun org-babel-lob-get-info ()