diff options
author | Eric Schulte <schulte.eric@gmail.com> | 2010-07-06 09:39:07 -0700 |
---|---|---|
committer | Eric Schulte <schulte.eric@gmail.com> | 2010-07-06 09:39:07 -0700 |
commit | 804d08b119e6b883f55b7194a74e9bc1ddf5f4d3 (patch) | |
tree | 15f26ec7ed2d7ddbe562a44e311986dda705ca63 | |
parent | 2cc4c0d564e042ba902d74d264fafdf10ee423c3 (diff) | |
download | org-mode-804d08b119e6b883f55b7194a74e9bc1ddf5f4d3.tar.gz |
babel: don't ask twice for confirmation with :eval query
Thanks to Carsten for the Patch
* lisp/ob.el (org-babel-confirm-evaluate): don't ask twice for
confirmation with :eval query
-rw-r--r-- | lisp/ob.el | 18 |
1 files changed, 8 insertions, 10 deletions
@@ -171,18 +171,16 @@ any confirmation from the user. Note disabling confirmation may result in accidental evaluation of potentially harmful code." - (let ((eval (cdr (assoc :eval (nth 2 info))))) + (let* ((eval (cdr (assoc :eval (nth 2 info)))) + (query (or (equal eval "query") + (and (functionp org-confirm-babel-evaluate) + (funcall org-confirm-babel-evaluate + (nth 0 info) (nth 1 info))) + org-confirm-babel-evaluate))) (when (or (equal eval "never") - (and (equal eval "query") + (and query (not (yes-or-no-p - (format "Evaluate this%scode on your system?" - (if info (format " %s " (nth 0 info)) " "))))) - (and (or (and (functionp org-confirm-babel-evaluate) - (funcall org-confirm-babel-evaluate - (nth 0 info) (nth 1 info))) - org-confirm-babel-evaluate) - (not (yes-or-no-p - (format "Evaluate this%scode on your system?" + (format "Evaluate this%scode on your system? " (if info (format " %s " (nth 0 info)) " ")))))) (error "evaluation aborted")))) |