From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Davison Subject: can't get source code editing working Date: Sun, 25 May 2008 21:04:08 +0100 Message-ID: <20080525200408.GA28173@stats.ox.ac.uk> References: <48398dc2.1235640a.21e3.ffffbe00SMTPIN_ADDED@mx.google.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K0MRy-00055w-F1 for emacs-orgmode@gnu.org; Sun, 25 May 2008 16:04:14 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K0MRx-00055g-P9 for emacs-orgmode@gnu.org; Sun, 25 May 2008 16:04:14 -0400 Received: from [199.232.76.173] (port=52796 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K0MRx-00055d-J1 for emacs-orgmode@gnu.org; Sun, 25 May 2008 16:04:13 -0400 Received: from markov.stats.ox.ac.uk ([163.1.210.1]:35061) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1K0MRx-00029A-Ao for emacs-orgmode@gnu.org; Sun, 25 May 2008 16:04:13 -0400 Received: from blackcap.stats.ox.ac.uk (blackcap.stats [163.1.210.5]) by markov.stats.ox.ac.uk (8.13.6/8.13.6) with ESMTP id m4PK49Y5009567 for ; Sun, 25 May 2008 21:04:09 +0100 (BST) Content-Disposition: inline In-Reply-To: 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 On Sun, May 25, 2008 at 10:25:22AM -0600, Charles Martin wrote: > On Sun, May 25, 2008 at 10:00 AM, wrote: > > > Editing source code example in the proper mode > > ---------------------------------------------- > > > > If you are writing a document with source code examples, you can > > include these examples into a `#+BEGIN_SRC lang ... #+END_SRC' or > > (with the org-mtags module loaded) a ` > stands for the Emacs mode used for editing the language, this > > could be `emacs-lisp' for Emacs Lisp mode examples, or `org' for > > Org mode examples. You can now use the key "C-c '" (that is C-c > > followed by the single quote) to edit the example in its native > > mode. This works by creating an indirect buffer, narrowing it to > > the example and setting the appropriate mode. You need to exit > > editing by killing that indirect buffer, with `C-x k'. This is > > important, because lines that have syntactic meaning in Org will > > be quoted when the indirect buffer is killed. <...> > > > > Message: 4 > > Date: Sun, 25 May 2008 08:41:54 -0400 > > From: Austin Frank > > Subject: [Orgmode] Re: Org mode release 6.04 > > To: emacs-orgmode@gnu.org > > Message-ID: > > Content-Type: text/plain; charset="us-ascii" > > > > On Sun, May 25 2008, Carsten Dominik wrote: > > > > > This is a phenomenally exciting addition. Combining this with the > > htmlized code examples in html export, and the option for \LaTeX export, > > org has clearly just vaulted past the rest of the field for literate > > programming. I agree, this sounds great. I was just about to start trying to combine org and latex usage in any case. However I'm being dense. I've done git pull && make && make install, and I have org-version equal to 6.04b. OK so far, right? Now I create an org file containing * section 1 #+BEGIN_SRC latex \log p(z|x,\theta) #+END_SRC * section 2 #+BEGIN_SRC r xor <- function(a,b) (a | b) & !(a & b) #+END_SRC * section 3 #+BEGIN_SRC emacs-lisp (defun org-xor (a b) "Exclusive or." (if a (not b) b)) #+END_SRC but despite repeated invocations of /C-c '/ and org-edit-special and org-edit-src-example, with point in various places, I haven't brought up a narrowed buffer in the requested mode. Instead I get C-c ' can do nothing useful here. (from C-c ' and org-edit-special) and silence from org-edit-src-example I'm sure I'm being stupid, could someone tell me how? I'm also a heavy R user, so I liked Austin's suggestion of combining org with Sweave / Rnw files and look forward to further developments. I might have a go myself if I can get beyond step 1 here. Sweave/Rnw files can get really ugly and cumbersome and merely org-style outlining and folding would be excellent, though I bet it can go much further than that. Austin -- it would be well worth CC'ing any developments on that front to the ESS (Emacs Speaks Statistics) mailing list. > > Austin, could you point us to the tools you plan to use for code weaving? See http://www.r-project.org and http://www.statistik.lmu.de/~leisch/Sweave/. Sweave() is an R function that processes an R/noweb file containing a mixture of R and latex, evaluating the R code and inlining any resulting textual or graphical output into the latex output. Dan > > > > > -- > Non est ad astra mollis e terris via. > > > _______________________________________________ > 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