File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,13 @@ If nil (default), auto-tangle will only happen on buffers with
56
56
the `#+auto_tangle: t' keyword. If t, auto-tangle will happen on
57
57
all Org buffers unless `#+auto_tangle: nil' is set." )
58
58
59
+ (defvar org-auto-tangle-babel-safelist '()
60
+ " List of full path of files for which code blocks need to be evaluated.
61
+
62
+ By default, code blocks are not evaluated during the auto-tangle to avoid
63
+ possible code execution from unstrusted source. To enable code blocks evaluation
64
+ for a specific file, add its full path to this list." )
65
+
59
66
(defun org-auto-tangle-find-value (buffer )
60
67
" Search the `auto_tangle' property in BUFFER and extracts it when found."
61
68
(with-current-buffer buffer
@@ -74,7 +81,8 @@ all Org buffers unless `#+auto_tangle: nil' is set.")
74
81
`(lambda ()
75
82
(require 'org )
76
83
(let ((start-time (current-time ))
77
- (non-essential t ))
84
+ (non-essential t )
85
+ (org-confirm-babel-evaluate (not (member , file ', org-auto-tangle-babel-safelist ))))
78
86
(apply #'org-babel-tangle-file ', args )
79
87
(format " %. 2f" (float-time (time-since start-time))))))
80
88
(let ((message-string (format " Tangling %S completed after " file)))
You can’t perform that action at this time.
0 commit comments