[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
# --
#+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.
- Re: [Orgmode] Re: [Babel] Macro for begin_src?, (continued)
- Re: [Orgmode] Re: [Babel] Macro for begin_src?, Eric S Fraga, 2010/04/19
- Re: [Orgmode] Re: [Babel] Macro for begin_src?, Sebastian Rose, 2010/04/19
- [Orgmode] Re: [Babel] Macro for begin_src?, Sébastien Vauban, 2010/04/20
- Re: [OT] [Orgmode] Re: [Babel] Macro for begin_src?, Eric S Fraga, 2010/04/20
- Re: [Orgmode] Re: [Babel] Macro for begin_src?, Eric Schulte, 2010/04/20
- [Orgmode] Re: [Babel] Macro for begin_src?, Matt Lundin, 2010/04/17
- Re: [Orgmode] Re: [Babel] Macro for begin_src?, Thomas S. Dye, 2010/04/17
- Re: [Orgmode] Re: [Babel] Macro for begin_src?, Eric S Fraga, 2010/04/18
- Re: [Orgmode] Re: [Babel] Macro for begin_src?, Dan Davison, 2010/04/18
- [Orgmode] Re: [Babel] Macro for begin_src?, Štěpán Němec, 2010/04/19
- [Orgmode] Re: [Babel] Macro for begin_src?,
Eric S Fraga <=
Re: [Orgmode] Re: [Babel] Macro for begin_src?, Dan Davison, 2010/04/16
- Re: [Orgmode] Re: [Babel] Macro for begin_src?, Nathan Neff, 2010/04/16
- Re: [Orgmode] Re: [Babel] Macro for begin_src?, Dan Davison, 2010/04/16
- [Orgmode] Re: [Babel] Macro for begin_src?, Štěpán Němec, 2010/04/17
- [Orgmode] Re: [Babel] Macro for begin_src?, Nathan Neff, 2010/04/17
- Re: [Orgmode] Re: [Babel] Macro for begin_src?, Erik Iverson, 2010/04/17
- Re: [Orgmode] Re: [Babel] Macro for begin_src?, Nathan Neff, 2010/04/17
- Re: [Orgmode] Re: [Babel] Macro for begin_src?, Eric Schulte, 2010/04/17
Re: [Orgmode] [Babel] Macro for begin_src?, Thomas S. Dye, 2010/04/16
[Orgmode] Re: [Babel] Macro for begin_src?, Bernt Hansen, 2010/04/16