From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Davison Subject: Re: Re: [babel] Executing sh-code Date: Fri, 27 Nov 2009 14:46:39 -0500 Message-ID: <877htb4uow.fsf@stats.ox.ac.uk> References: <87k4xey99s.fsf@mundaneum.com> <200911271900.08393.torsten.wagner@googlemail.com> <87ws1cgsd6.fsf@mundaneum.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NE6mY-0005zr-BF for emacs-orgmode@gnu.org; Fri, 27 Nov 2009 14:47:06 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NE6mT-0005tn-9o for emacs-orgmode@gnu.org; Fri, 27 Nov 2009 14:47:05 -0500 Received: from [199.232.76.173] (port=60380 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NE6mT-0005tY-3p for emacs-orgmode@gnu.org; Fri, 27 Nov 2009 14:47:01 -0500 Received: from markov.stats.ox.ac.uk ([163.1.210.1]:63508) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NE6mS-0008NV-Mr for emacs-orgmode@gnu.org; Fri, 27 Nov 2009 14:47:01 -0500 In-Reply-To: <87ws1cgsd6.fsf@mundaneum.com> (=?utf-8?Q?=22S=C3=A9bastien?= Vauban"'s message of "Fri, 27 Nov 2009 11:43:49 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: =?utf-8?Q?S=C3=A9bastien?= Vauban Cc: emacs-orgmode@gnu.org S=C3=A9bastien Vauban writes: > Hi Torsten, > > Torsten Wagner wrote: >> I just tried quickly. I use org-babel with python, up to now never with >> shell scripting. >> >>> --8<---------------cut here---------------start------------->8--- >>> * Prerequisites >>>=20 >>> #+begin_src sh :session ecm >>> cd ~/Personal >>> #+end_src >>> --8<---------------cut here---------------end--------------->8--- >> >> This works for me (I changed the folder name). There is a error line in = my >> message buffer: >> >> executing Shell source code block >> ~/babel=20 >> save-current-buffer: Wrong type argument: char-or-string-p, nil >> >> but the relevent part runs ok. My shell buffer depict to the new folder >> after execution: >> >> torsten@gaijin ~ %=20 >> cd ~/babel >> echo 'org_babel_sh_eoe' >> torsten@gaijin ~ % cd ~/babel >> torsten@gaijin ~/babel (git)-[master] % Hi Seb, I'm also seeing problems with shell session evaluation but having trouble debugging. My current suspicion is that the prompt characters are the problem here (something which differs between you and Torsten) Could you try using a prompt that ends in '% '? E.g. on ubuntu at least I can set the prompt in emacs shell sessions with a line like PS1=3D'\w % ' in ~/.emacs_bash. Also, please pull latest git as we have just fixed an unrelated bug in shell session-based evaluation. Dan >> >> >> I used the same init like you >> >>> What am I doing wrong? Or have I set something wrong (or missing) in my >>> .emacs file? >>>=20 >>> --8<---------------cut here---------------start------------->8--- >>> (require 'org-babel-init) >>>=20 >>> ;; activate a subset of languages >>> (require 'org-babel-R) >>> (require 'org-babel-sh) >>>=20 >>> ;; make pre-built helper functions available >>> (org-babel-load-library-of-babel) >>> --8<---------------cut here---------------end--------------->8--- >> >> However I didn't use the (org-babel-load-library-of-babel) function. > > I removed it. No change. > > >> Which version of org-mode di you use ? > > A version of somewhere last week. > > >> org-babel is young and change still heavily. I guess you have to use the >> latest git-version of org-mode. > > Just did: > > git pull > make clean > make > > No change (after Emacs restart). > > >> Furthermore, does the shell iteself (M-x shell) work in emacs as desired= ? > > Yep. > > Though, there is one blank line in front: > > > [sva@mundaneum] ~> > ^ cursor blinking here > > I don't know if that's worth mentionning... > > Tried as well this change: > > ;; for single shell commands > (setq shell-file-name "zsh") > > Same problem (after Emacs restart). > > >> Sorry not a big help at least a pointer that it should work... > > Thanks anyway. It's helpful to know someone gets it working the same way = (at > least, from a first observation). > > Just note that the following works well: > > #+begin_src sh > cd ~/Personal > ls *.org > #+end_src > > #+results: > | "Bookmarks.org" | > | "Home.org" | > | "refile.org" | > | "Scorpios.org" | > | "Succession.org" | > | "Tickler.org" | > | "Using-startx-for-Remote-Display.org" | > | "Voice-over-IP.org" | > > It stops working only when I add `:session "whatever"' after the `sh' > specification. > > That's the only difference between when it works and when it doesn't. > > Maybe this can help? > > Best regards, > Seb