all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* couple of simple yasnippet questions
@ 2010-01-16 18:28 andrea
  2010-01-17 14:25 ` Glauber Alex Dias Prado
  0 siblings, 1 reply; 2+ messages in thread
From: andrea @ 2010-01-16 18:28 UTC (permalink / raw)
  To: help-gnu-emacs

I end up to define every day new snippets and it's wonderful, but I
still have some problems when they become more complicated.

- bang
  with this I would just like to insert the right bang line depending on
  the mode.
  This thing below doesn't work...

--8<---------------cut here---------------start------------->8---
  #!$$envvar $$(cdr (assoc major-mode execlists))
--8<---------------cut here---------------end--------------->8---

- latex matrix
  I have to write sometimes latex matrices, but normally I write them
  inside org-mode.
  Would it be possible to make the *matrix* snippet only available for
  latex and org-mode?
  This is the snippet.
  
--8<---------------cut here---------------start------------->8---
# -*- mode: snippet -*-
# name: matrix
# key: matrix
# possible improvement, compute the number of lines from the argument to array
# --
\left \(
\begin{array}{${1:ccc}}
${2:v1 & v2} \\
$0
\end{array}
\right \)
--8<---------------cut here---------------end--------------->8---

  A wonderful thing that it could do is creating as many lines as I
  define in the "ccc" part, any idea on how to do it?

  Thanks





^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: couple of simple yasnippet questions
  2010-01-16 18:28 couple of simple yasnippet questions andrea
@ 2010-01-17 14:25 ` Glauber Alex Dias Prado
  0 siblings, 0 replies; 2+ messages in thread
From: Glauber Alex Dias Prado @ 2010-01-17 14:25 UTC (permalink / raw)
  To: andrea.crotti.0; +Cc: help-gnu-emacs

andrea <andrea.crotti.0@gmail.com> writes:

> I end up to define every day new snippets and it's wonderful, but I
> still have some problems when they become more complicated.
>
> - bang
>   with this I would just like to insert the right bang line depending on
>   the mode.
>   This thing below doesn't work...
>
>   #!$$envvar $$(cdr (assoc major-mode execlists))
no clue
>
> - latex matrix
>   I have to write sometimes latex matrices, but normally I write them
>   inside org-mode.
>   Would it be possible to make the *matrix* snippet only available for
>   latex and org-mode?
my guess is that you could make org-mode snippets on a sub-dir of
latex-mode snippets this way you would inherit all latex snippets
from org-mode.
>   This is the snippet.
>   
> # -*- mode: snippet -*-
> # name: matrix
> # key: matrix
> # possible improvement, compute the number of lines from the argument to array
> # --
> \left \(
> \begin{array}{${1:ccc}}
> ${2:v1 & v2} \\
> $0
> \end{array}
> \right \)
>
>   A wonderful thing that it could do is creating as many lines as I
>   define in the "ccc" part, any idea on how to do it?
no clue either but it would involve some elisp coding (i am not yet one
such coder), i guess its doable.
>
>   Thanks




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-01-17 14:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-16 18:28 couple of simple yasnippet questions andrea
2010-01-17 14:25 ` Glauber Alex Dias Prado

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.