From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paul Burkander Subject: Re: export literal examples font-lock: ess-mode Date: Fri, 17 Aug 2012 11:33:03 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=bcaec54fb0c03bdaa504c777e072 Return-path: Received: from eggs.gnu.org ([208.118.235.92]:52344) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T2OXq-00056K-I0 for Emacs-orgmode@gnu.org; Fri, 17 Aug 2012 11:33:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T2OXp-0004Rm-3J for Emacs-orgmode@gnu.org; Fri, 17 Aug 2012 11:33:06 -0400 Received: from mail-vb0-f41.google.com ([209.85.212.41]:58163) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T2OXo-0004Rg-UM for Emacs-orgmode@gnu.org; Fri, 17 Aug 2012 11:33:05 -0400 Received: by vbkv13 with SMTP id v13so3952295vbk.0 for ; Fri, 17 Aug 2012 08:33:04 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Ista Zahn Cc: Paul , Emacs-orgmode@gnu.org --bcaec54fb0c03bdaa504c777e072 Content-Type: text/plain; charset=ISO-8859-1 ah! for some reason capitalizing BEGIN_SRC seems to have been causing problems. Thanks for your help! On Fri, Aug 17, 2012 at 11:12 AM, Ista Zahn wrote: > On Fri, Aug 17, 2012 at 9:23 AM, Paul wrote: > > I write do-files for Stata code in emacs using ESS, which marks up my > > code and sends it to a comint-mode buffer for evaluation. I'd like to > > include some source code in an org file, as in the below examle: > > > > #+begin_src -n > > foreach var of varlist _all{ > > rename `var' new_`var' > > } > > #+end_src > > > > I have a couple of questions: > > How can I use ess fontification in this snippet > > #+begin_src stata > foreach var of varlist _all{ > rename `var' new_`var' > } > #+end_src > > works for me. > > and in the file to > > which I export? > > I think this depends on your export target. It should "just work" for > html, but pdf will be more work. > > The manual says I "need to specify the name of the > > major mode," however including "#+begin_src ess -n" results in the > > following error "org-edit-src-code: No such language mode: nil-mode." > > I've tried using ess-mode, and anything else I can think of, to no > > avail. What should I include? > > I think "#+begin_src stata" is correct. > > > > > Also, assuming I'm able to get the fontification to work, is there a > > way to customize it for exporting? > > > > Finally, org-babel looks tremendously useful. Is there a way to > > harness it's capabilities for an unsupported language like Stata's? > > C-c ' will open a temporary buffer in ess mode so you can edit and run > the code using ess, and tangling will work as expected. The only thing > you need babel support for is actually running the code in org-mode > and inserting the results block. > > I've made weak attempts to add stata support to babel, but my > elisp-foo is not strong enough. > > > > > Thanks to everyone who read this through, and in particular to anyone > > who can help! > > Paul > > > --bcaec54fb0c03bdaa504c777e072 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable ah! for some reason capitalizing BEGIN_SRC seems to have been causing probl= ems.=A0

Thanks for your help!

On = Fri, Aug 17, 2012 at 11:12 AM, Ista Zahn <istazahn@gmail.com> wrote:
On Fri, Aug 17, 2012 at 9:= 23 AM, Paul <paulburk314@gmail.= com> wrote:
> I write do-files for Stata code in emacs using ESS, which marks up my<= br> > code and sends it to a comint-mode buffer for evaluation. =A0I'd l= ike to
> include some source code in an org file, as in the below examle:
>
> #+begin_src -n
> foreach var of varlist _all{
> =A0 =A0 =A0rename `var' new_`var'
> }
> #+end_src
>
> I have a couple of questions:
> How can I use ess fontification in this snippet

#+begin_src stata
=A0 foreach var of varlist _all{
=A0 =A0 rename `var' new_`var'
=A0 }
#+end_src

works for me.

and in the file to
> which I export?

I think this depends on your export target. It should "just work= " for
html, but pdf will be more work.

=A0 The manual says I "need to specify the name of the
> major mode," however including "#+begin_src ess -n" res= ults in the
> following error "org-edit-src-code: No such language mode: nil-mo= de."
> I've tried using ess-mode, and anything else I can think of, to no=
> avail. =A0What should I include?

I think "#+begin_src stata" is correct.

>
> Also, assuming I'm able to get the fontification to work, is there= a
> way to customize it for exporting?
>
> Finally, org-babel looks tremendously useful. =A0Is there a way to
> harness it's capabilities for an unsupported language like Stata&#= 39;s?

C-c ' will open a temporary buffer in ess mode so you can edit an= d run
the code using ess, and tangling will work as expected. The only thing
you need babel support for is actually running the code in org-mode
and inserting the results block.

I've made weak attempts to add stata support to babel, but my
elisp-foo is not strong enough.

>
> Thanks to everyone who read this through, and in particular to anyone<= br> > who can help!
> Paul
>

--bcaec54fb0c03bdaa504c777e072--