From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Glauber Alex Dias Prado Newsgroups: gmane.emacs.help Subject: Re: couple of simple yasnippet questions Date: Sun, 17 Jan 2010 12:25:31 -0200 Message-ID: <86wrzgn6zo.fsf@gmail.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1263738433 25979 80.91.229.12 (17 Jan 2010 14:27:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 17 Jan 2010 14:27:13 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: andrea.crotti.0@gmail.com Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jan 17 15:27:06 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 1NWW5p-0000Xo-Cc for geh-help-gnu-emacs@m.gmane.org; Sun, 17 Jan 2010 15:27:05 +0100 Original-Received: from localhost ([127.0.0.1]:35431 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NWW5q-00031e-4k for geh-help-gnu-emacs@m.gmane.org; Sun, 17 Jan 2010 09:27:06 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NWW5R-000319-ND for help-gnu-emacs@gnu.org; Sun, 17 Jan 2010 09:26:41 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NWW5Q-00030W-4o for help-gnu-emacs@gnu.org; Sun, 17 Jan 2010 09:26:40 -0500 Original-Received: from [199.232.76.173] (port=45951 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NWW5P-00030T-Vz for help-gnu-emacs@gnu.org; Sun, 17 Jan 2010 09:26:40 -0500 Original-Received: from qw-out-1920.google.com ([74.125.92.146]:25291) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NWW5P-0005Qc-IB for help-gnu-emacs@gnu.org; Sun, 17 Jan 2010 09:26:39 -0500 Original-Received: by qw-out-1920.google.com with SMTP id 5so38576qwf.24 for ; Sun, 17 Jan 2010 06:26:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:references :face:date:in-reply-to:message-id:user-agent:mime-version :content-type; bh=wAKkZ7+jZEZASXS28DV/DxI+PA2AhNDY1cndCz+RG/c=; b=GGMkVT2ByFuYszFURqK1XogX9RI6HubeJp9uKa/ZuwMQK9E17gDytFRH9lEVemL1ky Jq3e2MjgX/OcJ+ndM5+/gxIRSfgqEv2rIEMHCKPWVXHTxyQ4FZyb2mVCr8F1wLHNqGHx 2PUTjBaKOhcS3TuSNy63ByT7yiMFfbYAjpb5U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:references:face:date:in-reply-to:message-id :user-agent:mime-version:content-type; b=U12jbLQZjGa72054wqZv1rDcpN80ax+f1tj/V2qTz9otRcjoZmELT+r0bSEasYG9Yi CqXHy+MhIeSx/iMK4dgXHIF+ooo2h7OTtZlagr2f9hMkvHEBD0iQOi/5FuyQQ0R/zdVK d8crvfCTVgMYixhbwJ3VxOT5QyWGntta1UgY0= Original-Received: by 10.229.32.10 with SMTP id a10mr426201qcd.105.1263738398293; Sun, 17 Jan 2010 06:26:38 -0800 (PST) Original-Received: from localhost ([187.2.113.26]) by mx.google.com with ESMTPS id 23sm3936714qyk.3.2010.01.17.06.26.35 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 17 Jan 2010 06:26:36 -0800 (PST) Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAACVBMVEX9/Py9sZ6FcE5gCec3 AAAACXBIWXMAAABIAAAASABGyWs+AAAACXZwQWcAAAAwAAAAMADO7oxXAAABGklEQVQoz02RPW6E MBCFx6uQwlWKJQUHSJFTUKUmUowiVylWSOtT7BEoshRUKQCt3ykz4x+wKfCnGea9eRDxUX8UjzIX qpYMDlsPE6EC0ANjBL5NwBqg7j36Fb4LAIPZAGHGG8PG4AXeeQBmfsYdvA2gBbBaLGcWtQEc/FPL tU8hx9IC1AhZTEFK8U3gFjd4BQYgtKmf2Nmm3ZQIB6+aF3VsPUAzipEIA3gMNsiLDbWk5jSgeVD3 bDMsvOEVse1FDP2ecijUoyNMKcoTJ+AyEH+r55yrmLoXQKaE+lFAU1b0tYSyTfsCqq8S0u87h9EJ hpB6Gq0vopOMKtlyF3XdUSH9TZW90d5XuzaLuOl+GNDYDtMqJpXOBzv7B2mugjLxx2cLAAAAQnRF WHRjb21tZW50AENSRUFUT1I6IGdkLWpwZWcgdjEuMCAodXNpbmcgSUpHIEpQRUcgdjYyKSwgcXVh bGl0eSA9IDEwMAowBf9PAAAAJXRFWHRjcmVhdGUtZGF0ZQAyMDA5LTA1LTI2VDA3OjM2OjUwLTAz OjAw8P7KDgAAABF0RVh0anBlZzpjb2xvcnNwYWNlADIsdVWfAAAAIHRFWHRqcGVnOnNhbXBsaW5n LWZhY3RvcgAyeDIsMXgxLDF4MUn6prQAAAAldEVYdG1vZGlmeS1kYXRlADIwMDktMDUtMjZUMDc6 MzY6NTAtMDM6MDCvT7w6AAAAAElFTkSuQmCC In-Reply-To: (andrea's message of "Sat, 16 Jan 2010 19:28:44 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) 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:71272 Archived-At: andrea 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