emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH][BUG] org-babel-confirm-evaluate
@ 2015-11-07  0:11 Charles C. Berry
  2015-11-07 10:48 ` Aaron Ecay
  0 siblings, 1 reply; 4+ messages in thread
From: Charles C. Berry @ 2015-11-07  0:11 UTC (permalink / raw)
  To: Org-Mode mailing list, aaronecay

[-- Attachment #1: Type: text/plain, Size: 409 bytes --]


Seems like this commit

   commit 40356ae3765d123fd9950a961718530219fa5cb8
   Author: Aaron Ecay <aaronecay@gmail.com>
   Date:   Thu Nov 5 15:51:06 2015 +0000

broke Babel. At least I cannot get C-c C-c to execute sec blocks when I 
respond 'y' to queries.

I think this patch fixes it (and some typos), but I hesitate to push it in 
case there is something I am not seeing about the recent changes.

Chuck

[-- Attachment #2: confirm-eval patch --]
[-- Type: text/plain, Size: 1597 bytes --]

From 35edc2835bea76f494df9c42d3d7927d4a10bbd0 Mon Sep 17 00:00:00 2001
From: Charles Berry <ccberry@ucsd.edu>
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)


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-11-07 21:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-07  0:11 [PATCH][BUG] org-babel-confirm-evaluate Charles C. Berry
2015-11-07 10:48 ` Aaron Ecay
2015-11-07 18:13   ` Charles C. Berry
2015-11-07 21:36     ` Aaron Ecay

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).