From 7909cf5e52c2ab244c1b6ea67dada6e8a2eebb20 Mon Sep 17 00:00:00 2001 From: Achim Gratz Date: Wed, 10 Apr 2013 20:28:31 +0200 Subject: [PATCH] Babel: avoid superfluous confirmation for internal wrapper * lisp/ob-exp.el (org-babel-exp-results): Suppress user confirmation of the emacs-lisp wrapper execution around a lob call. * lisp/ob-lob.el (org-babel-lob-execute): Suppress user confirmation of the emacs-lisp wrapper execution around a lob call. --- lisp/ob-exp.el | 3 ++- lisp/ob-lob.el | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lisp/ob-exp.el b/lisp/ob-exp.el index 0d98690..3c70e92 100644 --- a/lisp/ob-exp.el +++ b/lisp/ob-exp.el @@ -411,7 +411,8 @@ (defun org-babel-exp-results (info type &optional silent hash) ((equal type 'lob) (save-excursion (re-search-backward org-babel-lob-one-liner-regexp nil t) - (org-babel-execute-src-block nil info))))))))) + (let (org-confirm-babel-evaluate) + (org-babel-execute-src-block nil info)))))))))) (provide 'ob-exp) diff --git a/lisp/ob-lob.el b/lisp/ob-lob.el index 4c89485..5366989 100644 --- a/lisp/ob-lob.el +++ b/lisp/ob-lob.el @@ -116,6 +116,7 @@ (defun org-babel-lob-get-info () (list (length (if (= (length (match-string 12)) 0) (match-string 2) (match-string 11))))))))) +(defvar org-babel-default-header-args:emacs-lisp) ; dynamic binding from ob-emacs-lisp (defun org-babel-lob-execute (info) "Execute the lob call specified by INFO." (let* ((mkinfo (lambda (p) (list "emacs-lisp" "results" p nil nil (nth 2 info)))) @@ -136,8 +137,10 @@ (defun org-babel-lob-execute (info) (save-excursion (goto-char (org-babel-where-is-src-block-result)) (forward-line 1) (message "%S" (org-babel-read-result))) - (prog1 (org-babel-execute-src-block - nil (funcall mkinfo (org-babel-process-params pre-params))) + (prog1 (let* ((proc-params (org-babel-process-params pre-params)) + org-confirm-babel-evaluate) + (org-babel-execute-src-block + nil (funcall mkinfo proc-params))) ;; update the hash (when new-hash (org-babel-set-current-result-hash new-hash)))))) -- 1.8.2.1