|
From: | Jonathan Leech-Pepin |
Subject: | [O] Programatic validation of code blocks for subsequent execution without prompting |
Date: | Wed, 15 Oct 2014 11:00:40 -0400 |
(defvar my/babel-hashes 'nil)
(defun my/babel-hashed-confirm (lang body)
(let ((check (list lang (md5 body))))
;; If not hashed, prompt
(if (not (member (list lang (md5 body)) my/babel-hashes))
;; Ask if you want to hash
(if (yes-or-no-p "Store hash for block? ")
;; Hash is added, proceed with evaluation
(progn
(add-to-list 'my/babel-hashes check)
'nil)
;; Return 't to prompt for evaluation
't))))
(setq org-confirm-babel-evaluate 'my/babel-hashed-confirm)
[Prev in Thread] | Current Thread | [Next in Thread] |