diff options
author | Charles Berry <ccberry@ucsd.edu> | 2015-11-06 16:00:50 -0800 |
---|---|---|
committer | Charles Berry <ccberry@ucsd.edu> | 2015-11-07 09:39:17 -0800 |
commit | 3f6e71e62e558f4a1c4316c9ecf0519a905e87f3 (patch) | |
tree | 503f3ed10bcf215d86ddf049a9fd12a85904cab4 | |
parent | d24a9b7645be426a443f20009265f668e175c70d (diff) | |
download | org-mode-3f6e71e62e558f4a1c4316c9ecf0519a905e87f3.tar.gz |
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.
-rw-r--r-- | lisp/ob-core.el | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/lisp/ob-core.el b/lisp/ob-core.el index e2ad46b..b8ea12d 100644 --- a/lisp/ob-core.el +++ b/lisp/ob-core.el @@ -340,19 +340,21 @@ environment, to override this check." (let* ((evalp (org-babel-check-confirm-evaluate info)) (lang (nth 0 info)) (name (nth 4 info)) - (name-string (if name (format " (%s) " name) ""))) + (name-string (if name (format " (%s) " name) " "))) (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))) + (`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%son your system? " + lang name-string))) + (progn (message "Evaluation of this %s code-block%sis aborted." - lang name-string))) - (x (error "Unexepcted value `%s' from `org-babel-check-confirm-evaluate'" x))))) + lang name-string) + nil))) + (x (error "Unexpected value `%s' from `org-babel-check-confirm-evaluate'" x))))) ;;;###autoload (defun org-babel-execute-safely-maybe () |