From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Sebastien Vauban" Subject: [babel] Property engine can't be set globally Date: Wed, 26 Oct 2011 12:33:50 +0200 Message-ID: <80bot4vy7l.fsf@somewhere.org> 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 #+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 (qu= ote msosql))) (format "osql %s -s \" \" -i %s -o %s" (or cmdline "") (org-b= abel-process-file-name in-file) (org-babel-process-file-name out-file))) ((= member* --cl-var-- (quote (quote mysql))) (format "mysql %s < %s > %s" (or = cmdline "") (org-babel-process-file-name in-file) (org-babel-process-file-n= ame out-file))) ((member* --cl-var-- (quote (quote postgresql))) (format "p= sql -A -P footer=3Doff -F \" \" -f %s -o %s %s" (org-babel-process-file-na= me in-file) (org-babel-process-file-name out-file) (or cmdline ""))) (t (er= ror "no support 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-proces= s-file-name out-file))) ((quote mysql) (format "mysql %s < %s > %s" (or cmd= line "") (org-babel-process-file-name in-file) (org-babel-process-file-name= out-file))) ((quote postgresql) (format "psql -A -P footer=3Doff -F \" \" = -f %s -o %s %s" (org-babel-process-file-name in-file) (org-babel-process-f= ile-name out-file) (or cmdline ""))) (t (error "no support for the %s sql e= ngine" engine))) (let* ((result-params (cdr (assoc :result-params params))) (cmdline (cdr = (assoc :cmdline params))) (engine (cdr (assoc :engine params))) (in-file (o= rg-babel-temp-file "sql-in-")) (out-file (or (cdr (assoc :out-file params))= (org-babel-temp-file "sql-out-"))) (header-delim "") (command (case (inter= n 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 ou= t-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 "psql -A -P footer=3Doff -F \" \" -f %s -o %s %= s" (org-babel-process-file-name in-file) (org-babel-process-file-name out-f= ile) (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" resu= lt-params) (member "verbatim" result-params) (member "html" result-params) = (member "code" result-params) (equal (point-min) (point-max))) (with-temp-b= uffer (progn (insert-file-contents-literally out-file) (buffer-string))) (w= ith-temp-buffer (with-temp-buffer (insert-file-contents out-file) (goto-cha= r (point-min)) (when (re-search-forward "^\\(-+\\)[^-]" nil t) (setq header= -delim (match-string-no-properties 1))) (goto-char (point-max)) (forward-ch= ar -1) (while (looking-at "\n") (delete-char 1) (goto-char (point-max)) (fo= rward-char -1)) (write-file out-file)) (org-table-import out-file (quote (1= 6))) (org-babel-reassemble-table (mapcar (lambda (x) (if (string=3D ... hea= der-delim) (quote hline) x)) (org-table-to-lisp)) (org-babel-pick-name (cdr= (assoc :colname-names params)) (cdr (assoc :colnames 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") (:ta= ngle . "no") (:exports . "code") (:results . "value replace") (:eval . "yes= ") (:cmdline . "-S cauchy -U sa -P LpmdlP -d pfi-dev -n -w 700") (:padnewli= ne . "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 . "n= o") (:tangle . "no") (:exports . "code") (:results . "value replace") (:eva= l . "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)) (quote v= alue)) (or (member "vector" result-params) (member "table" result-params)) = (not (listp result))) (list (list result)) result)) (funcall cmd body param= s)) (setq result ((lambda (result) (if (and (eq (cdr (assoc :result-type para= ms)) (quote value)) (or (member "vector" result-params) (member "table" res= ult-params)) (not (listp result))) (list (list result)) result)) (funcall c= md body params))) (if (and (not arg) new-hash (equal new-hash old-hash)) (save-excursion (g= oto-char (org-babel-where-is-src-block-result nil info)) (end-of-line 1) (f= orward-char 1) (setq result (org-babel-read-result)) (message (replace-rege= xp-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 v= alue)) (or (member "vector" result-params) (member "table" result-params)) = (not (listp result))) (list (list result)) result)) (funcall cmd body param= s))) (when (cdr (assoc :file params)) (when result (with-temp-file (cdr (as= soc :file params)) (insert (org-babel-format-result result (cdr (assoc :sep= ...)))))) (setq result (cdr (assoc :file params)))) (org-babel-insert-resu= lt result result-params info new-hash indent lang) (run-hooks (quote org-ba= bel-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-proces= s-region) args))))) (flet ((lang-check (f) (let ((f (intern ...))) (when (f= boundp f) f)))) (setq cmd (or (lang-check lang) (lang-check (symbol-name (c= dr (assoc lang org-src-lang-modes)))) (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)) (mess= age (replace-regexp-in-string "%" "%%" (format "%S" result))) result) (mess= age "executing %s code block%s..." (capitalize lang) (if (nth 4 info) (form= at " (%s)" (nth 4 info)) "")) (setq result ((lambda (result) (if (and (eq .= .. ...) (or ... ...) (not ...)) (list (list result)) result)) (funcall cmd = body params))) (when (cdr (assoc :file params)) (when result (with-temp-fil= e (cdr (assoc :file params)) (insert (org-babel-format-result result (cdr .= ..))))) (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)) (unwind-protect (progn (fset (quote call-process-region) (function* (lamb= da (&rest args) (block call-process-region (apply (quote org-babel-tramp-ha= ndle-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 function for %s!" lang)))) (i= f (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) (forwa= rd-char 1) (setq result (org-babel-read-result)) (message (replace-regexp-i= n-string "%" "%%" (format "%S" result))) result) (message "executing %s cod= e block%s..." (capitalize lang) (if (nth 4 info) (format " (%s)" (nth 4 inf= o)) "")) (setq result ((lambda (result) (if (and ... ... ...) (list ...) re= sult)) (funcall cmd body params))) (when (cdr (assoc :file params)) (when r= esult (with-temp-file (cdr (assoc :file params)) (insert (org-babel-format-= result result ...)))) (setq result (cdr (assoc :file params)))) (org-babel-= insert-result result result-params info new-hash indent lang) (run-hooks (q= uote org-babel-after-execute-hook)) result)) (if --cl-letf-bound-- (fset (q= uote call-process-region) --cl-letf-save--) (fmakunbound (quote call-proces= s-region)))) (let* ((--cl-letf-bound-- (fboundp (quote call-process-region))) (--cl-le= tf-save-- (and --cl-letf-bound-- (symbol-function (quote call-process-regio= n))))) (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-e= xcursion (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 (r= eplace-regexp-in-string "%" "%%" (format "%S" result))) result) (message "e= xecuting %s code block%s..." (capitalize lang) (if (nth 4 info) (format " (= %s)" (nth 4 info)) "")) (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 par= ams)))) (org-babel-insert-result result result-params info new-hash indent = lang) (run-hooks (quote org-babel-after-execute-hook)) result)) (if --cl-le= tf-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-handl= e-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)))) (error "No org-babel-ex= ecute function for %s!" lang)))) (if (and (not arg) new-hash (equal new-has= h old-hash)) (save-excursion (goto-char (org-babel-where-is-src-block-resul= t 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 ... ...) (or ... ...) (not ...)) (list (list result)) result))= (funcall cmd body params))) (when (cdr (assoc :file params)) (when result = (with-temp-file (cdr (assoc :file params)) (insert (org-babel-format-result= result (cdr ...))))) (setq result (cdr (assoc :file params)))) (org-babel-= insert-result result result-params info new-hash indent lang) (run-hooks (q= uote 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-hand= le-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)))) (error "No org-babel-e= xecute function for %s!" lang)))) (if (and (not arg) new-hash (equal new-ha= sh old-hash)) (save-excursion (goto-char (org-babel-where-is-src-block-resu= lt 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 (nt= h 4 info) (format " (%s)" (nth 4 info)) "")) (setq result ((lambda (result)= (if (and (eq ... ...) (or ... ...) (not ...)) (list (list result)) result)= ) (funcall cmd body params))) (when (cdr (assoc :file params)) (when result= (with-temp-file (cdr (assoc :file params)) (insert (org-babel-format-resul= t result (cdr ...))))) (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)) (flet ((call-process-region (&rest args) (apply (quote org-babel-tramp-ha= ndle-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)))) (error "No org-babel-ex= ecute function for %s!" lang)))) (if (and (not arg) new-hash (equal new-has= h old-hash)) (save-excursion (goto-char (org-babel-where-is-src-block-resul= t 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 ... ...) (or ... ...) (not ...)) (list (list result)) result))= (funcall cmd body params))) (when (cdr (assoc :file params)) (when result = (with-temp-file (cdr (assoc :file params)) (insert (org-babel-format-result= result (cdr ...))))) (setq result (cdr (assoc :file params)))) (org-babel-= insert-result result result-params info new-hash indent lang) (run-hooks (q= uote org-babel-after-execute-hook)) result)) (unwind-protect (flet ((call-process-region (&rest args) (apply (quote or= g-babel-tramp-handle-call-process-region) args))) (flet ((lang-check (f) (l= et ((f ...)) (when (fboundp f) f)))) (setq cmd (or (lang-check lang) (lang-= check (symbol-name (cdr ...))) (error "No org-babel-execute function for %s= !" lang)))) (if (and (not arg) new-hash (equal new-hash old-hash)) (save-ex= cursion (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 (re= place-regexp-in-string "%" "%%" (format "%S" result))) result) (message "ex= ecuting %s code block%s..." (capitalize lang) (if (nth 4 info) (format " (%= s)" (nth 4 info)) "")) (setq result ((lambda (result) (if (and ... ... ...)= (list ...) result)) (funcall cmd body params))) (when (cdr (assoc :file pa= rams)) (when result (with-temp-file (cdr (assoc :file params)) (insert (org= -babel-format-result result ...)))) (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-proce= ss-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 pa= rams))))) (result-params (cdr (assoc :result-params params))) (new-hash (wh= en cache\? (org-babel-sha1-hash info))) (old-hash (when cache\? (org-babel-= current-result-hash))) (body (setf (nth 1 info) (let ((noweb (cdr ...))) (i= f (and noweb (or ... ...)) (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-re= gion-original (if (boundp (quote org-babel-call-process-region-original)) o= rg-babel-call-process-region-original (symbol-function (quote call-process-= region)))) (indent (car (last info))) result cmd) (unwind-protect (flet ((c= all-process-region (&rest args) (apply (quote org-babel-tramp-handle-call-p= rocess-region) args))) (flet ((lang-check (f) (let (...) (when ... f)))) (s= etq cmd (or (lang-check lang) (lang-check (symbol-name ...)) (error "No org= -babel-execute function for %s!" lang)))) (if (and (not arg) new-hash (equa= l new-hash old-hash)) (save-excursion (goto-char (org-babel-where-is-src-bl= ock-result nil info)) (end-of-line 1) (forward-char 1) (setq result (org-ba= bel-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 ... ... 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-execut= e-hook)) result)) (setq call-process-region (quote org-babel-call-process-r= egion-original)))) (progn (let* ((lang (nth 0 info)) (params (if params (org-babel-process-p= arams (org-babel-merge-params (nth 2 info) params)) (nth 2 info))) (cache\?= (and (not arg) (cdr (assoc :cache params)) (string=3D "yes" (cdr (assoc :c= ache params))))) (result-params (cdr (assoc :result-params params))) (new-h= ash (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-nam= e-as-directory dir)) default-directory)) (org-babel-call-process-region-ori= ginal (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-protect (flet ((call-proc= ess-region (&rest args) (apply (quote org-babel-tramp-handle-call-process-r= egion) args))) (flet ((lang-check (f) (let ... ...))) (setq cmd (or (lang-c= heck lang) (lang-check ...) (error "No org-babel-execute function for %s!" = lang)))) (if (and (not arg) new-hash (equal new-hash old-hash)) (save-excur= sion (goto-char (org-babel-where-is-src-block-result nil info)) (end-of-lin= e 1) (forward-char 1) (setq result (org-babel-read-result)) (message (repla= ce-regexp-in-string "%" "%%" ...)) result) (message "executing %s code bloc= k%s..." (capitalize lang) (if (nth 4 info) (format " (%s)" ...) "")) (setq = result ((lambda ... ...) (funcall cmd body params))) (when (cdr (assoc :fil= e params)) (when result (with-temp-file ... ...)) (setq result (cdr ...))) = (org-babel-insert-result result result-params info new-hash indent lang) (r= un-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 ... par= ams)) (nth 2 info))) (cache\? (and (not arg) (cdr (assoc :cache params)) (s= tring=3D "yes" (cdr ...)))) (result-params (cdr (assoc :result-params param= s))) (new-hash (when cache\? (org-babel-sha1-hash info))) (old-hash (when c= ache\? (org-babel-current-result-hash))) (body (setf (nth 1 info) (let (...= ) (if ... ... ...)))) (dir (cdr (assoc :dir params))) (default-directory (o= r (and dir (file-name-as-directory dir)) default-directory)) (org-babel-cal= l-process-region-original (if (boundp (quote org-babel-call-process-region-= original)) org-babel-call-process-region-original (symbol-function (quote c= all-process-region)))) (indent (car (last info))) result cmd) (unwind-prote= ct (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 "executing= %s code block%s..." (capitalize lang) (if ... ... "")) (setq result (... .= ..)) (when (cdr ...) (when result ...) (setq result ...)) (org-babel-insert= -result result result-params info new-hash indent lang) (run-hooks (quote o= rg-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)) (param= s (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 (asso= c :result-params params))) (new-hash (when cache\? (org-babel-sha1-hash inf= o))) (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-pr= ocess-region-original)) org-babel-call-process-region-original (symbol-func= tion (quote call-process-region)))) (indent (car (last info))) result cmd) = (unwind-protect (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 (equa= l new-hash old-hash)) (save-excursion (goto-char (org-babel-where-is-src-bl= ock-result nil info)) (end-of-line 1) (forward-char 1) (setq result (org-ba= bel-read-result)) (message (replace-regexp-in-string "%" "%%" ...)) 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 result (with-temp-file ..= . ...)) (setq result (cdr ...))) (org-babel-insert-result result result-par= ams info new-hash indent lang) (run-hooks (quote org-babel-after-execute-ho= ok)) result)) (setq call-process-region (quote org-babel-call-process-regio= n-original))))) (let ((info (or info (org-babel-get-src-block-info)))) (when (org-babel-c= onfirm-evaluate info) (let* ((lang (nth 0 info)) (params (if params (org-ba= bel-process-params (org-babel-merge-params ... params)) (nth 2 info))) (cac= he\? (and (not arg) (cdr (assoc :cache params)) (string=3D "yes" (cdr ...))= )) (result-params (cdr (assoc :result-params params))) (new-hash (when cach= e\? (org-babel-sha1-hash info))) (old-hash (when cache\? (org-babel-current= -result-hash))) (body (setf (nth 1 info) (let (...) (if ... ... ...)))) (di= r (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)))) (i= ndent (car (last info))) result cmd) (unwind-protect (flet ((call-process-r= egion (&rest args) (apply ... args))) (flet ((lang-check ... ...)) (setq cm= d (or ... ... ...))) (if (and (not arg) new-hash (equal new-hash old-hash))= (save-excursion (goto-char ...) (end-of-line 1) (forward-char 1) (setq res= ult ...) (message ...) result) (message "executing %s code block%s..." (cap= italize lang) (if ... ... "")) (setq result (... ...)) (when (cdr ...) (whe= n result ...) (setq result ...)) (org-babel-insert-result result result-par= ams info new-hash indent lang) (run-hooks (quote org-babel-after-execute-ho= ok)) result)) (setq call-process-region (quote org-babel-call-process-regio= n-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 . "") (:n= oweb . "no") (:tangle . "no") (:exports . "code") (:results . "value replac= e") (: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 cu= rrent-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-babel-e= val-wipe-error-buffer) (org-babel-execute-src-block current-prefix-arg info= ) 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 --=20 Sebastien Vauban