From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: andrea Newsgroups: gmane.emacs.help Subject: couple of simple yasnippet questions Date: Sat, 16 Jan 2010 19:28:44 +0100 Message-ID: Reply-To: andrea.crotti.0@gmail.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1263666590 24191 80.91.229.12 (16 Jan 2010 18:29:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 16 Jan 2010 18:29:50 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Jan 16 19:29:42 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NWDP3-0002UM-Tg for geh-help-gnu-emacs@m.gmane.org; Sat, 16 Jan 2010 19:29:42 +0100 Original-Received: from localhost ([127.0.0.1]:39848 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NWDP4-000271-Jb for geh-help-gnu-emacs@m.gmane.org; Sat, 16 Jan 2010 13:29:42 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NWDOf-00026u-4d for help-gnu-emacs@gnu.org; Sat, 16 Jan 2010 13:29:17 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NWDOZ-00026X-M2 for help-gnu-emacs@gnu.org; Sat, 16 Jan 2010 13:29:15 -0500 Original-Received: from [199.232.76.173] (port=43352 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NWDOZ-00026U-Fj for help-gnu-emacs@gnu.org; Sat, 16 Jan 2010 13:29:11 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:41002) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NWDOY-0007rB-W1 for help-gnu-emacs@gnu.org; Sat, 16 Jan 2010 13:29:11 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.50) id 1NWDOV-0002I8-Tr for help-gnu-emacs@gnu.org; Sat, 16 Jan 2010 19:29:07 +0100 Original-Received: from 73-084.eduroam.rwth-aachen.de ([134.61.73.84]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 16 Jan 2010 19:29:07 +0100 Original-Received: from andrea.crotti.0 by 73-084.eduroam.rwth-aachen.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 16 Jan 2010 19:29:07 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 37 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 73-084.eduroam.rwth-aachen.de User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.1.50 (darwin) Cancel-Lock: sha1:sElRd/YDKk6zuxi5Py4ZmGLXkro= X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:71259 Archived-At: 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