From 64bfa2d931c6370eb114cddf4b2815813f65de70 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Sat, 26 Aug 2017 10:32:26 +0200 Subject: [PATCH] Remove `inline-only' option for `org-export-use-babel' * lisp/ob-exp.el (org-export-use-babel): Remove `inline-only' option. (org-babel-exp-process-buffer): Ignore `inline-only' value. * doc/org.texi (Exporting code blocks): Remove documentation. * testing/lisp/test-ob-exp.el (ob-export/babel-evaluate): Remove tests. --- doc/org.texi | 6 ------ etc/ORG-NEWS | 4 ++++ lisp/ob-exp.el | 12 ++++-------- testing/lisp/test-ob-exp.el | 17 ----------------- 4 files changed, 8 insertions(+), 31 deletions(-) diff --git a/doc/org.texi b/doc/org.texi index c391c8a9d..18714625c 100644 --- a/doc/org.texi +++ b/doc/org.texi @@ -15346,12 +15346,6 @@ during export, to allow evaluation of just the header arguments but not any code evaluation in the source block, set @code{:eval never-export} (@pxref{eval}). -To evaluate just the inline code blocks, set @code{org-export-babel-evaluate} -to @code{inline-only}. Isolating the option to allow inline evaluations -separate from @samp{src} code block evaluations during exports is not for -security but for avoiding any delays due to recalculations, such as calls to -a remote database. - Org never evaluates code blocks in commented sub-trees when exporting (@pxref{Comment lines}). On the other hand, Org does evaluate code blocks in sub-trees excluded from export (@pxref{Export settings}). diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS index 1901c2954..9f3e62406 100644 --- a/etc/ORG-NEWS +++ b/etc/ORG-NEWS @@ -405,6 +405,10 @@ equivalent to the removed format string. Setting it to a ~nil~ value broke some other features (e.g., speed keys). +*** ~org-export-use-babel~ cannot be set to ~inline-only~ + +The variable is now a boolean. + *** ~org-texinfo-def-table-markup~ is obsolete Use ~org-texinfo-table-default-markup~ instead. diff --git a/lisp/ob-exp.el b/lisp/ob-exp.el index d966cd913..8da4d5cea 100644 --- a/lisp/ob-exp.el +++ b/lisp/ob-exp.el @@ -41,14 +41,12 @@ (defcustom org-export-use-babel t "Switch controlling code evaluation and header processing during export. When set to nil no code will be evaluated as part of the export -process and no header arguments will be obeyed. When set to -`inline-only', only inline code blocks will be executed. Users -who wish to avoid evaluating code on export should use the header -argument `:eval never-export'." +process and no header arguments will be obeyed. Users who wish +to avoid evaluating code on export should use the header argument +`:eval never-export'." :group 'org-babel :version "24.1" :type '(choice (const :tag "Never" nil) - (const :tag "Only inline code" inline-only) (const :tag "Always" t)) :safe #'null) @@ -132,9 +130,7 @@ this template." (when org-export-use-babel (save-window-excursion (let ((case-fold-search t) - (regexp (if (eq org-export-use-babel 'inline-only) - "\\(call\\|src\\)_" - "\\(call\\|src\\)_\\|^[ \t]*#\\+\\(BEGIN_SRC\\|CALL:\\)")) + (regexp "\\(call\\|src\\)_\\|^[ \t]*#\\+\\(BEGIN_SRC\\|CALL:\\)") ;; Get a pristine copy of current buffer so Babel ;; references are properly resolved and source block ;; context is preserved. diff --git a/testing/lisp/test-ob-exp.el b/testing/lisp/test-ob-exp.el index 7f375efe7..fc67c4f8e 100644 --- a/testing/lisp/test-ob-exp.el +++ b/testing/lisp/test-ob-exp.el @@ -546,23 +546,6 @@ src_emacs-lisp{(+ 1 1)}" (org-test-with-temp-text "src_emacs-lisp{(+ 1 1)}" (let ((org-export-use-babel t)) (org-babel-exp-process-buffer)) - (buffer-string)))) - ;; When set to `inline-only' limit evaluation to inline code. - (should-not - (string-match-p - "2" - (org-test-with-temp-text - "#+BEGIN_SRC emacs-lisp :exports results\n(+ 1 1)\n#+END_SRC" - (let ((org-export-use-babel 'inline-only)) - (org-babel-exp-process-buffer)) - (buffer-string)))) - (should - (string-match-p - "2" - (org-test-with-temp-text - "src_emacs-lisp{(+ 1 1)}" - (let ((org-export-use-babel 'inline-only)) - (org-babel-exp-process-buffer)) (buffer-string))))) (ert-deftest ob-export/body-with-coderef ()