From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?Nordl=F6w?= Newsgroups: gmane.emacs.help Subject: Re: YAsnippet Emacs-Lisp Templates Date: Thu, 25 Sep 2008 02:39:26 -0700 (PDT) Organization: http://groups.google.com Message-ID: <31d2385f-2763-4f49-832e-f5ff89e270ea@f63g2000hsf.googlegroups.com> References: <87myhwaaxh.fsf@manatee.domain> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1222336380 15820 80.91.229.12 (25 Sep 2008 09:53:00 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 25 Sep 2008 09:53:00 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Sep 25 11:53:58 2008 connect(): Connection refused 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 1KinXn-0001Kz-2n for geh-help-gnu-emacs@m.gmane.org; Thu, 25 Sep 2008 11:53:55 +0200 Original-Received: from localhost ([127.0.0.1]:37994 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KinWk-0007Gt-SI for geh-help-gnu-emacs@m.gmane.org; Thu, 25 Sep 2008 05:52:50 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!f63g2000hsf.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 222 Original-NNTP-Posting-Host: 150.227.15.253 Original-X-Trace: posting.google.com 1222335567 3837 127.0.0.1 (25 Sep 2008 09:39:27 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Thu, 25 Sep 2008 09:39:27 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: f63g2000hsf.googlegroups.com; posting-host=150.227.15.253; posting-account=ytJKAgoAAAA1tg4ScoRszebXiIldA5vg User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; sv-SE; rv:1.9.0.2) Gecko/2008092313 Ubuntu/8.04 (hardy) Firefox/3.0.2, gzip(gfe), gzip(gfe) X-HTTP-Via: 1.1 netcache (NetCache NetApp/6.1.1RC1) Original-Xref: news.stanford.edu gnu.emacs.help:162713 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:58054 Archived-At: On 25 Sep, 10:26, Andy Stewart wrote: > >>>>> "Nordl=F6w" =3D=3D Nordl=F6w =A0 writes: > > Hi, Nordl=F6w! > > =A0 =A0 Nordl=F6w> Has anyone written any YAsnippet templates for emacs-l= isp? > =A0 =A0 Nordl=F6w> /Nordl=F6w > > This my YASnippet templates for emacs-lisp. > > ------------------------------> addal start <----------------------------= -- > #name : (autoload '... "..." "..." ...) > # -- > (autoload '${1:function-name} "${2:file-name}" "${3:document}" ${0:intera= ctive}) > ------------------------------> addal end =A0 <--------------------------= ---- > > ------------------------------> addav start <----------------------------= -- > #name : (defadvice ... ... ...) > # -- > (defadvice ${1:function-name} (${2:args}) > =A0 "${3:advice-document}" > =A0 (${0:advice-body}) > ) > ------------------------------> addav end =A0 <--------------------------= ---- > > ------------------------------> addbk start <----------------------------= -- > #name : (basic-set-key-alist ...) > # -- > (basic-set-key-alist ${0:rest}) > ------------------------------> addbk end =A0 <--------------------------= ---- > > ------------------------------> addgk start <----------------------------= -- > #name : (global-set-key (kbd "...") ...) > # -- > (global-set-key (kbd "${1:some-key}") ${0:some-command}) > ------------------------------> addgk end =A0 <--------------------------= ---- > > ------------------------------> addhk start <----------------------------= -- > #name : (dolist (hook (list ... )) (add-hook hook '...)) > # -- > (dolist (hook (list > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0${1:mode-list} > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0)) > =A0 (add-hook hook '${0:mode-hook})) > ------------------------------> addhk end =A0 <--------------------------= ---- > > ------------------------------> addhkd start <---------------------------= --- > #name : (dolist (hooked (list ...)) (add-hook '... 'hooked)) > # -- > (dolist (hooked (list > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0${1:mode-list} > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0)) > =A0 (add-hook '${0:mode-hook} 'hooked)) > ------------------------------> addhkd end =A0 <-------------------------= ----- > > ------------------------------> addlk start <----------------------------= -- > #name : (define-key ... (kbd "...") ...) > # -- > (define-key ${1:some-mode-map} (kbd "${2:some-key}") ${0:some-command}) > ------------------------------> addlk end =A0 <--------------------------= ---- > > ------------------------------> addpr start <----------------------------= -- > #name : (provide '...) > # -- > (provide '${0:library-name}) > ------------------------------> addpr end =A0 <--------------------------= ---- > > ------------------------------> addrq start <----------------------------= -- > #name : (require '...) > # -- > (require '${0:library-name}) > ------------------------------> addrq end =A0 <--------------------------= ---- > > ------------------------------> addse start <----------------------------= -- > #name : (setq ... ...) > # -- > (setq ${1:variable-name} ${0:variable-value}) > ------------------------------> addse end =A0 <--------------------------= ---- > > ------------------------------> deffu start <----------------------------= -- > #name : (defun ... (...) "..." ...) > # -- > (defun ${1:Function Name} ($2) > =A0 "${3:Function document}" > =A0 $0) > ------------------------------> deffu end =A0 <--------------------------= ---- > > ------------------------------> defvr start <----------------------------= -- > #name : (defvar ... ... "...") > # -- > (defvar ${1:variable-name} ${2:variable-varlue} "${0:document}") > ------------------------------> defvr end =A0 <--------------------------= ---- > > ------------------------------> evalal start <---------------------------= --- > #name : (eval-after-load ... ...) > # -- > (eval-after-load ${1:file-name} > =A0 ${0:form}) > ------------------------------> evalal end =A0 <-------------------------= ----- > > ------------------------------> header start <---------------------------= --- > #name : A elisp file header > # -- > ;;; ${1:filename}.el --- ${2:Simple description} > > ;; Author: ${3:Andy Stewart} ${4:} > ;; Maintainer: ${5:Andy Stewart} ${6:} > ;; Copyright (C) 2008, $3, all rights reserved. > ;; Created: ${7:Created time} > ;; Version: ${8:Current version} > ;; Last-Updated: ${9:Update time} > ;; URL: ${10:not distributed yet} > ;; Keywords: ${11:keyword} > ;; Compatibility: GNU Emacs ${12:Compatibility version} > > ;; This program is free software; you can redistribute it and/or modify > ;; it under the terms of the GNU General Public License as published by > ;; the Free Software Foundation; either version 2, or (at your option) > ;; any later version. > > ;; This program is distributed in the hope that it will be useful, > ;; but WITHOUT ANY WARRANTY; without even the implied warranty of > ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. =A0See the > ;; GNU General Public License for more details. > > ;; You should have received a copy of the GNU General Public License > ;; along with this program; see the file COPYING. =A0If not, write to > ;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth > ;; Floor, Boston, MA 02110-1301, USA. > > ;; Features that might be requried by this library: > ;; > ;; =A0 =A0 =A0${13:None} > ;; > > ;;; Installation: > ;; > ;; Copy $1.el to your load-path and add to your ~/.emacs > ;; > ;; =A0 =A0 =A0(require '$1) > ;; > ;; ${14:No need more} > > ;;; Commentary: > ;; > ;; ${15:Comment} > ;; > > ;;; Change log: > ;; =A0 =A0 =A0 > ;; =A0 =A0 =A0${16:Chang log} > ;; > > ;;; Acknowledgements: > ;; > ;; $17 > ;; > > ;;; TODO > ;; > ;; $18 > ;; > > ;;; Require > $19 > > ;;; Code: > > $0 > > (provide '$1) > > ;;; $1.el ends here > ------------------------------> header end =A0 <-------------------------= ----- > > Enjoy! > > Andy. Great! Is it possible to change the way these are are triggered (the keys I believe YAsnippet calls them)? I would like yasnippet to trigger on the real uses of them. For example "(defmacro " + TAB expands defmacro-statement. Thanks in advance, Nordl=F6w