From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Hannon Subject: Automatically insert R source code block? Date: Thu, 15 Sep 2011 16:18:39 -0700 (PDT) Message-ID: <1316128719.82446.YahooMailNeo@web161917.mail.bf1.yahoo.com> Reply-To: Michael Hannon Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0-928818530-1316128719=:82446" Return-path: Received: from eggs.gnu.org ([140.186.70.92]:44734) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R4LCc-0000gT-LO for emacs-orgmode@gnu.org; Thu, 15 Sep 2011 19:18:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R4LCb-0004Mn-9m for emacs-orgmode@gnu.org; Thu, 15 Sep 2011 19:18:42 -0400 Received: from nm38-vm7.bullet.mail.bf1.yahoo.com ([72.30.239.23]:39677) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1R4LCb-0004Lt-6l for emacs-orgmode@gnu.org; Thu, 15 Sep 2011 19:18:41 -0400 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: Org-Mode List --0-928818530-1316128719=:82446 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Greetings.=A0 Pardon my ignorance, but I'm having trouble understanding som= e elisp syntax.=0A=0ASome time ago I asked on this list how to use the "<..= ." shortcut to insert a source-code block in upper case (as: BEGIN_SRC= , etc.),=0A=0ASuvayu Ali responded with:=0A=0A=0A(add-to-list 'org-structur= e-template-alist=0A=A0=A0=A0=A0=A0=A0=A0 '("S" "#+BEGIN_SRC ?\n\n#+END_SRC"= "\n\n"))=0A=0A=0Aand this indeed worked just fine = (thanks, Suvayu!).=0A=0A=0ALately most of the source blocks I've been using= have been R source blocks, so I thought I'd just modify the elisp above to= stick the string " R" after the "begin_src" string.=0A=0AHere's an example= of something I tried:=0A=0A=0A(add-to-list 'org-structure-template-alist= =0A=A0=A0=A0=A0=A0=A0=A0 '("r" "#+begin_src R\n\n#+end_src" "\n\n"))=0A=0AThe first part of this works OK; i.e., I do get:=0A= =0A=A0=A0=A0 #+begin_src R=0A=0A=A0=A0=A0 #+end_src=0A=0Abut Emacs complain= s about an "org-mode fontification error" and doesn't give me an executable= R source-code block.=A0 I've tried numerous minor variations on this theme= , but I don't think it's worth wasting your time by listing all of the thra= shing I've done.=A0 The solution is probably obvious to people with a decen= t understanding of elisp.=0A=0A=0AIf you have any suggestions, please send = them to me.=A0 Thanks.=0A=0A-- Mike=0A --0-928818530-1316128719=:82446 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable
Greetings.  Pardon my ig= norance, but I'm having trouble understanding some elisp syntax.
=
Some time ago I asked on this list how to use the "<...&l= t;TAB>" shortcut to insert a source-code block in upper case (as: BEGIN_= SRC, etc.),

Suvayu Ali responded with:

(add-to-list 'org-structure-template-alist
   &nbs= p;    '("S" "#+BEGIN_SRC ?\n\n#+END_SRC" "<src lang=3D\"?= \">\n\n</src>"))

and this indeed work= ed just fine (thanks, Suvayu!).

Lately most of= the source blocks I've been using have been R source blocks, so I thought = I'd just modify the elisp above to stick the string " R" after the "begin_s= rc" string.

Here's an example of something I tried:

(add-to-list 'org-structure-template-a= list
        '("r" "#+begin_src R\n\n= #+end_src" "<src lang=3D\"R\">\n\n</src>"))

The first pa= rt of this works OK; i.e., I do get:

  &= nbsp; #+begin_src R

    #+end_src

but Emacs complains about an "org-mode fontificatio= n error" and doesn't give me an executable R source-code block.  I've = tried numerous minor variations on this theme, but I don't think it's worth= wasting your time by listing all of the thrashing I've done.  The sol= ution is probably obvious to people with a decent understanding of elisp.

If you have any suggestions, please send them t= o me.  Thanks.

-- Mike
= --0-928818530-1316128719=:82446-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: suvayu ali Subject: Re: Automatically insert R source code block? Date: Fri, 16 Sep 2011 01:58:28 +0200 Message-ID: References: <1316128719.82446.YahooMailNeo@web161917.mail.bf1.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([140.186.70.92]:35254) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R4LpT-0004Ab-21 for emacs-orgmode@gnu.org; Thu, 15 Sep 2011 19:58:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R4LpR-0006pi-V5 for emacs-orgmode@gnu.org; Thu, 15 Sep 2011 19:58:51 -0400 Received: from mail-bw0-f41.google.com ([209.85.214.41]:43156) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R4LpR-0006nx-PT for emacs-orgmode@gnu.org; Thu, 15 Sep 2011 19:58:49 -0400 Received: by bkbzs2 with SMTP id zs2so3407312bkb.0 for ; Thu, 15 Sep 2011 16:58:48 -0700 (PDT) In-Reply-To: <1316128719.82446.YahooMailNeo@web161917.mail.bf1.yahoo.com> 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: Michael Hannon Cc: Org-Mode List Hey Mike, On Fri, Sep 16, 2011 at 1:18 AM, Michael Hannon wrote= : > but Emacs complains about an "org-mode fontification error" and doesn't g= ive > me an executable R source-code block.=A0 I've tried numerous minor variat= ions > on this theme, but I don't think it's worth wasting your time by listing = all > of the thrashing I've done.=A0 The solution is probably obvious to people= with > a decent understanding of elisp. > Do you have org-src-fontify-natively set to t? If so I am taking a shot in the dark here, emacs probably doesn't know how to fontify R source. Do you have emacs-ess installed? I would expect an error like this if its not. But I could be wrong here as I don't use either of emacs-ess or R. Hopefully this was of some help. --=20 Suvayu Open source is the future. It sets us free. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Hannon Subject: Re: Automatically insert R source code block? Date: Thu, 15 Sep 2011 17:22:59 -0700 (PDT) Message-ID: <1316132579.54211.YahooMailNeo@web161920.mail.bf1.yahoo.com> References: <1316128719.82446.YahooMailNeo@web161917.mail.bf1.yahoo.com> Reply-To: Michael Hannon Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="-1554234088-1375986538-1316132579=:54211" Return-path: Received: from eggs.gnu.org ([140.186.70.92]:40177) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R4MCr-0006hb-ML for emacs-orgmode@gnu.org; Thu, 15 Sep 2011 20:23:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R4MCq-0003YE-JE for emacs-orgmode@gnu.org; Thu, 15 Sep 2011 20:23:01 -0400 Received: from nm10-vm0.bullet.mail.bf1.yahoo.com ([98.139.213.147]:29156) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1R4MCq-0003Xt-Ew for emacs-orgmode@gnu.org; Thu, 15 Sep 2011 20:23:00 -0400 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: suvayu ali Cc: Org-Mode List ---1554234088-1375986538-1316132579=:54211 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable > From: suvayu ali =0A> =0A> Hey Mike,=0A> =0A= > On Fri, Sep 16, 2011 at 1:18 AM, Michael Hannon wro= te:=0A>> but Emacs complains about an "org-mode fontification error" and do= esn't give=0A>> me an executable R source-code block.=A0 I've tried numerou= s minor variations=0A>> on this theme, but I don't think it's worth wasting= your time by listing all=0A>> of the thrashing I've done.=A0 The solution = is probably obvious to people with=0A>> a decent understanding of elisp.=0A= >>=0A>=0A> Do you have org-src-fontify-natively set to t? If so I am taking= a=0A> shot in the dark here, emacs probably doesn't know how to fontify R= =0A> source. Do you have emacs-ess installed? I would expect an error like= =0A> this if its not.=0A> =0A> But I could be wrong here as I don't use eit= her of emacs-ess or R.=0A=0AHi, Suvayu.=A0 The variable org-src-fontify-nat= ively was set to nil, but I get=0Athe same result with it set to 't'.=0A=0A= I do have Emacs-ess installed.=0A=0AI've been assuming that I was just mess= ing up the syntax, but maybe there's=0Asomething deeper involved.=0A=0AThan= ks for your note.=0A=0A-- Mike ---1554234088-1375986538-1316132579=:54211 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable
> From: suvayu ali <fatkasuv= ayu+linux@gmail.com>
>
> Hey Mike,
>
> On Fri,= Sep 16, 2011 at 1:18 AM, Michael Hannon <jm_hannon@yahoo.com> wrote:=
>> but Emacs complains about an "org-mode fontification error" an= d doesn't give
>> me an executable R source-code block.  I've= tried numerous minor variations
>> on this theme, but I don't thi= nk it's worth wasting your time by listing all
>> of the thrashing= I've done.  The solution is probably obvious to people with
>&g= t; a decent understanding of elisp.
>>
>
> Do you have= org-src-fontify-natively set to t? If so I am taking a
> shot in the= dark here, emacs probably doesn't know how to fontify R
> source. Do= you have emacs-ess installed? I would expect an error like
> this if its not.
>
> But I could be wrong here as I don't use= either of emacs-ess or R.

Hi, Suvayu.  The variable org-src-fo= ntify-natively was set to nil, but I get
the same result with it set to = 't'.

I do have Emacs-ess installed.

I've been assuming that I= was just messing up the syntax, but maybe there's
something deeper invo= lved.

Thanks for your note.

-- Mike



---1554234088-1375986538-1316132579=:54211-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rainer M Krug Subject: Re: Automatically insert R source code block? Date: Fri, 16 Sep 2011 10:49:06 +0200 Message-ID: <4E730D82.2060603@gmail.com> References: <1316128719.82446.YahooMailNeo@web161917.mail.bf1.yahoo.com> <1316132579.54211.YahooMailNeo@web161920.mail.bf1.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([140.186.70.92]:33730) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R4U6n-0001jB-9n for emacs-orgmode@gnu.org; Fri, 16 Sep 2011 04:49:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R4U6h-00016e-DI for emacs-orgmode@gnu.org; Fri, 16 Sep 2011 04:49:17 -0400 Received: from mail-wy0-f180.google.com ([74.125.82.180]:42718) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R4U6h-00016G-8r for emacs-orgmode@gnu.org; Fri, 16 Sep 2011 04:49:11 -0400 Received: by wyj26 with SMTP id 26so4640075wyj.39 for ; Fri, 16 Sep 2011 01:49:09 -0700 (PDT) In-Reply-To: <1316132579.54211.YahooMailNeo@web161920.mail.bf1.yahoo.com> 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: Michael Hannon Cc: Org-Mode List -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 16/09/11 02:22, Michael Hannon wrote: >> From: suvayu ali >> >> Hey Mike, >> >> On Fri, Sep 16, 2011 at 1:18 AM, Michael Hannon >> > wrote: >>> but Emacs complains about an "org-mode fontification error" >>> and > doesn't give >>> me an executable R source-code block. I've tried numerous >>> minor > variations >>> on this theme, but I don't think it's worth wasting your time >>> by > listing all >>> of the thrashing I've done. The solution is probably obvious >>> to > people with >>> a decent understanding of elisp. >>> >> >> Do you have org-src-fontify-natively set to t? If so I am taking >> a shot in the dark here, emacs probably doesn't know how to >> fontify R source. Do you have emacs-ess installed? I would expect >> an error like this if its not. >> >> But I could be wrong here as I don't use either of emacs-ess or >> R. > > Hi, Suvayu. The variable org-src-fontify-natively was set to nil, > but I get the same result with it set to 't'. > > I do have Emacs-ess installed. > > I've been assuming that I was just messing up the syntax, but maybe > there's something deeper involved. > > Thanks for your note. Don't worry - try to insert the > -- Mike > > > - -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Stellenbosch University South Africa Tel : +33 - (0)9 53 10 27 44 Cell: +33 - (0)6 85 62 59 98 Fax : +33 - (0)9 58 10 27 44 Fax (D): +49 - (0)3 21 21 25 22 44 email: Rainer@krugs.de Skype: RMkrug -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk5zDYIACgkQoYgNqgF2egr3cACdG2UdRP9ykebSD6f746C3h3CQ uv4AnA+8KjVna9H5jkllrvM1L9GM0tlK =nnRu -----END PGP SIGNATURE-----