From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander Vorobiev Subject: Re: org mode R remote code evaluation Date: Wed, 25 Sep 2013 15:36:05 -0500 Message-ID: References: <87d2ownbtv.fsf@hornfels.zedat.fu-berlin.de> <87r4ce2x8k.fsf@gmx.de> <87mwn22vy8.fsf@gmx.de> <878uymyser.fsf@gmx.de> <87y56li3je.fsf@gmx.de> <87mwn0u5sh.fsf@gmail.com> <87wqm4yb8w.fsf@gmx.de> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7b5d43501a618d04e73b359d Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58792) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VOvoz-0002ON-UT for emacs-orgmode@gnu.org; Wed, 25 Sep 2013 16:36:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VOvoy-0005Ki-Eg for emacs-orgmode@gnu.org; Wed, 25 Sep 2013 16:36:29 -0400 Received: from mail-pd0-x22c.google.com ([2607:f8b0:400e:c02::22c]:64043) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VOvoy-0005Ka-2Z for emacs-orgmode@gnu.org; Wed, 25 Sep 2013 16:36:28 -0400 Received: by mail-pd0-f172.google.com with SMTP id z10so180190pdj.3 for ; Wed, 25 Sep 2013 13:36:26 -0700 (PDT) In-Reply-To: <87wqm4yb8w.fsf@gmx.de> 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: Michael Albinus Cc: Loris Bennett , emacs-orgmode , Johannes Rainer , Eric Schulte --047d7b5d43501a618d04e73b359d Content-Type: text/plain; charset=ISO-8859-1 Michael, I found that the patch doesn't work for sql code blocks. Here is an example * this works #+BEGIN_SRC sh :results output :dir /grid: ls #+END_SRC * this doesn't work #+BEGIN_SRC sql :engine postgresql :dir /grid: :results output select 1+2 as three; #+END_SRC and here is what appears in *Messages*: executing Sh code block... Tramp: Encoding region using function `base64-encode-region'...done Tramp: Decoding region into remote file /plinkx:grid:/tmp/ob-input-7928Z4Q...done Tramp: Encoding region using function `base64-encode-region'...done Tramp: Decoding region into remote file /plinkx:grid:/tmp/ob-error-7928zMd...done Tramp: Encoding region using function `base64-encode-region'...done Tramp: Decoding region into remote file /plinkx:grid:/tmp/ob-input-7928Z4Q...done Wrote /plinkx:grid:/tmp/ob-input-7928Z4Q Code block evaluation complete. executing Sql code block... Tramp: Encoding region using function `base64-encode-region'...done Tramp: Decoding region into remote file /plinkx:grid:/tmp/sql-in-7928arv...done Tramp: Encoding region using function `base64-encode-region'...done Tramp: Decoding region into remote file /plinkx:grid:/tmp/sql-out-7928Z_E...done Tramp: Encoding region using function `base64-encode-region'...done Tramp: Decoding region into remote file /plinkx:grid:/tmp/sql-in-7928arv...done psql -A -F " " -f "c:/tmp/sql-in-7928arv" -o "c:/tmp/sql-out-7928Z_E" -f c:/tmp/sql-in-7928arv -o c:/tmp/sql-out-7928Z_E No such file or directory 'c:/tmp/sql-in-7928arv' Tramp: Inserting `/plinkx:grid:/tmp/sql-out-7928Z_E'... Tramp: Encoding remote file /plinkx:grid:/tmp/sql-out-7928Z_E...done Tramp: Decoding remote file /plinkx:grid:/tmp/sql-out-7928Z_E with function base64-decode-region... Wrote c:/Users/avorobi/AppData/Local/Temp/tramp.7928AeX Tramp: Decoding remote file /plinkx:grid:/tmp/sql-out-7928Z_E with function base64-decode-region...done Tramp: Inserting `/plinkx:grid:/tmp/sql-out-7928Z_E'...done So shell commands work but the arguments passed to psql have "c:" at the beginning. Thanks Alex On Wed, Sep 25, 2013 at 2:03 PM, Michael Albinus wrote: > Eric Schulte writes: > > > I'd rather not hard-code the value of "/tmp/". Perhaps you could rework > > the patch so that it introduces a new customizable variable (including a > > documentation string) so that users can set the value for their system. > > Will do, tomorrow. I would even prefer a more general solution, a new > function which returns a ("the") temp directory on a remote host. This > would be useful also outside org-mode. But this would require changes in > Emacs/Tramp, which won't be applicable for org immediately (backwards > compatibility, and alike). > > > If you can keep the patch under 15LOC we can include it w/o requiring > > FSF copyright assignment, otherwise see [1] for contribution details. > > No problem. As Tramp maintainer, I have signed the FSF papers for Emacs > 10+ years ago. This shall be valid also for org patches. > > > Thanks, > > Best regards, Michael. > --047d7b5d43501a618d04e73b359d Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Michael,

I found that the patch doesn&#= 39;t work for sql code blocks. Here is an example=A0

* this works
#+BEGIN_SRC sh :results output :dir /grid:
=A0 ls
#+END_SRC

* this doesn't= work
#+BEGIN_SRC sql :engine postgresql :dir /grid: :results out= put
=A0 select 1+2 as three;
#+END_SRC

and here is what appears in *Messages*:

= executing Sh code block...
Tramp: Encoding region using function = `base64-encode-region'...done
Tramp: Decoding region into rem= ote file /plinkx:grid:/tmp/ob-input-7928Z4Q...done
Tramp: Encoding region using function `base64-encode-region'...don= e
Tramp: Decoding region into remote file /plinkx:grid:/tmp/ob-er= ror-7928zMd...done
Tramp: Encoding region using function `base64-= encode-region'...done
Tramp: Decoding region into remote file /plinkx:grid:/tmp/ob-input-792= 8Z4Q...done
Wrote /plinkx:grid:/tmp/ob-input-7928Z4Q
Co= de block evaluation complete.
executing Sql code block...
Tramp: Encoding region using function `base64-encode-region'...don= e
Tramp: Decoding region into remote file /plinkx:grid:/tmp/sql-i= n-7928arv...done
Tramp: Encoding region using function `base64-en= code-region'...done
Tramp: Decoding region into remote file /plinkx:grid:/tmp/sql-out-7928= Z_E...done
Tramp: Encoding region using function `base64-encode-r= egion'...done
Tramp: Decoding region into remote file /plinkx= :grid:/tmp/sql-in-7928arv...done
psql -A =A0-F " " =A0-f "c:/tmp/sql-in-7928arv" -o "c:/tmp/sql-out-792= 8Z_E"=A0
-f c:/tmp/sql-in-7928arv -o c:/tmp/sql-out-7928Z_E<= /div>
No such file or directory 'c:/tmp/sql-in-7928arv'
Tramp: = Inserting `/plinkx:grid:/tmp/sql-out-7928Z_E'...
Tramp: Encod= ing remote file /plinkx:grid:/tmp/sql-out-7928Z_E...done
Tramp: D= ecoding remote file /plinkx:grid:/tmp/sql-out-7928Z_E with function base64-= decode-region...
Wrote c:/Users/avorobi/AppData/Local/Temp/tramp.7928AeX
Tram= p: Decoding remote file /plinkx:grid:/tmp/sql-out-7928Z_E with function bas= e64-decode-region...done
Tramp: Inserting `/plinkx:grid:/tmp/sql-= out-7928Z_E'...done

So shell commands work but the arguments passed t= o psql have "c:" at the beginning.

Thank= s
Alex



On Wed, Sep 25, 2013 at 2:03 PM, Michael= Albinus <michael.albinus@gmx.de> wrote:
Eric Schulte <schulte.eric@gmail.com> writes:

> I'd rather not hard-code the value of "/tmp/". =A0Perhap= s you could rework
> the patch so that it introduces a new customizable variable (including= a
> documentation string) so that users can set the value for their system= .

Will do, tomorrow. I would even prefer a more general solution, a new=
function which returns a ("the") temp directory on a remote host.= This
would be useful also outside org-mode. But this would require changes in Emacs/Tramp, which won't be applicable for org immediately (backwards compatibility, and alike).

> If you can keep the patch under 15LOC we can include it w/o requiring<= br> > FSF copyright assignment, otherwise see [1] for contribution details.<= br>
No problem. As Tramp maintainer, I have signed the FSF papers for Ema= cs
10+ years ago. This shall be valid also for org patches.

> Thanks,

Best regards, Michael.

--047d7b5d43501a618d04e73b359d--