emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orgmode] Re: [babel] Executing sh-code


From: Sébastien Vauban
Subject: [Orgmode] Re: [babel] Executing sh-code
Date: Fri, 04 Dec 2009 14:25:16 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux)

Hi Eric,

"Eric Schulte" wrote:
> Sébastien Vauban <address@hidden> writes:
>>>>
>>>> #+begin_src sh :session "ecm"
>>>> ls *.org
>>>> #+end_src

Nothing to do with the problem, but better to write `:session ecm' than
`:session "ecm"', no?


>>>> I C-c C-c the first snippet. Nothing special, except it doesn't hang
>>>> anymore. Second snippet. C-c C-c. There, it still hangs ;-((
>>
>> [...]
>>
>>> So the fix here is to fix the value of the `comint-prompt-regexp'
>>> variable in your shell.  Org-babel uses this variable to digest output
>>> from the shell.  I have mine set with the following
>>>
>>> (defun schulte/set-shell-prompt-regexp ()
>>>   (setq comint-prompt-regexp "^\(.+\)"))
>>> (add-hook 'shell-mode-hook 'schulte/set-shell-prompt-regexp)
>>
>> I've put that in my .emacs file, as you can see (when asking for its value in
>> the shell buffer):
>
> I'm sorry I wasn't clear in my earlier email.  You will need to craft
> your own regexp to replace "^\(.+\)" in the above code.  This is because
> you will need to match your own prompt as it appears in your *shell*
> buffers locally.  This would be the product of your personal .bashrc or
> .zshrc prompt configuration.  The example I pasted above matches my own
> prompt which has a non-standard
>
> ( ~ )
>
> style.
>
>>> You'll have to change the regexp ("^\(.+\)" in my example) to match your
>>> prompt.
>>
>> Nope. Because I'm using your prompt, as you can see in the above shell
>> session.
>
> Nope, I use a different prompt.  To match a prompt like what you have
> above you'd want to use something like closer to the default value of
> "^[^#$%>\n]*[#$%>] *".  Sorry for the confusion here.

Okaaayy. Did not look enough at the regexp... Sorry.


> [...] The following works for me without any hang.
> The only difference I can see between our setups is a matching prompt
> regexp.

That was it. Fixing my PS1 prompt to be like yours (temporarily keeping your
regexp from the comint-prompt) *did* solve the problem.

> #+begin_src sh :session eric
>   cd ~/Desktop/clj/
>   ls *.clj
> #+end_src
>
> #+results:
> | "ants.clj" | "" | "concurrent.clj" | "" | "hello.clj" | "" | 
> "spell-checker.clj" |

Similar results for my directory.

Thanks a lot!!!

Best regards,
  Seb

-- 
Sébastien Vauban





reply via email to

[Prev in Thread] Current Thread [Next in Thread]