Christian Moe <m...@christianmoe.com> writes:

Hi Christian, 

> Here's one way, and pointers to more:
> http://lists.gnu.org/archive/html/emacs-orgmode/2011-04/msg00406.html

thanks for the links. 

I mean, it is not toooo difficult to write a function like 

,----------------------------------------------------------
| (defun org-insert-block (lang)
|    (interactive "Mlanguage: ")
|    (insert (format "#+begin_src %s\n  \n#+end_src" lang))
|    (goto-char (- (point) 10)))
`----------------------------------------------------------

or to write insert statements like 

,-------------------------------------------------------
| (insert (format "#+begin_src %s\n  \n#+end_src" lang))
`-------------------------------------------------------

in a program - but I find it strange that this is not part of core
Org-mode functionality. There are dozens of functions that deal with
existing code-blocks, but none (non-interactive) that creates/inserts
a code-block.

So here is my FEATURE REQUEST:

either modify `org-babel-demarcate-block' so that it can be used to
insert a language-specific code-block (with args?) non-interactively, or
add something like `org-insert-block' to Org-mode's core. I would prefer
signature

,----------------------------------------------
| (defun org-insert-block (lang &rest args)...)
`----------------------------------------------

to be able to specify the src-block headline exactly in a program that
uses this function.

-- 
cheers,
Thorsten


Reply via email to