emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Dan Davison <davison@stats.ox.ac.uk>
To: "Sébastien Vauban" <wxhgmqzgwmuf@spammotel.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Re: [babel] Executing sh-code
Date: Fri, 27 Nov 2009 14:46:39 -0500	[thread overview]
Message-ID: <877htb4uow.fsf@stats.ox.ac.uk> (raw)
In-Reply-To: <87ws1cgsd6.fsf@mundaneum.com> ("Sébastien Vauban"'s message of "Fri, 27 Nov 2009 11:43:49 +0100")

Sébastien Vauban <wxhgmqzgwmuf@spammotel.com> 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
>>> 
>>> #+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 
>> 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 ~ % 
>> 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='\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?
>>> 
>>> --8<---------------cut here---------------start------------->8---
>>> (require 'org-babel-init)
>>> 
>>> ;; activate a subset of languages
>>> (require 'org-babel-R)
>>> (require 'org-babel-sh)
>>> 
>>> ;; 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

  parent reply	other threads:[~2009-11-27 19:47 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-25 14:22 [babel] Executing sh-code Sébastien Vauban
2009-11-27  9:15 ` Sébastien Vauban
2009-11-27 10:46   ` Eric S Fraga
2009-11-27 10:00 ` Torsten Wagner
2009-11-27 10:43   ` Sébastien Vauban
2009-11-27 19:32     ` Eric Schulte
2009-11-27 19:46     ` Dan Davison [this message]
2009-11-29 21:03       ` Sébastien Vauban
2009-11-30 15:44         ` Eric Schulte
2009-11-30 16:02           ` Nick Dokos
2009-11-30 16:16             ` Eric Schulte
2009-12-01  8:37               ` Sébastien Vauban
2009-12-01 10:01           ` Sébastien Vauban
2009-12-02 19:09             ` Eric Schulte
2009-12-04 13:25               ` Sébastien Vauban
2009-12-04 14:09                 ` Sébastien Vauban
2009-12-04 17:04                   ` Eric Schulte
2009-12-07  1:10                   ` Torsten Wagner
2009-12-07  9:59                     ` Sébastien Vauban
2009-12-04 17:03                 ` Eric Schulte
2009-12-02 14:55           ` Sébastien Vauban
2009-12-02 20:16             ` Eric Schulte
2009-12-03  9:27               ` Sébastien Vauban
2009-12-03 16:06                 ` Eric Schulte

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877htb4uow.fsf@stats.ox.ac.uk \
    --to=davison@stats.ox.ac.uk \
    --cc=emacs-orgmode@gnu.org \
    --cc=wxhgmqzgwmuf@spammotel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).