emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric S Fraga <e.fraga@ucl.ac.uk>
To: Bastien <bzg@gnu.org>
Cc: emacs-orgmode@gnu.org, Florian Adamsky <fa-orgmode@haktar.org>,
	Eric Schulte <eric.schulte@gmx.com>
Subject: Re: [PATCH] org.el: Added a new interactive function which inserts a code block
Date: Wed, 9 May 2012 11:17:16 +0930	[thread overview]
Message-ID: <87mx5ijfbv.fsf@ucl.ac.uk> (raw)
In-Reply-To: <87d36e76d1.fsf@gnu.org> (Bastien's message of "Tue, 8 May 2012 22:41:46 +0200")

Bastien <bzg@gnu.org> writes:

> Hi Florian and Eric,
>
> Eric Schulte <eric.schulte@gmx.com> 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

      parent reply	other threads:[~2012-05-09  1:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-08 19:19 [PATCH] org.el: Added a new interactive function which inserts a code block Florian Adamsky
2012-05-08 18:30 ` Eric Schulte
2012-05-08 20:41   ` Bastien
2012-05-08 22:19     ` Michael Hannon
2012-05-09  1:47     ` Eric S Fraga [this message]

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=87mx5ijfbv.fsf@ucl.ac.uk \
    --to=e.fraga@ucl.ac.uk \
    --cc=bzg@gnu.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=eric.schulte@gmx.com \
    --cc=fa-orgmode@haktar.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).