From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: [babel] Property engine can't be set globally Date: Wed, 26 Oct 2011 06:22:15 -0600 Message-ID: <87ehy0ymbs.fsf@gmail.com> References: <80bot4vy7l.fsf@somewhere.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([140.186.70.92]:42927) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RJ2Uy-0006S0-NK for emacs-orgmode@gnu.org; Wed, 26 Oct 2011 08:22:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RJ2Uv-0006rM-Sr for emacs-orgmode@gnu.org; Wed, 26 Oct 2011 08:22:24 -0400 Received: from mail-pz0-f47.google.com ([209.85.210.47]:45290) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RJ2Uv-0006rC-EF for emacs-orgmode@gnu.org; Wed, 26 Oct 2011 08:22:21 -0400 Received: by pzd13 with SMTP id 13so4253218pzd.6 for ; Wed, 26 Oct 2011 05:22:20 -0700 (PDT) In-Reply-To: <80bot4vy7l.fsf@somewhere.org> (Sebastien Vauban's message of "Wed, 26 Oct 2011 12:33:50 +0200") 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@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Sebastien Vauban Cc: emacs-orgmode@gnu.org Hi Seb, 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. Thanks -- Eric "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 (= 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))) = ((member* --cl-var-- (quote (quote mysql))) (format "mysql %s < %s > %s" (o= r cmdline "") (org-babel-process-file-name in-file) (org-babel-process-file= -name out-file))) ((member* --cl-var-- (quote (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-file) (or cmdline ""))) (t (= error "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-proc= ess-file-name out-file))) ((quote mysql) (format "mysql %s < %s > %s" (or c= mdline "") (org-babel-process-file-name in-file) (org-babel-process-file-na= me 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-file) (or cmdline ""))) (t (error "no support for the %s sql= engine" engine))) > (let* ((result-params (cdr (assoc :result-params params))) (cmdline (cd= r (assoc :cmdline params))) (engine (cdr (assoc :engine params))) (in-file = (org-babel-temp-file "sql-in-")) (out-file (or (cdr (assoc :out-file params= )) (org-babel-temp-file "sql-out-"))) (header-delim "") (command (case (int= ern engine) ((quote msosql) (format "osql %s -s \" \" -i %s -o %s" (or cmdl= ine "") (org-babel-process-file-name in-file) (org-babel-process-file-name = out-file))) ((quote mysql) (format "mysql %s < %s > %s" (or cmdline "") (or= g-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= -file) (or cmdline ""))) (t (error "no support for the %s sql engine" engin= e))))) (with-temp-file in-file (insert (org-babel-expand-body:sql body para= ms))) (message command) (shell-command command) (if (or (member "scalar" re= sult-params) (member "verbatim" result-params) (member "html" result-params= ) (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-contents out-file) (goto-c= har (point-min)) (when (re-search-forward "^\\(-+\\)[^-]" nil t) (setq head= er-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 ... h= eader-delim) (quote hline) x)) (org-table-to-lisp)) (org-babel-pick-name (c= dr (assoc :colname-names params)) (cdr (assoc :colnames params))) (org-babe= l-pick-name (cdr (assoc :rowname-names params)) (cdr (assoc :rownames param= s))))))) > org-babel-execute:sql("select getdate()\ngo" ((:colname-names) (:rownam= e-names) (:result-params "value" "replace") (:result-type . value) (:commen= ts . "") (:shebang . "") (:cache . "no") (:padline . "") (:noweb . "no") (:= tangle . "no") (:exports . "code") (:results . "value replace") (:eval . "y= es") (:cmdline . "-S cauchy -U sa -P LpmdlP -d pfi-dev -n -w 700") (:padnew= line . "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") (:e= val . "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= value)) (or (member "vector" result-params) (member "table" result-params)= ) (not (listp result))) (list (list result)) result)) (funcall cmd body par= ams)) > (setq result ((lambda (result) (if (and (eq (cdr (assoc :result-type pa= rams)) (quote value)) (or (member "vector" result-params) (member "table" r= esult-params)) (not (listp result))) (list (list result)) result)) (funcall= 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-re= gexp-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)) (funcall cmd body par= ams))) (when (cdr (assoc :file params)) (when result (with-temp-file (cdr (= assoc :file params)) (insert (org-babel-format-result result (cdr (assoc :s= ep ...)))))) (setq result (cdr (assoc :file params)))) (org-babel-insert-re= sult 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-proc= ess-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-execute functi= on 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)) (me= ssage (replace-regexp-in-string "%" "%%" (format "%S" result))) result) (me= ssage "executing %s code block%s..." (capitalize lang) (if (nth 4 info) (fo= rmat " (%s)" (nth 4 info)) "")) (setq result ((lambda (result) (if (and (eq= ... ...) (or ... ...) (not ...)) (list (list result)) result)) (funcall cm= d body params))) (when (cdr (assoc :file params)) (when result (with-temp-f= ile (cdr (assoc :file params)) (insert (org-babel-format-result result (cdr= ...))))) (setq result (cdr (assoc :file params)))) (org-babel-insert-resul= t result result-params info new-hash indent lang) (run-hooks (quote org-bab= el-after-execute-hook)) result)) > (unwind-protect (progn (fset (quote call-process-region) (function* (la= mbda (&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 (symbo= l-name (cdr ...))) (error "No org-babel-execute function for %s!" lang)))) = (if (and (not arg) new-hash (equal new-hash old-hash)) (save-excursion (got= o-char (org-babel-where-is-src-block-result nil info)) (end-of-line 1) (for= ward-char 1) (setq result (org-babel-read-result)) (message (replace-regexp= -in-string "%" "%%" (format "%S" result))) result) (message "executing %s c= ode block%s..." (capitalize lang) (if (nth 4 info) (format " (%s)" (nth 4 i= nfo)) "")) (setq result ((lambda (result) (if (and ... ... ...) (list ...) = result)) (funcall cmd body params))) (when (cdr (assoc :file params)) (when= result (with-temp-file (cdr (assoc :file params)) (insert (org-babel-forma= t-result result ...)))) (setq result (cdr (assoc :file params)))) (org-babe= l-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-proc= ess-region)))) > (let* ((--cl-letf-bound-- (fboundp (quote call-process-region))) (--cl-= letf-save-- (and --cl-letf-bound-- (symbol-function (quote call-process-reg= ion))))) (unwind-protect (progn (fset (quote call-process-region) (function= * (lambda (&rest args) (block call-process-region (apply ... args))))) (fle= t ((lang-check (f) (let (...) (when ... f)))) (setq cmd (or (lang-check lan= g) (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-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 resul= t (with-temp-file (cdr ...) (insert ...))) (setq result (cdr (assoc :file p= arams)))) (org-babel-insert-result result result-params info new-hash inden= t lang) (run-hooks (quote org-babel-after-execute-hook)) result)) (if --cl-= letf-bound-- (fset (quote call-process-region) --cl-letf-save--) (fmakunbou= nd (quote call-process-region))))) > (letf (((symbol-function (quote call-process-region)) (function* (lambd= a (&rest args) (block call-process-region (apply (quote org-babel-tramp-han= dle-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-= execute function for %s!" lang)))) (if (and (not arg) new-hash (equal new-h= ash old-hash)) (save-excursion (goto-char (org-babel-where-is-src-block-res= ult nil info)) (end-of-line 1) (forward-char 1) (setq result (org-babel-rea= d-result)) (message (replace-regexp-in-string "%" "%%" (format "%S" result)= )) result) (message "executing %s code block%s..." (capitalize lang) (if (n= th 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 resul= t (with-temp-file (cdr (assoc :file params)) (insert (org-babel-format-resu= lt result (cdr ...))))) (setq result (cdr (assoc :file params)))) (org-babe= l-insert-result result result-params info new-hash indent lang) (run-hooks = (quote org-babel-after-execute-hook)) result)) > (letf* (((symbol-function (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 (inter= n ...))) (when (fboundp f) f)))) (setq cmd (or (lang-check lang) (lang-chec= k (symbol-name (cdr (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-re= sult nil info)) (end-of-line 1) (forward-char 1) (setq result (org-babel-re= ad-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 (resul= t) (if (and (eq ... ...) (or ... ...) (not ...)) (list (list result)) resul= t)) (funcall cmd body params))) (when (cdr (assoc :file params)) (when resu= lt (with-temp-file (cdr (assoc :file params)) (insert (org-babel-format-res= ult result (cdr ...))))) (setq result (cdr (assoc :file params)))) (org-bab= el-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-= 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)))) (error "No org-babel-= execute function for %s!" lang)))) (if (and (not arg) new-hash (equal new-h= ash old-hash)) (save-excursion (goto-char (org-babel-where-is-src-block-res= ult nil info)) (end-of-line 1) (forward-char 1) (setq result (org-babel-rea= d-result)) (message (replace-regexp-in-string "%" "%%" (format "%S" result)= )) result) (message "executing %s code block%s..." (capitalize lang) (if (n= th 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 resul= t (with-temp-file (cdr (assoc :file params)) (insert (org-babel-format-resu= lt result (cdr ...))))) (setq result (cdr (assoc :file params)))) (org-babe= l-insert-result result result-params info new-hash 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) (lan= g-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-= excursion (goto-char (org-babel-where-is-src-block-result nil info)) (end-o= f-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 ... ... ..= .) (list ...) result)) (funcall cmd body params))) (when (cdr (assoc :file = params)) (when result (with-temp-file (cdr (assoc :file params)) (insert (o= rg-babel-format-result result ...)))) (setq result (cdr (assoc :file params= )))) (org-babel-insert-result result result-params info new-hash indent lan= g) (run-hooks (quote org-babel-after-execute-hook)) result)) (setq call-pro= cess-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-babe= l-current-result-hash))) (body (setf (nth 1 info) (let ((noweb (cdr ...))) = (if (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-= region-original (if (boundp (quote org-babel-call-process-region-original))= org-babel-call-process-region-original (symbol-function (quote call-proces= s-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 (...) (when ... f)))) = (setq cmd (or (lang-check lang) (lang-check (symbol-name ...)) (error "No o= rg-babel-execute function for %s!" lang)))) (if (and (not arg) new-hash (eq= ual 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 lan= g) (if (nth 4 info) (format " (%s)" (nth 4 info)) "")) (setq result ((lambd= a (result) (if ... ... result)) (funcall cmd body params))) (when (cdr (ass= oc :file params)) (when result (with-temp-file (cdr ...) (insert ...))) (se= tq result (cdr (assoc :file params)))) (org-babel-insert-result result resu= lt-params info new-hash indent lang) (run-hooks (quote org-babel-after-exec= ute-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 "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\? (o= rg-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-n= ame-as-directory dir)) default-directory)) (org-babel-call-process-region-o= riginal (if (boundp (quote org-babel-call-process-region-original)) org-bab= el-call-process-region-original (symbol-function (quote call-process-region= )))) (indent (car (last info))) result cmd) (unwind-protect (flet ((call-pr= ocess-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-exc= ursion (goto-char (org-babel-where-is-src-block-result nil info)) (end-of-l= ine 1) (forward-char 1) (setq result (org-babel-read-result)) (message (rep= lace-regexp-in-string "%" "%%" ...)) result) (message "executing %s code bl= ock%s..." (capitalize lang) (if (nth 4 info) (format " (%s)" ...) "")) (set= q result ((lambda ... ...) (funcall cmd body params))) (when (cdr (assoc :f= ile params)) (when result (with-temp-file ... ...)) (setq result (cdr ...))= ) (org-babel-insert-result result result-params info new-hash indent lang) = (run-hooks (quote org-babel-after-execute-hook)) result)) (setq call-proces= s-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 ... p= arams)) (nth 2 info))) (cache\? (and (not arg) (cdr (assoc :cache params)) = (string=3D "yes" (cdr ...)))) (result-params (cdr (assoc :result-params par= ams))) (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-c= all-process-region-original (if (boundp (quote org-babel-call-process-regio= n-original)) org-babel-call-process-region-original (symbol-function (quote= call-process-region)))) (indent (car (last info))) result cmd) (unwind-pro= tect (flet ((call-process-region (&rest args) (apply ... args))) (flet ((la= ng-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 "executi= ng %s code block%s..." (capitalize lang) (if ... ... "")) (setq result (...= ...)) (when (cdr ...) (when result ...) (setq result ...)) (org-babel-inse= rt-result result result-params info new-hash indent lang) (run-hooks (quote= org-babel-after-execute-hook)) result)) (setq call-process-region (quote o= rg-babel-call-process-region-original)))))) > (when (org-babel-confirm-evaluate info) (let* ((lang (nth 0 info)) (par= ams (if params (org-babel-process-params (org-babel-merge-params (nth 2 inf= o) params)) (nth 2 info))) (cache\? (and (not arg) (cdr (assoc :cache param= s)) (string=3D "yes" (cdr (assoc :cache params))))) (result-params (cdr (as= soc :result-params params))) (new-hash (when cache\? (org-babel-sha1-hash i= nfo))) (old-hash (when cache\? (org-babel-current-result-hash))) (body (set= f (nth 1 info) (let ((noweb ...)) (if (and noweb ...) (org-babel-expand-now= eb-references info) (nth 1 info))))) (dir (cdr (assoc :dir params))) (defau= lt-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-fu= nction (quote call-process-region)))) (indent (car (last info))) result cmd= ) (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 ... ...))) (setq cmd (or (lang-check lang) (lang-check ...) (error "No o= rg-babel-execute function for %s!" lang)))) (if (and (not arg) new-hash (eq= ual 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 "%" "%%" ...)) resul= t) (message "executing %s code block%s..." (capitalize lang) (if (nth 4 inf= o) (format " (%s)" ...) "")) (setq result ((lambda ... ...) (funcall cmd bo= dy params))) (when (cdr (assoc :file params)) (when result (with-temp-file = ... ...)) (setq result (cdr ...))) (org-babel-insert-result result result-p= arams info new-hash indent lang) (run-hooks (quote org-babel-after-execute-= hook)) result)) (setq call-process-region (quote org-babel-call-process-reg= ion-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)) (nth 2 info))) (c= ache\? (and (not arg) (cdr (assoc :cache params)) (string=3D "yes" (cdr ...= )))) (result-params (cdr (assoc :result-params params))) (new-hash (when ca= che\? (org-babel-sha1-hash info))) (old-hash (when cache\? (org-babel-curre= nt-result-hash))) (body (setf (nth 1 info) (let (...) (if ... ... ...)))) (= dir (cdr (assoc :dir params))) (default-directory (or (and dir (file-name-a= s-directory dir)) default-directory)) (org-babel-call-process-region-origin= al (if (boundp (quote org-babel-call-process-region-original)) org-babel-ca= ll-process-region-original (symbol-function (quote call-process-region)))) = (indent (car (last info))) result cmd) (unwind-protect (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 r= esult ...) (message ...) result) (message "executing %s code block%s..." (c= apitalize lang) (if ... ... "")) (setq result (... ...)) (when (cdr ...) (w= hen result ...) (setq result ...)) (org-babel-insert-result result result-p= arams info new-hash indent lang) (run-hooks (quote org-babel-after-execute-= hook)) result)) (setq call-process-region (quote org-babel-call-process-reg= ion-original)))))) > org-babel-execute-src-block(nil ("sql" "select getdate()\ngo" ((:colnam= e-names) (:rowname-names) (:result-params "value" "replace") (:result-type = . value) (:comments . "") (:shebang . "") (:cache . "no") (:padline . "") (= :noweb . "no") (:tangle . "no") (:exports . "code") (:results . "value repl= ace") (: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-s= rc-block current-prefix-arg info) t) nil) > (let ((info (org-babel-get-src-block-info))) (if info (progn (org-babel= -eval-wipe-error-buffer) (org-babel-execute-src-block current-prefix-arg in= fo) 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 Eric Schulte http://cs.unm.edu/~eschulte/