On Sun, 18 Apr 2010 22:13:27 +0200, Štěpán Němec <step...@gmail.com> wrote:
> 
> Dan Davison <davi...@stats.ox.ac.uk> 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
# --
#+BEGIN_LaTeX
`yas/selected-text`
$0
#+END_LaTeX
--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.


_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

Reply via email to