[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Orgmode] can't get source code editing working
From: |
Dan Davison |
Subject: |
[Orgmode] can't get source code editing working |
Date: |
Sun, 25 May 2008 21:04:08 +0100 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
On Sun, May 25, 2008 at 10:25:22AM -0600, Charles Martin wrote:
> On Sun, May 25, 2008 at 10:00 AM, <address@hidden> 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 `<src...' structure. `lang'
> > 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 <address@hidden>
> > Subject: [Orgmode] Re: Org mode release 6.04
> > To: address@hidden
> > Message-ID: <address@hidden>
> > 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.
> address@hidden
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode