emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Charles C. Berry" <ccberry@ucsd.edu>
To: Org-Mode mailing list <emacs-orgmode@gnu.org>, aaronecay@gmail.com
Subject: [PATCH][BUG] org-babel-confirm-evaluate
Date: Fri, 6 Nov 2015 16:11:05 -0800	[thread overview]
Message-ID: <alpine.OSX.2.20.1511061604510.2161@charles-berrys-macbook.local> (raw)

[-- 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)


             reply	other threads:[~2015-11-07  0:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-07  0:11 Charles C. Berry [this message]
2015-11-07 10:48 ` [PATCH][BUG] org-babel-confirm-evaluate Aaron Ecay
2015-11-07 18:13   ` Charles C. Berry
2015-11-07 21:36     ` Aaron Ecay

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.OSX.2.20.1511061604510.2161@charles-berrys-macbook.local \
    --to=ccberry@ucsd.edu \
    --cc=aaronecay@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).