From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?S=C3=A9bastien_Vauban?= Subject: Re: [babel] Executing sh-code Date: Fri, 04 Dec 2009 14:25:16 +0100 Message-ID: <87k4x2yipv.fsf@mundaneum.com> References: <87k4xey99s.fsf@mundaneum.com> <200911271900.08393.torsten.wagner@googlemail.com> <87ws1cgsd6.fsf@mundaneum.com> <877htb4uow.fsf@stats.ox.ac.uk> <87638tnivd.fsf@mundaneum.com> <87iqcr9fo3.fsf@mundaneum.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: 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-mXXj517/zsQ@public.gmane.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: emacs-orgmode-mXXj517/zsQ@public.gmane.org Hi Eric, "Eric Schulte" wrote: > S=C3=A9bastien Vauban 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=C2=A0;-(( >> >> [...] >> >>> 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 val= ue 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-che= cker.clj" | Similar results for my directory. Thanks a lot!!! Best regards, Seb --=20 S=C3=A9bastien Vauban _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode-mXXj517/zsQ@public.gmane.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode