From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?S=C3=A9bastien_Vauban?= Subject: Executing sh-code Date: Fri, 15 Oct 2010 18:06:12 +0200 Message-ID: <80fww7785n.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, * Executing sh code This report is not complete yet (I now really have to go), but comments are already welcome, and can put things in light for further study... ** No session #+begin_src sh echo In $(pwd): ls *.org #+end_src #+results: | In | /cygdrive/c/home/sva/Examples/Org-scraps: | | Agenda-Sorting-Strategy.org | | | Clock-Report.org | | | Ledger-Scorpios.org | | | org-beamer-fpu-rules.org | | | org-hist.org | | ** With session #+begin_src sh :session sva echo In $(pwd): ls *.org #+end_src never terminates, echoing: : executing Sh code block... in the minibuffer. ** Variable comint-prompt-regexp Value of the =3Dcomint-prompt-regexp=3D variable in my shell, used by Org-b= abel to digest output from the shell: #+begin_src emacs-lisp (switch-to-buffer "sva") (describe-variable 'comint-prompt-regexp) #+end_src #+results: #+begin_example comint-prompt-regexp is a variable defined in `comint.el'. Its value is=20 "^[^#$%>\n]*[#$%>] *" Local in buffer sva; global value is "^" Documentation: Regexp to recognize prompts in the inferior process. Defaults to "^", the null string at BOL. This variable is only used if the variable `comint-use-prompt-regexp' is non-nil. Good choices: Canonical Lisp: "^[^> \n]*>+:? *" (Lucid, franz, kcl, T, cscheme, oaklisp) Lucid Common Lisp: "^\\(>\\|\\(->\\)+\\) *" franz: "^\\(->\\|<[0-9]*>:\\) *" kcl: "^>+ *" shell: "^[^#$%>\n]*[#$%>] *" T: "^>+ *" This is a good thing to set in mode hooks. #+end_example This regexp should match my own prompt as it appears in your *shell* buffers locally (product of my personal =3D.bashrc=3D) configuration. ** What about shell-prompt-pattern? Browsing along, it seems there is another interesting value to look at: =3Dshell-prompt-pattern=3D. #+begin_src emacs-lisp (switch-to-buffer "sva") (describe-variable 'shell-prompt-pattern) #+end_src #+results: #+begin_example shell-prompt-pattern is a variable defined in `shell.el'. Its value is=20 "^MEDIACENTER [^ ]+ \\[[0-9]+\\] " Documentation: Regexp to match prompts in the inferior shell. Defaults to "^[^#$%>\n]*[#$%>] *", which works pretty well. This variable is used to initialize `comint-prompt-regexp' in the shell buffer. If `comint-use-prompt-regexp' is nil, then this variable is only used to determine paragraph boundaries. See Info node `Shell Prompts' for how Shell mode treats paragraphs. The pattern should probably not match more than one line. If it does, Shell mode may become confused trying to distinguish prompt from input on lines which don't start with a prompt. This is a fine thing to set in your `.emacs' file. You can customize this variable. #+end_example ** Back to comint's prompt regexp! #+begin_src emacs-lisp (switch-to-buffer "sva") (describe-variable 'comint-use-prompt-regexp) #+end_src #+results: #+begin_example comint-use-prompt-regexp is a variable defined in `comint.el'. Its value is nil Documentation: If non-nil, use `comint-prompt-regexp' to recognize prompts. If nil, then program output and user-input are given different `field' properties, which Emacs commands can use to distinguish them (in particular, common movement commands such as `beginning-of-line' respect field boundaries in a natural way). You can customize this variable. #+end_example NIL!? Do you have this as well? Thanks! 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