emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Automatically insert R source code block?
@ 2011-09-15 23:18 Michael Hannon
  2011-09-15 23:58 ` suvayu ali
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Hannon @ 2011-09-15 23:18 UTC (permalink / raw)
  To: Org-Mode List

[-- Attachment #1: Type: text/plain, Size: 1299 bytes --]

Greetings.  Pardon my ignorance, but I'm having trouble understanding some elisp syntax.

Some time ago I asked on this list how to use the "<...<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
        '("S" "#+BEGIN_SRC ?\n\n#+END_SRC" "<src lang=\"?\">\n\n</src>"))


and this indeed worked 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_src" string.

Here's an example of something I tried:


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

The first part of this works OK; i.e., I do get:

    #+begin_src R

    #+end_src

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.


If you have any suggestions, please send them to me.  Thanks.

-- Mike

[-- Attachment #2: Type: text/html, Size: 1879 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-09-16  8:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-15 23:18 Automatically insert R source code block? Michael Hannon
2011-09-15 23:58 ` suvayu ali
2011-09-16  0:22   ` Michael Hannon
2011-09-16  8:49     ` Rainer M Krug

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).