Achim Gratz <strom...@nexgo.de> writes: > I'm still waiting for feedback from Karl Voit over in the other thread, > but here's the amended patch for you to review:
Thanks. I haven't much to say wrt to the internals since the only thing needed to make use of this patch is to set `org-babel--suppress-confirm-evaluate-answer-no' to t from `org-export-async-start'. I would suggest a shorter variable name, though, as: °org-babel--no-confirm-force-no'. But that doesn't really matter. I'll just focus on cosmetics. > * lisp/ob-core.el (org-babel-confirm-evaluate): Refactor this internal > function. You should mention explicitly that you removed this function. This is not a refactoring. > -;;; ob-core.el --- working with code blocks in org-mode > +;; ob-core.el --- working with code blocks in org-mode You should leave 3 semicolons. This is standard elisp library starter. > +(defmacro org-babel--check-confirm-evaluate (info &rest body) > + "Pull some information from code block INFO and evaluate BODY. > +" Spurious blank line. > +(defun org-babel--check-evaluate (info) > + "Check whether the code block INFO should be evaluated. > +" Ditto. > + (org-babel--check-confirm-evaluate info > + (if (or (equal eval "never") (equal eval "no") > + (and (boundp 'org-current-export-file) org-current-export-file > + (or (equal eval "no-export") (equal eval "never-export")))) > + (prog1 nil (message (format "Evaluation of this%scode block%sis > disabled." > + code-block block-name))) > + t))) I would refactor it like the following: (org-babel--check-confirm-evaluate info (or (equal eval "never") (equal eval "no") (and (org-bound-and-true-p org-current-export-file) (or (equal eval "no-export") (equal eval "never-export"))) (prog1 nil (message (format "Evaluation of this%scode block%sis disabled." code-block block-name))))) > + (org-babel--check-confirm-evaluate info > + (let* ((query (cond ((equal eval "query") t) > + ((and (boundp 'org-current-export-file) > org-current-export-file (org-bound-and-true-p org-current-export-file) > + (if (and query > + (or (null org-babel--suppress-confirm-evaluate-answer-no) > + (not (yes-or-no-p > + (format "Evaluate this%scode block%son your system? " > + code-block block-name))))) > + (prog1 nil (message > + (format "Evaluation of%scode-block%snot confirmed." > + code-block block-name))) > + t)))) (and query (or (not org-babel--suppress-confirm-evaluate-answer-no) (not (yes-or-no-p (format "Evaluate this%scode block%son your system? " code-block block-name))) (prog1 nil (message (format "Evaluation of%scode-block%snot confirmed." code-block block-name))))) > + (if (boundp 'org-babel-call-process-region-original) > + org-babel-call-process-region-original > + (symbol-function 'call-process-region))) (or (org-bound-and-true-p org-babel-call-process-region-original) (symbol-function 'call-process-region)) [...] > + (org-babel-insert-result > + result result-params info new-hash indent lang) > + (run-hooks 'org-babel-after-execute-hook) > + result > + ))) Dangling parens. Regards, -- Nicolas Goaziou