From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Sebastien Vauban" Subject: Re: [babel] Property engine can't be set globally Date: Wed, 26 Oct 2011 14:41:54 +0200 Message-ID: <80lis7rkkt.fsf@somewhere.org> References: <80bot4vy7l.fsf@somewhere.org> <87ehy0ymbs.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: emacs-orgmode-mXXj517/zsQ@public.gmane.org Hi Eric, Eric Schulte wrote: > This is because engine is a ob-sql specific header argument. Language > specific files a supposed to declare the names of their header arguments > so that they may be inherited through variables with names like > `org-babel-header-arg-names:sql'. I've just added such a variable to > ob-sql with "engine" and "out-file" keywords, so this problem should now > be fixed. That works like a charm. Thanks a lot, Seb > "Sebastien Vauban" writes: > >> #+SEQ_TODO: DOESN'T_WORK | WORKS >> #+PROPERTY: eval never >> #+PROPERTY: engine msosql >> #+PROPERTY: cmdline -S -U -P -d -n -w 700 >> #+PROPERTY: results value >> >> * Overview >> >> Some properties, either set at file level or at tree level, still remain >> _invisible_ (unset) to code blocks. >> >> This is at least the case with the =3Dengine=3D property. >> >> * Test suite >> >> The first 2 cases end in an error: >> >> let: Wrong type argument: stringp, nil >> (See [[id:cada6588-de8a-4225-86cf-9ef840e09aa1][Backtrace]]) >> >> The 3^rd one succeeds. >> >> ** DOESN'T_WORK Buffer-wide properties >> >> #+begin_src sql :eval yes >> select getdate() >> go >> #+end_src >> >> Property engine is unknown. >> >> ** DOESN'T_WORK Properties in subtree >> :PROPERTIES: >> :engine: msosql >> :END: >> >> #+begin_src sql :eval yes >> select getdate() >> go >> #+end_src >> >> Property engine is still unknown... >> >> ** WORKS Properties at block level >> >> #+begin_src sql :eval yes :engine msosql >> select getdate() >> go >> #+end_src >> >> #+results: >> | | >> |-------------------------| >> | 2011-10-26 12:25:11.347 | >> | | >> | (1 ligne affect=EF=BC=A6) | >> >> * Backtrace >> :PROPERTIES: >> :ID: cada6588-de8a-4225-86cf-9ef840e09aa1 >> :END: >> >> #+begin_src text >> Debugger entered--Lisp error: (wrong-type-argument stringp nil) >> intern(nil) >> (let ((--cl-var-- (intern engine))) (cond ((member* --cl-var-- (quote (q= uote > msosql))) (format "osql %s -s \" \" -i %s -o %s" (or cmdline "") > (org-babel-process-file-name in-file) (org-babel-process-file-name out-fi= le))) > ((member* --cl-var-- (quote (quote mysql))) (format "mysql %s < %s > %s" = (or > cmdline "") (org-babel-process-file-name in-file) (org-babel-process-file= -name > out-file))) ((member* --cl-var-- (quote (quote postgresql))) (format "psq= l -A > -P footer=3Doff -F \" \" -f %s -o %s %s" (org-babel-process-file-name in-= file) > (org-babel-process-file-name out-file) (or cmdline ""))) (t (error "no su= pport > for the %s sql engine" engine)))) >> (case (intern engine) ((quote msosql) (format "osql %s -s \" \" -i %s -o= %s" > (or cmdline "") (org-babel-process-file-name in-file) > (org-babel-process-file-name out-file))) ((quote mysql) (format "mysql %s= < %s >> %s" (or cmdline "") (org-babel-process-file-name in-file) > (org-babel-process-file-name out-file))) ((quote postgresql) (format "psq= l -A > -P footer=3Doff -F \" \" -f %s -o %s %s" (org-babel-process-file-name in-= file) > (org-babel-process-file-name out-file) (or cmdline ""))) (t (error "no su= pport > for the %s sql engine" engine))) >> (let* ((result-params (cdr (assoc :result-params params))) (cmdline (cdr > (assoc :cmdline params))) (engine (cdr (assoc :engine params))) (in-file > (org-babel-temp-file "sql-in-")) (out-file (or (cdr (assoc :out-file para= ms)) > (org-babel-temp-file "sql-out-"))) (header-delim "") (command (case (inte= rn > engine) ((quote msosql) (format "osql %s -s \" \" -i %s -o %s" (or cmdlin= e "") > (org-babel-process-file-name in-file) (org-babel-process-file-name out-fi= le))) > ((quote mysql) (format "mysql %s < %s > %s" (or cmdline "") > (org-babel-process-file-name in-file) (org-babel-process-file-name out-fi= le))) > ((quote postgresql) (format "psql -A -P footer=3Doff -F \" \" -f %s -o %s= %s" > (org-babel-process-file-name in-file) (org-babel-process-file-name out-fi= le) > (or cmdline ""))) (t (error "no support for the %s sql engine" engine))))) > (with-temp-file in-file (insert (org-babel-expand-body:sql body params))) > (message command) (shell-command command) (if (or (member "scalar" > result-params) (member "verbatim" result-params) (member "html" result-pa= rams) > (member "code" result-params) (equal (point-min) (point-max))) > (with-temp-buffer (progn (insert-file-contents-literally out-file) > (buffer-string))) (with-temp-buffer (with-temp-buffer (insert-file-conten= ts > out-file) (goto-char (point-min)) (when (re-search-forward "^\\(-+\\)[^-]= " nil > t) (setq header-delim (match-string-no-properties 1))) (goto-char (point-= max)) > (forward-char -1) (while (looking-at "\n") (delete-char 1) (goto-char > (point-max)) (forward-char -1)) (write-file out-file)) (org-table-import > out-file (quote (16))) (org-babel-reassemble-table (mapcar (lambda (x) (if > (string=3D ... header-delim) (quote hline) x)) (org-table-to-lisp)) > (org-babel-pick-name (cdr (assoc :colname-names params)) (cdr (assoc :col= names > params))) (org-babel-pick-name (cdr (assoc :rowname-names params)) (cdr (= assoc > :rownames params))))))) >> org-babel-execute:sql("select getdate()\ngo" ((:colname-names) > (:rowname-names) (:result-params "value" "replace") (:result-type . value) > (:comments . "") (:shebang . "") (:cache . "no") (:padline . "") (:noweb . > "no") (:tangle . "no") (:exports . "code") (:results . "value replace") (= :eval > . "yes") (:cmdline . "-S cauchy -U sa -P LpmdlP -d pfi-dev -n -w 700") > (:padnewline . "yes") (:hlines . "no") (:session . "none"))) >> funcall(org-babel-execute:sql "select getdate()\ngo" ((:colname-names) > (:rowname-names) (:result-params "value" "replace") (:result-type . value) > (:comments . "") (:shebang . "") (:cache . "no") (:padline . "") (:noweb . > "no") (:tangle . "no") (:exports . "code") (:results . "value replace") (= :eval > . "yes") (:cmdline . "-S cauchy -U sa -P LpmdlP -d pfi-dev -n -w 700") > (:padnewline . "yes") (:hlines . "no") (:session . "none"))) >> ((lambda (result) (if (and (eq (cdr (assoc :result-type params)) (quot= e value)) (or (member "vector" result-params) (member "table" result-params= )) (not (listp result))) (list (list result)) result)) (funcall cmd body pa= rams)) >> (setq result ((lambda (result) (if (and (eq (cdr (assoc :result-type > params)) (quote value)) (or (member "vector" result-params) (member "tabl= e" > result-params)) (not (listp result))) (list (list result)) result)) (func= all > cmd body params))) >> (if (and (not arg) new-hash (equal new-hash old-hash)) (save-excursion > (goto-char (org-babel-where-is-src-block-result nil info)) (end-of-line 1) > (forward-char 1) (setq result (org-babel-read-result)) (message > (replace-regexp-in-string "%" "%%" (format "%S" result))) result) (message > "executing %s code block%s..." (capitalize lang) (if (nth 4 info) (format= " > (%s)" (nth 4 info)) "")) (setq result ((lambda (result) (if (and (eq (cdr= ...) > (quote value)) (or (member "vector" result-params) (member "table" > result-params)) (not (listp result))) (list (list result)) result)) (func= all > cmd body params))) (when (cdr (assoc :file params)) (when result > (with-temp-file (cdr (assoc :file params)) (insert (org-babel-format-resu= lt > result (cdr (assoc :sep ...)))))) (setq result (cdr (assoc :file params))= )) > (org-babel-insert-result result result-params info new-hash indent lang) > (run-hooks (quote org-babel-after-execute-hook)) result) >> (progn (fset (quote call-process-region) (function* (lambda (&rest args) > (block call-process-region (apply (quote > org-babel-tramp-handle-call-process-region) args))))) (flet ((lang-check = (f) > (let ((f (intern ...))) (when (fboundp f) f)))) (setq cmd (or (lang-check > lang) (lang-check (symbol-name (cdr (assoc lang org-src-lang-modes)))) (e= rror > "No org-babel-execute function for %s!" lang)))) (if (and (not arg) new-h= ash > (equal new-hash old-hash)) (save-excursion (goto-char > (org-babel-where-is-src-block-result nil info)) (end-of-line 1) (forward-= char > 1) (setq result (org-babel-read-result)) (message (replace-regexp-in-stri= ng > "%" "%%" (format "%S" result))) result) (message "executing %s code > block%s..." (capitalize lang) (if (nth 4 info) (format " (%s)" (nth 4 inf= o)) > "")) (setq result ((lambda (result) (if (and (eq ... ...) (or ... ...) (n= ot > ...)) (list (list result)) result)) (funcall cmd body params))) (when (cdr > (assoc :file params)) (when result (with-temp-file (cdr (assoc :file para= ms)) > (insert (org-babel-format-result result (cdr ...))))) (setq result (cdr (= assoc > :file params)))) (org-babel-insert-result result result-params info new-h= ash > indent lang) (run-hooks (quote org-babel-after-execute-hook)) result)) >> (unwind-protect (progn (fset (quote call-process-region) (function* (lam= bda > (&rest args) (block call-process-region (apply (quote > org-babel-tramp-handle-call-process-region) args))))) (flet ((lang-check = (f) > (let ((f ...)) (when (fboundp f) f)))) (setq cmd (or (lang-check lang) > (lang-check (symbol-name (cdr ...))) (error "No org-babel-execute functio= n for > %s!" lang)))) (if (and (not arg) new-hash (equal new-hash old-hash)) > (save-excursion (goto-char (org-babel-where-is-src-block-result nil info)) > (end-of-line 1) (forward-char 1) (setq result (org-babel-read-result)) > (message (replace-regexp-in-string "%" "%%" (format "%S" result))) result) > (message "executing %s code block%s..." (capitalize lang) (if (nth 4 info) > (format " (%s)" (nth 4 info)) "")) (setq result ((lambda (result) (if (an= d ... > ... ...) (list ...) result)) (funcall cmd body params))) (when (cdr (assoc > :file params)) (when result (with-temp-file (cdr (assoc :file params)) (i= nsert > (org-babel-format-result result ...)))) (setq result (cdr (assoc :file > params)))) (org-babel-insert-result result result-params info new-hash in= dent > lang) (run-hooks (quote org-babel-after-execute-hook)) result)) (if > --cl-letf-bound-- (fset (quote call-process-region) --cl-letf-save--) > (fmakunbound (quote call-process-region)))) >> (let* ((--cl-letf-bound-- (fboundp (quote call-process-region))) > (--cl-letf-save-- (and --cl-letf-bound-- (symbol-function (quote > call-process-region))))) (unwind-protect (progn (fset (quote > call-process-region) (function* (lambda (&rest args) (block > call-process-region (apply ... args))))) (flet ((lang-check (f) (let (...) > (when ... f)))) (setq cmd (or (lang-check lang) (lang-check (symbol-name = ...)) > (error "No org-babel-execute function for %s!" lang)))) (if (and (not arg) > new-hash (equal new-hash old-hash)) (save-excursion (goto-char > (org-babel-where-is-src-block-result nil info)) (end-of-line 1) (forward-= char > 1) (setq result (org-babel-read-result)) (message (replace-regexp-in-stri= ng > "%" "%%" (format "%S" result))) result) (message "executing %s code > block%s..." (capitalize lang) (if (nth 4 info) (format " (%s)" (nth 4 inf= o)) > "")) (setq result ((lambda (result) (if ... ... result)) (funcall cmd body > params))) (when (cdr (assoc :file params)) (when result (with-temp-file (= cdr > ...) (insert ...))) (setq result (cdr (assoc :file params)))) > (org-babel-insert-result result result-params info new-hash indent lang) > (run-hooks (quote org-babel-after-execute-hook)) result)) (if > --cl-letf-bound-- (fset (quote call-process-region) --cl-letf-save--) > (fmakunbound (quote call-process-region))))) >> (letf (((symbol-function (quote call-process-region)) (function* (lambda > (&rest args) (block call-process-region (apply (quote > org-babel-tramp-handle-call-process-region) args)))))) (flet ((lang-check= (f) > (let ((f (intern ...))) (when (fboundp f) f)))) (setq cmd (or (lang-check > lang) (lang-check (symbol-name (cdr (assoc lang org-src-lang-modes)))) (e= rror > "No org-babel-execute function for %s!" lang)))) (if (and (not arg) new-h= ash > (equal new-hash old-hash)) (save-excursion (goto-char > (org-babel-where-is-src-block-result nil info)) (end-of-line 1) (forward-= char > 1) (setq result (org-babel-read-result)) (message (replace-regexp-in-stri= ng > "%" "%%" (format "%S" result))) result) (message "executing %s code > block%s..." (capitalize lang) (if (nth 4 info) (format " (%s)" (nth 4 inf= o)) > "")) (setq result ((lambda (result) (if (and (eq ... ...) (or ... ...) (n= ot > ...)) (list (list result)) result)) (funcall cmd body params))) (when (cdr > (assoc :file params)) (when result (with-temp-file (cdr (assoc :file para= ms)) > (insert (org-babel-format-result result (cdr ...))))) (setq result (cdr (= assoc > :file params)))) (org-babel-insert-result result result-params info new-h= ash > indent lang) (run-hooks (quote org-babel-after-execute-hook)) result)) >> (letf* (((symbol-function (quote call-process-region)) (function* (lambda > (&rest args) (block call-process-region (apply (quote > org-babel-tramp-handle-call-process-region) args)))))) (flet ((lang-check= (f) > (let ((f (intern ...))) (when (fboundp f) f)))) (setq cmd (or (lang-check > lang) (lang-check (symbol-name (cdr (assoc lang org-src-lang-modes)))) (e= rror > "No org-babel-execute function for %s!" lang)))) (if (and (not arg) new-h= ash > (equal new-hash old-hash)) (save-excursion (goto-char > (org-babel-where-is-src-block-result nil info)) (end-of-line 1) (forward-= char > 1) (setq result (org-babel-read-result)) (message (replace-regexp-in-stri= ng > "%" "%%" (format "%S" result))) result) (message "executing %s code > block%s..." (capitalize lang) (if (nth 4 info) (format " (%s)" (nth 4 inf= o)) > "")) (setq result ((lambda (result) (if (and (eq ... ...) (or ... ...) (n= ot > ...)) (list (list result)) result)) (funcall cmd body params))) (when (cdr > (assoc :file params)) (when result (with-temp-file (cdr (assoc :file para= ms)) > (insert (org-babel-format-result result (cdr ...))))) (setq result (cdr (= assoc > :file params)))) (org-babel-insert-result result result-params info new-h= ash > indent lang) (run-hooks (quote org-babel-after-execute-hook)) result)) >> (flet ((call-process-region (&rest args) (apply (quote > org-babel-tramp-handle-call-process-region) args))) (flet ((lang-check (f) > (let ((f (intern ...))) (when (fboundp f) f)))) (setq cmd (or (lang-check > lang) (lang-check (symbol-name (cdr (assoc lang org-src-lang-modes)))) (e= rror > "No org-babel-execute function for %s!" lang)))) (if (and (not arg) new-h= ash > (equal new-hash old-hash)) (save-excursion (goto-char > (org-babel-where-is-src-block-result nil info)) (end-of-line 1) (forward-= char > 1) (setq result (org-babel-read-result)) (message (replace-regexp-in-stri= ng > "%" "%%" (format "%S" result))) result) (message "executing %s code > block%s..." (capitalize lang) (if (nth 4 info) (format " (%s)" (nth 4 inf= o)) > "")) (setq result ((lambda (result) (if (and (eq ... ...) (or ... ...) (n= ot > ...)) (list (list result)) result)) (funcall cmd body params))) (when (cdr > (assoc :file params)) (when result (with-temp-file (cdr (assoc :file para= ms)) > (insert (org-babel-format-result result (cdr ...))))) (setq result (cdr (= assoc > :file params)))) (org-babel-insert-result result result-params info new-h= ash > indent lang) (run-hooks (quote org-babel-after-execute-hook)) result)) >> (unwind-protect (flet ((call-process-region (&rest args) (apply (quote > org-babel-tramp-handle-call-process-region) args))) (flet ((lang-check (f) > (let ((f ...)) (when (fboundp f) f)))) (setq cmd (or (lang-check lang) > (lang-check (symbol-name (cdr ...))) (error "No org-babel-execute functio= n for > %s!" lang)))) (if (and (not arg) new-hash (equal new-hash old-hash)) > (save-excursion (goto-char (org-babel-where-is-src-block-result nil info)) > (end-of-line 1) (forward-char 1) (setq result (org-babel-read-result)) > (message (replace-regexp-in-string "%" "%%" (format "%S" result))) result) > (message "executing %s code block%s..." (capitalize lang) (if (nth 4 info) > (format " (%s)" (nth 4 info)) "")) (setq result ((lambda (result) (if (an= d ... > ... ...) (list ...) result)) (funcall cmd body params))) (when (cdr (assoc > :file params)) (when result (with-temp-file (cdr (assoc :file params)) (i= nsert > (org-babel-format-result result ...)))) (setq result (cdr (assoc :file > params)))) (org-babel-insert-result result result-params info new-hash in= dent > lang) (run-hooks (quote org-babel-after-execute-hook)) result)) (setq > call-process-region (quote org-babel-call-process-region-original))) >> (let* ((lang (nth 0 info)) (params (if params (org-babel-process-params > (org-babel-merge-params (nth 2 info) params)) (nth 2 info))) (cache\? (and > (not arg) (cdr (assoc :cache params)) (string=3D "yes" (cdr (assoc :cache > params))))) (result-params (cdr (assoc :result-params params))) (new-hash > (when cache\? (org-babel-sha1-hash info))) (old-hash (when cache\? > (org-babel-current-result-hash))) (body (setf (nth 1 info) (let ((noweb (= cdr > ...))) (if (and noweb (or ... ...)) (org-babel-expand-noweb-references in= fo) > (nth 1 info))))) (dir (cdr (assoc :dir params))) (default-directory (or (= and > dir (file-name-as-directory dir)) default-directory)) > (org-babel-call-process-region-original (if (boundp (quote > org-babel-call-process-region-original)) > org-babel-call-process-region-original (symbol-function (quote > call-process-region)))) (indent (car (last info))) result cmd) (unwind-pr= otect > (flet ((call-process-region (&rest args) (apply (quote > org-babel-tramp-handle-call-process-region) args))) (flet ((lang-check (f) > (let (...) (when ... f)))) (setq cmd (or (lang-check lang) (lang-check > (symbol-name ...)) (error "No org-babel-execute function for %s!" lang)))= ) (if > (and (not arg) new-hash (equal new-hash old-hash)) (save-excursion (goto-= char > (org-babel-where-is-src-block-result nil info)) (end-of-line 1) (forward-= char > 1) (setq result (org-babel-read-result)) (message (replace-regexp-in-stri= ng > "%" "%%" (format "%S" result))) result) (message "executing %s code > block%s..." (capitalize lang) (if (nth 4 info) (format " (%s)" (nth 4 inf= o)) > "")) (setq result ((lambda (result) (if ... ... result)) (funcall cmd body > params))) (when (cdr (assoc :file params)) (when result (with-temp-file (= cdr > ...) (insert ...))) (setq result (cdr (assoc :file params)))) > (org-babel-insert-result result result-params info new-hash indent lang) > (run-hooks (quote org-babel-after-execute-hook)) result)) (setq > call-process-region (quote org-babel-call-process-region-original)))) >> (progn (let* ((lang (nth 0 info)) (params (if params > (org-babel-process-params (org-babel-merge-params (nth 2 info) params)) (= nth 2 > info))) (cache\? (and (not arg) (cdr (assoc :cache params)) (string=3D "y= es" > (cdr (assoc :cache params))))) (result-params (cdr (assoc :result-params > params))) (new-hash (when cache\? (org-babel-sha1-hash info))) (old-hash = (when > cache\? (org-babel-current-result-hash))) (body (setf (nth 1 info) (let > ((noweb ...)) (if (and noweb ...) (org-babel-expand-noweb-references info) > (nth 1 info))))) (dir (cdr (assoc :dir params))) (default-directory (or (= and > dir (file-name-as-directory dir)) default-directory)) > (org-babel-call-process-region-original (if (boundp (quote > org-babel-call-process-region-original)) > org-babel-call-process-region-original (symbol-function (quote > call-process-region)))) (indent (car (last info))) result cmd) (unwind-pr= otect > (flet ((call-process-region (&rest args) (apply (quote > org-babel-tramp-handle-call-process-region) args))) (flet ((lang-check (f) > (let ... ...))) (setq cmd (or (lang-check lang) (lang-check ...) (error "= No > org-babel-execute function for %s!" lang)))) (if (and (not arg) new-hash > (equal new-hash old-hash)) (save-excursion (goto-char > (org-babel-where-is-src-block-result nil info)) (end-of-line 1) (forward-= char > 1) (setq result (org-babel-read-result)) (message (replace-regexp-in-stri= ng > "%" "%%" ...)) result) (message "executing %s code block%s..." (capitalize > lang) (if (nth 4 info) (format " (%s)" ...) "")) (setq result ((lambda ... > ...) (funcall cmd body params))) (when (cdr (assoc :file params)) (when r= esult > (with-temp-file ... ...)) (setq result (cdr ...))) (org-babel-insert-resu= lt > result result-params info new-hash indent lang) (run-hooks (quote > org-babel-after-execute-hook)) result)) (setq call-process-region (quote > org-babel-call-process-region-original))))) >> (if (org-babel-confirm-evaluate info) (progn (let* ((lang (nth 0 info)) > (params (if params (org-babel-process-params (org-babel-merge-params ... > params)) (nth 2 info))) (cache\? (and (not arg) (cdr (assoc :cache params= )) > (string=3D "yes" (cdr ...)))) (result-params (cdr (assoc :result-params > params))) (new-hash (when cache\? (org-babel-sha1-hash info))) (old-hash = (when > cache\? (org-babel-current-result-hash))) (body (setf (nth 1 info) (let (= ...) > (if ... ... ...)))) (dir (cdr (assoc :dir params))) (default-directory (or > (and dir (file-name-as-directory dir)) default-directory)) > (org-babel-call-process-region-original (if (boundp (quote > org-babel-call-process-region-original)) > org-babel-call-process-region-original (symbol-function (quote > call-process-region)))) (indent (car (last info))) result cmd) (unwind-pr= otect > (flet ((call-process-region (&rest args) (apply ... args))) (flet ((lang-= check > ... ...)) (setq cmd (or ... ... ...))) (if (and (not arg) new-hash (equal > new-hash old-hash)) (save-excursion (goto-char ...) (end-of-line 1) > (forward-char 1) (setq result ...) (message ...) result) (message "execut= ing > %s code block%s..." (capitalize lang) (if ... ... "")) (setq result (... = ...)) > (when (cdr ...) (when result ...) (setq result ...)) (org-babel-insert-re= sult > result result-params info new-hash indent lang) (run-hooks (quote > org-babel-after-execute-hook)) result)) (setq call-process-region (quote > org-babel-call-process-region-original)))))) >> (when (org-babel-confirm-evaluate info) (let* ((lang (nth 0 info)) (para= ms > (if params (org-babel-process-params (org-babel-merge-params (nth 2 info) > params)) (nth 2 info))) (cache\? (and (not arg) (cdr (assoc :cache params= )) > (string=3D "yes" (cdr (assoc :cache params))))) (result-params (cdr (assoc > :result-params params))) (new-hash (when cache\? (org-babel-sha1-hash inf= o))) > (old-hash (when cache\? (org-babel-current-result-hash))) (body (setf (nt= h 1 > info) (let ((noweb ...)) (if (and noweb ...) > (org-babel-expand-noweb-references info) (nth 1 info))))) (dir (cdr (assoc > :dir params))) (default-directory (or (and dir (file-name-as-directory di= r)) > default-directory)) (org-babel-call-process-region-original (if (boundp (= quote > org-babel-call-process-region-original)) > org-babel-call-process-region-original (symbol-function (quote > call-process-region)))) (indent (car (last info))) result cmd) (unwind-pr= otect > (flet ((call-process-region (&rest args) (apply (quote > org-babel-tramp-handle-call-process-region) args))) (flet ((lang-check (f) > (let ... ...))) (setq cmd (or (lang-check lang) (lang-check ...) (error "= No > org-babel-execute function for %s!" lang)))) (if (and (not arg) new-hash > (equal new-hash old-hash)) (save-excursion (goto-char > (org-babel-where-is-src-block-result nil info)) (end-of-line 1) (forward-= char > 1) (setq result (org-babel-read-result)) (message (replace-regexp-in-stri= ng > "%" "%%" ...)) result) (message "executing %s code block%s..." (capitalize > lang) (if (nth 4 info) (format " (%s)" ...) "")) (setq result ((lambda ... > ...) (funcall cmd body params))) (when (cdr (assoc :file params)) (when r= esult > (with-temp-file ... ...)) (setq result (cdr ...))) (org-babel-insert-resu= lt > result result-params info new-hash indent lang) (run-hooks (quote > org-babel-after-execute-hook)) result)) (setq call-process-region (quote > org-babel-call-process-region-original))))) >> (let ((info (or info (org-babel-get-src-block-info)))) (when > (org-babel-confirm-evaluate info) (let* ((lang (nth 0 info)) (params (if > params (org-babel-process-params (org-babel-merge-params ... params)) (nt= h 2 > info))) (cache\? (and (not arg) (cdr (assoc :cache params)) (string=3D "y= es" > (cdr ...)))) (result-params (cdr (assoc :result-params params))) (new-hash > (when cache\? (org-babel-sha1-hash info))) (old-hash (when cache\? > (org-babel-current-result-hash))) (body (setf (nth 1 info) (let (...) (if= ... > ... ...)))) (dir (cdr (assoc :dir params))) (default-directory (or (and d= ir > (file-name-as-directory dir)) default-directory)) > (org-babel-call-process-region-original (if (boundp (quote > org-babel-call-process-region-original)) > org-babel-call-process-region-original (symbol-function (quote > call-process-region)))) (indent (car (last info))) result cmd) (unwind-pr= otect > (flet ((call-process-region (&rest args) (apply ... args))) (flet ((lang-= check > ... ...)) (setq cmd (or ... ... ...))) (if (and (not arg) new-hash (equal > new-hash old-hash)) (save-excursion (goto-char ...) (end-of-line 1) > (forward-char 1) (setq result ...) (message ...) result) (message "execut= ing > %s code block%s..." (capitalize lang) (if ... ... "")) (setq result (... = ...)) > (when (cdr ...) (when result ...) (setq result ...)) (org-babel-insert-re= sult > result result-params info new-hash indent lang) (run-hooks (quote > org-babel-after-execute-hook)) result)) (setq call-process-region (quote > org-babel-call-process-region-original)))))) >> org-babel-execute-src-block(nil ("sql" "select getdate()\ngo" > ((:colname-names) (:rowname-names) (:result-params "value" "replace") > (:result-type . value) (:comments . "") (:shebang . "") (:cache . "no") > (:padline . "") (:noweb . "no") (:tangle . "no") (:exports . "code") (:re= sults > . "value replace") (:eval . "yes") (:cmdline . "-S cauchy -U sa -P LpmdlP= -d > pfi-dev -n -w 700") (:padnewline . "yes") (:hlines . "no") (:session . > "none")) "" nil 0)) >> (progn (org-babel-eval-wipe-error-buffer) (org-babel-execute-src-block= current-prefix-arg info) t) >> (if info (progn (org-babel-eval-wipe-error-buffer) (org-babel-execute-= src-block current-prefix-arg info) t) nil) >> (let ((info (org-babel-get-src-block-info))) (if info (progn (org-babe= l-eval-wipe-error-buffer) (org-babel-execute-src-block current-prefix-arg i= nfo) t) nil)) >> org-babel-execute-src-block-maybe() >> (or (org-babel-execute-src-block-maybe) (org-babel-lob-execute-maybe)) >> org-babel-execute-maybe() >> call-interactively(org-babel-execute-maybe) >> #+end_src >> >> Best regards, >> Seb Best regards, Seb --=20 Sebastien Vauban