emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Dan Davison <davison@stats.ox.ac.uk>
To: emacs-orgmode@gnu.org
Subject: can't get source code editing working
Date: Sun, 25 May 2008 21:04:08 +0100	[thread overview]
Message-ID: <20080525200408.GA28173@stats.ox.ac.uk> (raw)
In-Reply-To: <ba5c48a70805250925p1aaeaf77o5f07887dfb743c45@mail.gmail.com>

On Sun, May 25, 2008 at 10:25:22AM -0600, Charles Martin wrote:
> On Sun, May 25, 2008 at 10:00 AM,  <emacs-orgmode-request@gnu.org> 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 <austin.frank@gmail.com>
> > Subject: [Orgmode] Re: Org mode release 6.04
> > To: emacs-orgmode@gnu.org
> > Message-ID: <m07idi8sj1.fsf@h-67-102-51-235.mclnva23.covad.net>
> > 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

  reply	other threads:[~2008-05-25 20:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <48398dc2.1235640a.21e3.ffffbe00SMTPIN_ADDED@mx.google.com>
2008-05-25 16:25 ` Emacs-orgmode Digest, Vol 27, Issue 47 Charles Martin
2008-05-25 20:04   ` Dan Davison [this message]
2008-05-25 22:33     ` can't get source code editing working Carsten Dominik
2008-05-25 16:39 ` Emacs-orgmode Digest, Vol 27, Issue 47 Charles Martin
2008-05-25 16:59   ` Carsten Dominik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080525200408.GA28173@stats.ox.ac.uk \
    --to=davison@stats.ox.ac.uk \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).