[Top][All Lists]

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

[Orgmode] Re: [Babel] Macro for begin_src?

From: Eric S Fraga
Subject: [Orgmode] Re: [Babel] Macro for begin_src?
Date: Sun, 18 Apr 2010 21:25:45 +0100
User-agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (Gojō) APEL/10.7 Emacs/23.1 (i486-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)

On Sun, 18 Apr 2010 22:13:27 +0200, Štěpán Němec <address@hidden> wrote:
> Dan Davison <address@hidden> writes:
> > I guess, for Nate's original application (converting existing code to
> > src blocks), what might have been most useful is something to enclose a
> > given region in a source block. Can anyone show how to do that with
> > yasnippet (or anything else)?
> I don't have a ready-to-use snippet, but this is what you need:
> http://yasnippet.googlecode.com/svn/trunk/doc/snippet-development.html#yas-wrap-around-region
> HTH,
>   Štěpán

and you can also insert the value of yas/selected-text directly into
the snippet anywhere you want.  e.g.

--8<---------------cut here---------------start------------->8---
#name : testing yasnippets for org-mode
# --
--8<---------------cut here---------------end--------------->8---

of course, you can only do this (or the wrap around region approach)
if you invoke the snippet directly using a key binding (e.g. the
default "C-c & C-s" or "M-x yas/insert-snippet") as opposed to tab
expansion on the snippet name (which is more convenient).

Note that you can assign key bindings directly to snippets.

reply via email to

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