From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?B?xaB0xJtww6FuIE7Em21lYw==?= Subject: Re: [Babel] Macro for begin_src? Date: Sat, 17 Apr 2010 13:03:11 +0200 Message-ID: <87wrw6z6hc.fsf@gmail.com> References: <87fx2ug61h.fsf@stats.ox.ac.uk> <874ojag2bo.fsf@stats.ox.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O35o0-0005GL-CY for emacs-orgmode@gnu.org; Sat, 17 Apr 2010 07:03:20 -0400 Received: from [140.186.70.92] (port=43835 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O35ny-0005Ez-Pv for emacs-orgmode@gnu.org; Sat, 17 Apr 2010 07:03:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O35nx-0000bc-7Z for emacs-orgmode@gnu.org; Sat, 17 Apr 2010 07:03:18 -0400 Received: from fg-out-1718.google.com ([72.14.220.159]:15218) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O35nw-0000bI-W3 for emacs-orgmode@gnu.org; Sat, 17 Apr 2010 07:03:17 -0400 Received: by fg-out-1718.google.com with SMTP id e12so764809fga.12 for ; Sat, 17 Apr 2010 04:03:15 -0700 (PDT) In-Reply-To: <874ojag2bo.fsf@stats.ox.ac.uk> (Dan Davison's message of "Fri, 16 Apr 2010 23:55:39 -0400") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Dan Davison Cc: emacs-orgmode@gnu.org Dan Davison writes: >> Thanks!=C2=A0 I'm having trouble triggering the yasnippets using the TAB= key, so > I'm >> just using the GUI menu. >> >> Do you literally type "src" (no quotes), then press Tab? > > Yeah, but there's some magic code needed, which is also on Bernt's > page. > > (add-hook 'org-mode-hook > (lambda () > ;; yasnippet > (make-variable-buffer-local 'yas/trigger-key) > (setq yas/trigger-key [tab]) > (define-key yas/keymap [tab] 'yas/next-field-group))) I'm guessing what you really want there is (set (make-local-variable 'yas/trigger-key) [tab]) instead of > (make-variable-buffer-local 'yas/trigger-key) > (setq yas/trigger-key [tab]) The difference is that in the latter case you're making `yas/trigger-key' be automatically buffer-local for *all* buffers, not only in the buffer you're setting it (see e.g. the docstring of `make-variable-buffer-local'). =C5=A0t=C4=9Bp=C3=A1n