From mboxrd@z Thu Jan 1 00:00:00 1970 From: Austin Frank Subject: Re: org-export-sweave Date: Wed, 17 Sep 2008 14:44:02 -0400 Message-ID: References: <25FF1422-4BCE-4C55-B780-C8233ED9B4F7@uva.nl> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1863614480==" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kg20s-0001Yl-9Y for emacs-orgmode@gnu.org; Wed, 17 Sep 2008 14:44:30 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kg20q-0001YW-Rp for emacs-orgmode@gnu.org; Wed, 17 Sep 2008 14:44:30 -0400 Received: from [199.232.76.173] (port=47933 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kg20q-0001YT-OD for emacs-orgmode@gnu.org; Wed, 17 Sep 2008 14:44:28 -0400 Received: from main.gmane.org ([80.91.229.2]:44772 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Kg20q-0006Dt-AY for emacs-orgmode@gnu.org; Wed, 17 Sep 2008 14:44:28 -0400 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1Kg20m-0003MO-NK for emacs-orgmode@gnu.org; Wed, 17 Sep 2008 18:44:24 +0000 Received: from colossus.cvs.rochester.edu ([128.151.80.181]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 17 Sep 2008 18:44:24 +0000 Received: from austin.frank by colossus.cvs.rochester.edu with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 17 Sep 2008 18:44:24 +0000 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@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --===============1863614480== Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Carsten-- Thanks for the response! On Tue, Sep 16 2008, Carsten Dominik wrote: > since you want to include tis code literally into LaTeX, the best is > probably to encapsulate it into > > #+BEGIN_LATEX .... #+END_LATEX > > and to try to solve only the local editing issue. Yes, this makes sense. Though, since really all I need to do is wrap source code written in R in a \LaTeX environment, I might also like to use #v+ #+LATEX: \begin{Scode} a <- 3 a #+LATEX: \end{Scode} #v- > Take a look at the function org-edit-src-find-region-and-lang. There > is a list of regular expressions that can be used to identify regions > that should be edited in special modes - maybe I can make this list > extensible - first, give it a try and see if you can get it working by > editing the list. While I think opening up this list to customization is probably a good idea, I could not get my new entries to behave the way I wanted. The problem, I suspect, may have to do with the ordering of the different language environments. Suppose I had #v+ #+BEGIN_LATEX \begin{Scode} a <- 3 a \end{Scode} #+END_LATEX #v- in an org file. I guess that I want the code within the Scode environment to me in r-mode, and the code outside of that but still within the LATEX block to be in LaTeX-mode. In what order should these two definitions appear within the re-list? FWIW, attached is a patch of the setup I tried to use. When I hit C-c ' inside either of the above examples, I get a temporary buffer that's in latex-mode. I was hoping to get a temporary buffer in r-mode. I also tried a version of the code that used the same entries in the re-list, but put them at the bottom, under the entries for ascii. Same results. Thanks for any further advice, /au --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=org-sweave.patch diff --git a/lisp/org.el b/lisp/org.el index 4b29704..0612653 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -5562,6 +5562,8 @@ the language, a switch telling of the content should be in a single line." ("^#\\+begin_example.*\n" "^#\\+end_example" "fundamental") ("^#\\+html:" "\n" "html" single-line) ("^#\\+begin_html.*\n" "\n#\\+end_html" "html") + ("^\\s*\\\\begin{scode}" "^\\s*\\\\end{scode}" "r") + ("^#\\+latex:\\s*\\\\begin{scode}" "^#\\+latex:\\s*\\\\end{scode}" "r") ("^#\\+begin_latex.*\n" "\n#\\+end_latex" "latex") ("^#\\+latex:" "\n" "latex" single-line) ("^#\\+begin_ascii.*\n" "\n#\\+end_ascii" "fundamental") --=-=-= Content-Transfer-Encoding: quoted-printable =2D-=20 Austin Frank http://aufrank.net GPG Public Key (D7398C2F): http://aufrank.net/personal.asc --=-=-=-- --==-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Darwin) iEYEARECAAYFAkjRT/IACgkQlHMl2/XbR4F6KgCg0OFqnC1JVzLEBq09f3bHhidA JzEAn1iBhfoQcG5eASUWaVZ9wWLFqAQj =GUvl -----END PGP SIGNATURE----- --==-=-=-- --===============1863614480== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --===============1863614480==--