emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [PATCH] org.el: Added a new interactive function which inserts a


From: Eric S Fraga
Subject: Re: [O] [PATCH] org.el: Added a new interactive function which inserts a code block
Date: Wed, 9 May 2012 11:17:16 +0930
User-agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.1.50 (gnu/linux)

Bastien <address@hidden> writes:

> Hi Florian and Eric,
>
> Eric Schulte <address@hidden> writes:
>
>> Have you tried typing "<s" and then pressing TAB.  This is how I insert
>> code blocks, as well as <q for quote blocks, etc...
>>
>> That said your function does more than the <s approach because it also
>> limits the languages to those which are supported.  If others think this
>> is generally useful I'd be happy to add it to ob.el.
>
> Don't we have this already?
>
> <s TAB M-TAB
>
> inserts
>
> #+begin_src 
>
> and offers completion over ̀org-babel-load-languages' (see
> `pcomplete/org-mode/block-option/src' in org-pcomplete.el)
>
> This spares us new keybindings :)  

Thanks for this!  I didn't know that completion was possible at that
point.  Mind you, the list of possible completions seems to be somewhat
limited.  I wonder where the list comes from? (I know: I should look at
the code... ;-)

For the OP, I use yasnippet [1] to introduce src code blocks:

,----[ src ]
| #name : #+begin_src language options ...#+end_src
| # --
| #+name: $1
| #+begin_src $2 $3
| $0
| #+end_src
`----


Footnotes: 
[1]  https://github.com/capitaomorte/yasnippet

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.1.50.1
: using Org release_7.8.09-544-g505cc7




reply via email to

[Prev in Thread] Current Thread [Next in Thread]