From 35edc2835bea76f494df9c42d3d7927d4a10bbd0 Mon Sep 17 00:00:00 2001 From: Charles Berry Date: Fri, 6 Nov 2015 16:00:50 -0800 Subject: [PATCH] ob-core.el: org-babel-confirm-evaluate bugfix * lisp/ob-core.el (org-babel-confirm-evaluate): Return t/nil for y/n answer to query. Minor edits of prompt and message. --- lisp/ob-core.el | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/lisp/ob-core.el b/lisp/ob-core.el index 739bbcd..53aa1f5 100644 --- a/lisp/ob-core.el +++ b/lisp/ob-core.el @@ -344,15 +344,17 @@ environment, to override this check." (pcase evalp (`nil nil) (`t t) - (`query (unless - (and (not (org-bound-and-true-p - org-babel-confirm-evaluate-answer-no)) - (yes-or-no-p - (format "Evaluate this %s code block%son your system? " - lang name-string))) - (message "Evaluation of this %s code-block%sis aborted." - lang name-string))) - (x (error "Unexepcted value `%s' from `org-babel-check-confirm-evaluate'" x))))) + (`query (or + (and (not (org-bound-and-true-p + org-babel-confirm-evaluate-answer-no)) + (yes-or-no-p + (format "Evaluate this %s code block%s on your system? " + lang name-string))) + (and + (message "Evaluation of this %s code-block%s is aborted." + lang name-string) + nil))) + (x (error "Unexpected value `%s' from `org-babel-check-confirm-evaluate'" x))))) ;;;###autoload (defun org-babel-execute-safely-maybe () -- 2.4.9 (Apple Git-60)